summaryrefslogtreecommitdiffstats
path: root/tapset
diff options
context:
space:
mode:
authorTim Moore <timoore@redhat.com>2009-12-16 12:00:55 +0100
committerTim Moore <timoore@redhat.com>2009-12-16 15:03:22 +0100
commit5e562a69a5432566c6ae78344ae51b80ced7f15b (patch)
tree3c8101132cad09ef61b0ccc89d1d0be0dc324fd8 /tapset
parent39a3e39706a18dbf3698b52fc1cc7532d94078e8 (diff)
downloadsystemtap-steved-5e562a69a5432566c6ae78344ae51b80ced7f15b.tar.gz
systemtap-steved-5e562a69a5432566c6ae78344ae51b80ced7f15b.tar.xz
systemtap-steved-5e562a69a5432566c6ae78344ae51b80ced7f15b.zip
set the IP in return probes to the returned-to instruction
It's easily available in kretprobes and uretprobes and is consistent with the rest of the program state. * translate.cxx (emit_common_header) : add uretprobe_instance to context. * tapsets.cxx (common_probe_entryfn_prologue): Initialize ri in context to 0. (dwarf_derived_probe_group::emit_module_decls): Change IP to return address in kretprobes. (uprobe_derived_probe_group::emit_module_decls): enter_uretprobe_probe: set ri (uretprobe_instance) in context. Change IP to return address in uretprobes. Don't emit uprobe include and #define * runtime/runtime.h : Add includes and #define for uprobes. * runtime/stack.c (_stp_stack_print, _stp_stack_snprint): Add extra argument for uretprobe_instance. * tapset/context-unwind.stp (print_backtrace, backtrace): Pass NULL for uretprobe_instance to _stp_stack_print. * tapset/ucontext-unwind.stp (print_ubacktrace, ubacktrace): pass uretprobe_instance to _stp_stack_print * testsuite/systemtap.context/uprobe_uaddr.exp : new test for uaddr in function probes * testsuite/systemtap.context/uprobe_uaddr.stp : new file
Diffstat (limited to 'tapset')
-rw-r--r--tapset/context-unwind.stp4
-rw-r--r--tapset/ucontext-unwind.stp4
2 files changed, 4 insertions, 4 deletions
diff --git a/tapset/context-unwind.stp b/tapset/context-unwind.stp
index 741031c0..8f35a783 100644
--- a/tapset/context-unwind.stp
+++ b/tapset/context-unwind.stp
@@ -28,7 +28,7 @@
*/
function print_backtrace () %{
if (CONTEXT->regs) {
- _stp_stack_print(CONTEXT->regs, 1, CONTEXT->pi, MAXTRACE, NULL);
+ _stp_stack_print(CONTEXT->regs, 1, CONTEXT->pi, MAXTRACE, NULL, NULL);
} else {
_stp_printf("Systemtap probe: %s\n", CONTEXT->probe_point);
}
@@ -42,7 +42,7 @@ function print_backtrace () %{
*/
function backtrace:string () %{ /* pure */
if (CONTEXT->regs)
- _stp_stack_snprint (THIS->__retvalue, MAXSTRINGLEN, CONTEXT->regs, 0, CONTEXT->pi, MAXTRACE, NULL);
+ _stp_stack_snprint (THIS->__retvalue, MAXSTRINGLEN, CONTEXT->regs, 0, CONTEXT->pi, MAXTRACE, NULL, NULL);
else
strlcpy (THIS->__retvalue, "", MAXSTRINGLEN);
%}
diff --git a/tapset/ucontext-unwind.stp b/tapset/ucontext-unwind.stp
index d699e588..e0d883b8 100644
--- a/tapset/ucontext-unwind.stp
+++ b/tapset/ucontext-unwind.stp
@@ -28,7 +28,7 @@ function print_ubacktrace () %{ /* unprivileged */
assert_is_myproc();
if (CONTEXT->regs) {
_stp_stack_print(CONTEXT->regs, 1, CONTEXT->pi, MAXTRACE,
- current);
+ current, CONTEXT->ri);
} else {
_stp_printf("Systemtap probe: %s\n", CONTEXT->probe_point);
}
@@ -47,7 +47,7 @@ function ubacktrace:string () %{ /* pure */ /* unprivileged */
if (CONTEXT->regs)
_stp_stack_snprint (THIS->__retvalue, MAXSTRINGLEN,
CONTEXT->regs, 0, CONTEXT->pi, MAXTRACE,
- current);
+ current, CONTEXT->ri);
else
strlcpy (THIS->__retvalue, "", MAXSTRINGLEN);
%}