diff options
-rw-r--r-- | runtime/sym.h | 4 | ||||
-rw-r--r-- | translate.cxx | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/runtime/sym.h b/runtime/sym.h index ca69345f..9f2bdfd0 100644 --- a/runtime/sym.h +++ b/runtime/sym.h @@ -66,6 +66,10 @@ static unsigned _stp_num_modules; /* load address, fixup by transport symbols _stp_do_relocation */ static unsigned long _stp_kretprobe_trampoline; +/* Indicates some modules requested the task finder to notify sym.c + _stp_sym_init () should track vma maps. */ +static char _stp_need_vma_tracker; + static unsigned long _stp_module_relocate (const char *module, const char *section, unsigned long offset); static struct _stp_module *_stp_get_unwind_info (unsigned long addr); diff --git a/translate.cxx b/translate.cxx index cbb8f1e3..ca298113 100644 --- a/translate.cxx +++ b/translate.cxx @@ -1172,6 +1172,8 @@ c_unparser::emit_module_init () // PR10228: set up symbol table-related task finders. o->newline() << "#if defined(STP_NEED_VMA_TRACKER)"; o->newline() << "_stp_sym_init();"; + o->newline() << "#else"; + o->newline() << "if (_stp_need_vma_tracker == 1) _stp_sym_init();"; o->newline() << "#endif"; // NB: we don't need per-_stp_module task_finders, since a single common one // set up in runtime/sym.c's _stp_sym_init() will scan through all _stp_modules. @@ -5023,6 +5025,11 @@ emit_symbol_data_done (unwindsym_dump_context *ctx, systemtap_session& s) ctx->output << "0x" << hex << ctx->stp_kretprobe_trampoline_addr << dec << ";\n"; + // Note when someone requested the task_finder. + ctx->output << "static char _stp_need_vma_tracker = " + << (s.task_finder_derived_probes ? "1" : "0") + << ";\n"; + // Some nonexistent modules may have been identified with "-d". Note them. if (! s.suppress_warnings) for (set<string>::iterator it = ctx->undone_unwindsym_modules.begin(); |