From 126a29f4cc293f4497b8796c4fa1625236554067 Mon Sep 17 00:00:00 2001 From: hunt Date: Wed, 29 Jun 2005 19:52:01 +0000 Subject: 2005-06-29 Martin Hunt * current.c (_stp_ret_addr_r): New function. (_stp_probe_addr): New function. (_stp_probe_addr_r): New function. --- runtime/current.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'runtime/current.c') diff --git a/runtime/current.c b/runtime/current.c index 82ab400e..7edfaf5f 100644 --- a/runtime/current.c +++ b/runtime/current.c @@ -34,6 +34,29 @@ unsigned long _stp_ret_addr (struct pt_regs *regs) #endif } +/** Get the current return address for a return probe. + * Call from kprobe return probe. + * @param ri Pointer to the struct kretprobe_instance. + * @return The return address + */ +#define _stp_ret_addr_r(ri) (ri->ret_addr) + +/** Get the probe address for a kprobe. + * Call from a kprobe. This will return the + * address of the function that is being probed. + * @param kp Pointer to the struct kprobe. + * @return The function's address + */ +#define _stp_probe_addr(kp) (kp->addr) + +/** Get the probe address for a return probe. + * Call from kprobe return probe. This will return the + * address of the function that is being probed. + * @param ri Pointer to the struct kretprobe_instance. + * @return The function's address + */ +#define _stp_probe_addr_r(ri) (ri->rp->kp.addr) + #ifdef __x86_64__ void _stp_sprint_regs(String str, struct pt_regs * regs) { @@ -78,7 +101,7 @@ void _stp_sprint_regs(String str, struct pt_regs * regs) /** Write the registers to a string. * @param regs The pt_regs saved by the kprobe. - * @note i386 and x86_64 only so far. + * @note i386 and x86_64 only so far. */ void _stp_sprint_regs(String str, struct pt_regs * regs) { -- cgit