This is the mail archive of the mailing list for the systemtap project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v4 1/3] systemtap/tapsets.cxx: Fix dwarfless probes on multiple static functions

On 04/22/2015 07:10 PM, Mark Wielaard wrote:
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
Looks good. I pushed this with one tiny change:

Thanks again.

@@ -8242,6 +8242,8 @@ symbol_table::purge_syscall_stubs()
    if (!addrs || addrs->empty())
    /* 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.

Right! looks good.

Hemant Kumar

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]