summaryrefslogtreecommitdiffstats
path: root/runtime/current.c
diff options
context:
space:
mode:
authorhunt <hunt>2005-06-29 19:52:01 +0000
committerhunt <hunt>2005-06-29 19:52:01 +0000
commit126a29f4cc293f4497b8796c4fa1625236554067 (patch)
tree8a08921200223da9c8427a89e445c245ab01a716 /runtime/current.c
parent2ac0b9f2e9d7d12e1fcf3909e35a2dd835d2402d (diff)
downloadsystemtap-steved-126a29f4cc293f4497b8796c4fa1625236554067.tar.gz
systemtap-steved-126a29f4cc293f4497b8796c4fa1625236554067.tar.xz
systemtap-steved-126a29f4cc293f4497b8796c4fa1625236554067.zip
2005-06-29 Martin Hunt <hunt@redhat.com>
* current.c (_stp_ret_addr_r): New function. (_stp_probe_addr): New function. (_stp_probe_addr_r): New function.
Diffstat (limited to 'runtime/current.c')
-rw-r--r--runtime/current.c25
1 files changed, 24 insertions, 1 deletions
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)
{