Bug 10573

Summary: Identical inline instances may be probed from multiple CUs
Product: systemtap Reporter: Josh Stone <jistone>
Component: tapsetsAssignee: Josh Stone <jistone>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 10461    

Description Josh Stone 2009-08-29 00:34:17 UTC
In C++, identical functions included in multiple CUs will get merged at link
time into a single instance.  Thus the debuginfo will reference that location
multiple times, but we only want to probe it once.  Commit 857bdfd already deals
with this for normal function instances, but the same problem exists for inline
instances within those functions.

$ stap -l 'process("/usr/bin/stap").function("_M_rep").inline' -vv 2>&1 \
  | grep -o pc=.* | sort | uniq -c | sort | tail -n5
      7 pc=0xc0216
      8 pc=0x21e19
      8 pc=0x21e1c
      9 pc=0x4b726
      9 pc=0x4b7c6

The same entrypc-dupe check isn't quite enough though, because it's quite
possible for multiple distinct inlines to share the same entrypc.  For example,
if inline foo first calls inline bar, then they could flatten out to have the
same starting point.  I think it will need to be a tuple of (pc, name, file,
line) that is checked for dupes.
Comment 1 Josh Stone 2009-09-03 21:35:05 UTC
commit 7fdd3e2c