Bug 10831 - Preserve the derivation chain for sdt and label probes
Summary: Preserve the derivation chain for sdt and label probes
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: 10788 10830
  Show dependency treegraph
 
Reported: 2009-10-22 18:05 UTC by Josh Stone
Modified: 2010-03-16 18:20 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-10-22 18:05:39 UTC
Currently, .label(NAME) probes get translated to .statement(NUM), and sdt
similarly translates to either a statement probe, kprobe, or utrace probe point.
 They have some rewriting in place to make them appear nicely in probe listing
mode, but we could do better to preserve their full derivation chains.

See also bug #10788 and bug #10830.
Comment 1 Josh Stone 2010-03-16 18:20:04 UTC
commit c72aa91  PR10831: Remember derived "aliases" in the probe chain

For comparison, here's how the derivation chain looks already for tapset aliases
(with the debug dump block enabled):

$ ./run-stap -l 'kprocess.cr*'
kernel.function("copy_process@kernel/fork.c:973").return /* pc=_stext+0x4b546 */
/* <- kprocess.create = kernel.function("copy_process").return <- kprocess.cr* */
chain[3]:
  [0]: 
	locations[1]:
	  [0]: kernel.function("copy_process@kernel/fork.c:973").return
  [1]: 
	locations[1]:
	  [0]: kernel.function("copy_process").return
	aliases[1]:
	  [0]: kprocess.create
  [2]: 
	locations[1]:
	  [0]: kprocess.cr*
kprocess.create


Now the SDT probes look like this:

$ ./run-stap -l 'process("./stap").mark("cache__c*")' 
process("/home/jistone/systemtap/build/stap").statement(4982509) /*
pc=.absolute+0x4c06ed */ /* <- process("./stap").mark("cache__clean") =
process("./stap").statement(4982509) <- process("./stap").mark("cache__c*") */
chain[3]:
  [0]: 
	locations[1]:
	  [0]: process("/home/jistone/systemtap/build/stap").statement(4982509)
  [1]: 
	locations[1]:
	  [0]: process("./stap").statement(4982509)
	aliases[1]:
	  [0]: process("./stap").mark("cache__clean")
  [2]: 
	locations[1]:
	  [0]: process("./stap").mark("cache__c*")
process("./stap").mark("cache__clean")


And label probes look like this:

$ ./run-stap -l 'process("./stap").function("*").label("pass*")'
process("/home/jistone/systemtap/build/stap").function("main@../main.cxx:1459")
/* pc=.absolute+0x41149f */ /* <-
process("/home/jistone/systemtap/build/stap").function("main@../main.cxx:1459").label("pass_5")
=
process("/home/jistone/systemtap/build/stap").function("main@../main.cxx:1459")
<- process("./stap").function("*").label("pass*") */
chain[3]:
  [0]: 
	locations[1]:
	  [0]:
process("/home/jistone/systemtap/build/stap").function("main@../main.cxx:1459")
  [1]: 
	locations[1]:
	  [0]:
process("/home/jistone/systemtap/build/stap").function("main@../main.cxx:1459")
	aliases[1]:
	  [0]:
process("/home/jistone/systemtap/build/stap").function("main@../main.cxx:1459").label("pass_5")
  [2]: 
	locations[1]:
	  [0]: process("./stap").function("*").label("pass*")
process("/home/jistone/systemtap/build/stap").function("main@../main.cxx:1459").label("pass_5")

It might be better to represent the final label target as a .statement(ADDR)
probe point, since that's what it really becomes.  With the alias in place, it
would still be printed as a .label in listing mode.