diff options
author | Dave Brolley <brolley@redhat.com> | 2009-06-03 11:44:55 -0400 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-06-03 11:44:55 -0400 |
commit | 0c820e5cc8eca45e94da1bfbf6091a098f180371 (patch) | |
tree | 2548e0f11d8dd6cf81df3a7ea4a4ef2ab7c8233a /translate.cxx | |
parent | ea9d509619ae8dc1512576bccdff2288a2c256dc (diff) | |
parent | 129de9ef18cd142e31ed509a7704d4faf0879f4c (diff) | |
download | systemtap-steved-0c820e5cc8eca45e94da1bfbf6091a098f180371.tar.gz systemtap-steved-0c820e5cc8eca45e94da1bfbf6091a098f180371.tar.xz systemtap-steved-0c820e5cc8eca45e94da1bfbf6091a098f180371.zip |
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Diffstat (limited to 'translate.cxx')
-rw-r--r-- | translate.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/translate.cxx b/translate.cxx index 6e0b3eab..0ef790db 100644 --- a/translate.cxx +++ b/translate.cxx @@ -4453,6 +4453,7 @@ struct unwindsym_dump_context systemtap_session& session; ostream& output; unsigned stp_module_index; + unsigned long stp_kretprobe_trampoline_addr; set<string> undone_unwindsym_modules; }; @@ -4690,6 +4691,11 @@ dump_unwindsyms (Dwfl_Module *m, secname = "_stext"; // NB: don't subtract session.sym_stext, which could be inconveniently NULL. // Instead, sym_addr will get compensated later via extra_offset. + + // We need to note this for the unwinder. + if (c->stp_kretprobe_trampoline_addr == (unsigned long) -1 + && ! strcmp (name, "kretprobe_trampoline_holder")) + c->stp_kretprobe_trampoline_addr = sym_addr; } else if (n > 0) { @@ -4739,6 +4745,10 @@ dump_unwindsyms (Dwfl_Module *m, } } + // Must be relative to actual kernel load address. + if (c->stp_kretprobe_trampoline_addr != (unsigned long) -1) + c->stp_kretprobe_trampoline_addr -= extra_offset; + // Add unwind data to be included if it exists for this module. void *debug_frame = NULL; size_t debug_len = 0; @@ -4923,7 +4933,7 @@ emit_symbol_data (systemtap_session& s) ofstream kallsyms_out ((s.tmpdir + "/" + symfile).c_str()); - unwindsym_dump_context ctx = { s, kallsyms_out, 0, s.unwindsym_modules }; + unwindsym_dump_context ctx = { s, kallsyms_out, 0, -1, s.unwindsym_modules }; // Micro optimization, mainly to speed up tiny regression tests // using just begin probe. @@ -5041,6 +5051,9 @@ emit_symbol_data_done (unwindsym_dump_context *ctx, systemtap_session& s) ctx->output << "};\n"; ctx->output << "static unsigned _stp_num_modules = " << ctx->stp_module_index << ";\n"; + ctx->output << "static unsigned long _stp_kretprobe_trampoline = 0x" + << hex << ctx->stp_kretprobe_trampoline_addr << dec << ";\n"; + // Some nonexistent modules may have been identified with "-d". Note them. for (set<string>::iterator it = ctx->undone_unwindsym_modules.begin(); it != ctx->undone_unwindsym_modules.end(); |