This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Compilation error on non-utrace kernel
- From: Wenji Huang <wenji dot huang at oracle dot com>
- To: wenji dot huang at oracle dot com
- Cc: SystemTAP <systemtap at sources dot redhat dot com>
- Date: Wed, 19 Aug 2009 11:26:37 +0800
- Subject: Re: Compilation error on non-utrace kernel
- References: <4A890750.6020109@oracle.com>
- Reply-to: wenji dot huang at oracle dot com
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";