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.
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);
{
start_markers_addr = shdr->sh_addr;
stop_markers_addr = shdr->sh_addr + shdr->sh_size;
+ markers_scn_ndx = elf_ndxscn(scn);
break;
}
}
&& strcmp(name, "__start___markers") == 0)
{
start_markers_addr = sym.st_value;
+ markers_scn_ndx = sym.st_shndx;
if (stop_markers_addr != 0)
break;
}
&& 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
// 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;";