[PATCH v4 1/3] systemtap/tapsets.cxx: Fix dwarfless probes on multiple static functions
Mark Wielaard
mjw@redhat.com
Wed Apr 22 13:40:00 GMT 2015
Hi Hemant,
On Mon, 2015-04-20 at 15:59 +0530, Hemant Kumar wrote:
> With multiple static functions with same names in an ELF and in absence
> of dwarf, if we probe on one of the functions, then systemtap places
> probe only on one static function ignoring the rest. This is because the
> mapping between the symbol names and their func_info is a simple map
> which doesn't allow insertion of another symbol with the same name.
>
> This patch fixes this issue by changing this map to a multimap which
> allows duplicate entries for the same symbol name. lookup_symbol code
> will return a set of func_info * instead of a single descriptor for a
> function name.
>
> We also need to fix other areas in the code where lookup_symbol() and
> lookup_symbol_address() are being called so as to look for a set of
> func_info's and a list of Dwarf_Addr's respectively, instead of a single
> descriptor.
Looks good. I pushed this with one tiny change:
@@ -8242,6 +8242,8 @@ symbol_table::purge_syscall_stubs()
if (!addrs || addrs->empty())
return;
/* Highly unlikely that multiple symbols named "sys_ni_syscall" may exist */
+ if (addrs->size() > 1)
+ cerr << _("Multiple 'sys_ni_syscall' symbols found.");
Dwarf_Addr stub_addr = addrs->front();
Just so that if this highly unlikely scenario does occur we get a
warning something is fishy.
Thanks,
Mark
More information about the Systemtap
mailing list