From ba8bd130e0482d1cae1b98480372b8c605e3eb2c Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Wed, 19 Aug 2009 12:18:48 -0400 Subject: [PATCH] PR10228: fix non-utrace building regression * translate.cxx (dump_unwindsyms): Decide based on modname[] not mainfile[] to emit a vmcb. * runtime/task_finder.c (non-UTRACE): Include dummy stap_{start,stop}_* functions. --- runtime/task_finder.c | 3 +++ translate.cxx | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/runtime/task_finder.c b/runtime/task_finder.c index 672b21f17..5ef27eef5 100644 --- a/runtime/task_finder.c +++ b/runtime/task_finder.c @@ -4,6 +4,9 @@ #if ! defined(CONFIG_UTRACE) /* Dummy definitions for use in sym.c */ struct stap_task_finder_target { }; +static int stap_start_task_finder(void) { return -EINVAL; } +static void stap_stop_task_finder(void) { } + #else #include diff --git a/translate.cxx b/translate.cxx index 57e7e7ce2..1c6d4fdb8 100644 --- a/translate.cxx +++ b/translate.cxx @@ -4858,13 +4858,15 @@ dump_unwindsyms (Dwfl_Module *m, mainfile = canonicalize_file_name(mainfile); // PR10228: populate the task_finder_vmcb. - if (mainfile[0] == '/') // user-space module + if (modname[0] == '/') // user-space module { // NB: runtime/sym.c c->output << "static struct stap_task_finder_target _stp_vmcb_" << stpmod_idx << "= {\n"; + c->output << "#ifdef CONFIG_UTRACE\n"; c->output << ".pathname = " << lex_cast_qstring (mainfile) << ",\n"; c->output << ".mmap_callback = &_stp_tf_mmap_cb,\n"; c->output << ".munmap_callback = &_stp_tf_munmap_cb,\n"; + c->output << "#endif\n"; c->output << "};\n"; } @@ -4873,7 +4875,7 @@ dump_unwindsyms (Dwfl_Module *m, c->output << ".path = " << lex_cast_qstring (mainfile) << ",\n"; // PR10228: populate the task_finder_vmcb. - if (mainfile[0] == '/') // user-space module + if (modname[0] == '/') // user-space module c->output << ".vmcb = & _stp_vmcb_" << stpmod_idx << ",\n"; c->output << ".dwarf_module_base = 0x" << hex << base << dec << ", \n"; -- 2.43.5