summaryrefslogtreecommitdiffstats
path: root/translate.cxx
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-11-10 18:37:02 -0800
committerJosh Stone <jistone@redhat.com>2009-11-10 18:48:34 -0800
commitaf234c407dbab3e62994863272a63b612b0c8c63 (patch)
tree7b2fb7929bbc776a3eae96ef311f890e319a0bf2 /translate.cxx
parentb513cd75dac185ac258dc8260a01891c30be6251 (diff)
downloadsystemtap-steved-af234c407dbab3e62994863272a63b612b0c8c63.tar.gz
systemtap-steved-af234c407dbab3e62994863272a63b612b0c8c63.tar.xz
systemtap-steved-af234c407dbab3e62994863272a63b612b0c8c63.zip
PR5916: Exploit kretprobe data storage area
Since 2.6.25, kretprobes can carry a data packet to be filled in an entry_handler. This patch lets us store our implicitly-saved $target variables in .return probes in that data area. * tapset/kretprobe.stp: New get/set functions for kretprobe data. * translate.cxx (c_unparser::emit_common_header): Add context->pi_longs. * tapsets.cxx (dwarf_var_expanding_visitor::visit_target_symbol_saved_return): Switch between the old and new methods of saving $vars in .return probes. (dwarf_var_expanding_visitor::gen_mapped_saved_return): The old way. (dwarf_var_expanding_visitor::gen_kretprobe_saved_return): The new way. (dwarf_derived_probe::join_group): Don't register paired entry-handlers. (dwarf_derived_probe::dwarf_derived_probe): Remember saved-var details. (dwarf_derived_probe_group::emit_module_decls): Output saved-var details. Also split the kretprobe handler whether we're on entry or return. (dwarf_derived_probe_group::emit_module_init): Prepare the entry handler. * testsuite/systemtap.base/kretprobe-vars.stp: Test implicit $var saving.
Diffstat (limited to 'translate.cxx')
-rw-r--r--translate.cxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/translate.cxx b/translate.cxx
index ed415abb..cbb8f1e3 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -892,6 +892,7 @@ c_unparser::emit_common_header ()
o->newline() << "unsigned long *unwaddr;";
// unwaddr is caching unwound address in each probe handler on ia64.
o->newline() << "struct kretprobe_instance *pi;";
+ o->newline() << "int pi_longs;"; // int64_t count in pi->data, the rest is string_t
o->newline() << "int regparm;";
o->newline() << "va_list *mark_va_list;";
o->newline() << "const char * marker_name;";