From 5e562a69a5432566c6ae78344ae51b80ced7f15b Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Wed, 16 Dec 2009 12:00:55 +0100 Subject: 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 --- runtime/runtime.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'runtime/runtime.h') diff --git a/runtime/runtime.h b/runtime/runtime.h index ba583aeb..a7ee962c 100644 --- a/runtime/runtime.h +++ b/runtime/runtime.h @@ -31,6 +31,17 @@ #include #include +/* If uprobes isn't in the kernel, pull it in from the runtime. */ +#if defined(CONFIG_UPROBES) || defined(CONFIG_UPROBES_MODULE) +#include +#else +#include "uprobes/uprobes.h" +#endif +#ifndef UPROBES_API_VERSION +#define UPROBES_API_VERSION 1 +#endif + + #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) #if !defined (CONFIG_DEBUG_FS) && !defined (CONFIG_DEBUG_FS_MODULE) #error "DebugFS is required and was not found in the kernel." -- cgit