Compilation error on non-utrace kernel
Wenji Huang
wenji.huang@oracle.com
Wed Aug 19 03:30:00 GMT 2009
Wenji Huang wrote:
> diff --git a/translate.cxx b/translate.cxx
> index 69b1630..851c6a7 100644
> --- a/translate.cxx
> +++ b/translate.cxx
> @@ -4836,11 +4836,13 @@ dump_unwindsyms (Dwfl_Module *m,
> if (mainfile[0] == '/') // user-space module
> {
> // NB: runtime/sym.c
> + c->output << "#if defined(CONFIG_UTRACE)\n";
> c->output << "static struct stap_task_finder_target _stp_vmcb_"
> << stpmod_idx << "= {\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 << "};\n";
> + c->output << "#endif\n";
As discussed on IRC with Frank and Roland, this patch is not
100% right. The stp_vmcb shouldn't be emitted for kernel symbols.
Please take a look at the new one.
diff --git a/translate.cxx b/translate.cxx
index 57e7e7c..f83b57a 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -4858,14 +4858,18 @@ 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 << "#if !defined(CONFIG_UTRACE)\n"; // explicit error
message
+ c->output << "#error \"no utrace support in kernel\"\n";
+ c->output << "#else\n";
c->output << "static struct stap_task_finder_target _stp_vmcb_"
<< stpmod_idx << "= {\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 << "};\n";
+ c->output << "#endif\n";
}
c->output << "static struct _stp_module _stp_module_" << stpmod_idx
<< " = {\n";
@@ -4873,8 +4877,11 @@ 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 << "#if defined(CONFIG_UTRACE)\n";
c->output << ".vmcb = & _stp_vmcb_" << stpmod_idx << ",\n";
+ c->output << "#endif\n";
+ }
c->output << ".dwarf_module_base = 0x" << hex << base << dec << ", \n";
c->output << ".eh_frame_addr = 0x" << hex << eh_addr << dec << ", \n";
More information about the Systemtap
mailing list