Bug 10573 - Identical inline instances may be probed from multiple CUs
Summary: Identical inline instances may be probed from multiple CUs
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: tapsets (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Josh Stone
URL:
Keywords:
Depends on:
Blocks: 10461
  Show dependency treegraph
 
Reported: 2009-08-29 00:34 UTC by Josh Stone
Modified: 2009-09-03 21:35 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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