summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordsmith <dsmith>2007-10-15 20:12:36 +0000
committerdsmith <dsmith>2007-10-15 20:12:36 +0000
commit5089603fe5249154e956770bc3a4be566ea5cf97 (patch)
treecfbed0dfb39c82838115d3f414450ba1a18f901f
parent011f4aea7f49ecb1c9208617631c83eb277876db (diff)
downloadsystemtap-steved-5089603fe5249154e956770bc3a4be566ea5cf97.tar.gz
systemtap-steved-5089603fe5249154e956770bc3a4be566ea5cf97.tar.xz
systemtap-steved-5089603fe5249154e956770bc3a4be566ea5cf97.zip
2007-10-15 David Smith <dsmith@redhat.com>
* tapsets.cxx (mark_query::handle_query_module): Checks for marker to be in the proper section. (mark_derived_probe_group::emit_module_decls): Updated emitted marker C code for 10/2/2007 markers patch. Fixes PR 5178.
-rw-r--r--ChangeLog5
-rw-r--r--tapsets.cxx9
2 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e62fad24..daaac6f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2007-10-15 David Smith <dsmith@redhat.com>
+ * tapsets.cxx (mark_query::handle_query_module): Checks for marker
+ to be in the proper section.
+ (mark_derived_probe_group::emit_module_decls): Updated emitted
+ marker C code for 10/2/2007 markers patch. Fixes PR 5178.
+
From David Wilder <dwilder@us.ibm.com>
* tapsets.cxx (mark_query::handle_query_module): Updated to handle
64-bit platforms correctly.
diff --git a/tapsets.cxx b/tapsets.cxx
index a45a9ed9..989fbaa0 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -5059,6 +5059,7 @@ mark_query::handle_query_module()
GElf_Addr start_markers_addr = 0;
GElf_Addr stop_markers_addr = 0;
+ size_t markers_scn_ndx = 0;
int syments = dwfl_module_getsymtab(dw.module);
assert(syments);
@@ -5082,6 +5083,7 @@ mark_query::handle_query_module()
{
start_markers_addr = shdr->sh_addr;
stop_markers_addr = shdr->sh_addr + shdr->sh_size;
+ markers_scn_ndx = elf_ndxscn(scn);
break;
}
}
@@ -5107,6 +5109,7 @@ mark_query::handle_query_module()
&& strcmp(name, "__start___markers") == 0)
{
start_markers_addr = sym.st_value;
+ markers_scn_ndx = sym.st_shndx;
if (stop_markers_addr != 0)
break;
}
@@ -5154,6 +5157,8 @@ mark_query::handle_query_module()
&& sym.st_info == GELF_ST_INFO(STB_LOCAL, STT_OBJECT)
// and it has default visibility rules,
&& GELF_ST_VISIBILITY(sym.st_other) == STV_DEFAULT
+ // and it is in the right section
+ && markers_scn_ndx == sym.st_shndx
// and its value is between start_marker_value and
// stop_marker_value
&& sym.st_value >= start_markers_addr
@@ -5638,8 +5643,8 @@ mark_derived_probe_group::emit_module_decls (systemtap_session& s)
// Emit the marker callback function
s.op->newline();
- s.op->newline() << "static void enter_marker_probe (const struct __mark_marker *mdata, void *private_data, const char *fmt, ...) {";
- s.op->newline(1) << "struct stap_marker_probe *smp = (struct stap_marker_probe *)mdata->pdata;";
+ s.op->newline() << "static void enter_marker_probe (const struct marker *mdata, void *private_data, const char *fmt, ...) {";
+ s.op->newline(1) << "struct stap_marker_probe *smp = (struct stap_marker_probe *)mdata->private;";
common_probe_entryfn_prologue (s.op, "STAP_SESSION_RUNNING");
s.op->newline() << "c->probe_point = smp->pp;";