summaryrefslogtreecommitdiffstats
path: root/tapset/target_set.stp
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-06-22 11:37:08 -0400
committerDave Brolley <brolley@redhat.com>2009-06-22 11:37:08 -0400
commitd6454850dd3c9d74b700924b56378c4c9ab9fa57 (patch)
tree6665a24339ca689b1156ea7e93d4f93811c3f794 /tapset/target_set.stp
parentd729143af5242b17645d3f405141918940680894 (diff)
parent4116c576d5654287b0af598aee4a14eb2af73224 (diff)
downloadsystemtap-steved-d6454850dd3c9d74b700924b56378c4c9ab9fa57.tar.gz
systemtap-steved-d6454850dd3c9d74b700924b56378c4c9ab9fa57.tar.xz
systemtap-steved-d6454850dd3c9d74b700924b56378c4c9ab9fa57.zip
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Diffstat (limited to 'tapset/target_set.stp')
-rw-r--r--tapset/target_set.stp28
1 files changed, 18 insertions, 10 deletions
diff --git a/tapset/target_set.stp b/tapset/target_set.stp
index c7878c52..9a4beced 100644
--- a/tapset/target_set.stp
+++ b/tapset/target_set.stp
@@ -3,25 +3,33 @@ global _target_set # map: target-set-pid -> ancestor-pid
function target_set_pid (pid)
{
- return ([pid] in _target_set)
+ return ([pid] in _target_set)
}
probe begin
{
- if (target()) _target_set [target()] = stp_pid()
+ if (target())
+ _target_set[target()] = stp_pid()
}
-probe syscall.fork.return
+probe nd_syscall.fork.return
{
- pid=pid()
- if (pid in _target_set) next
- ppid=ppid()
- if (ppid in _target_set) _target_set[pid]=ppid
+ pid = returnval()
+ if (pid in _target_set)
+ next
+ ppid = pid()
+ if (ppid in _target_set)
+ _target_set[pid] = ppid
+}
+
+probe nd_syscall.exit
+{
+ delete _target_set[pid()]
}
function target_set_report ()
{
- printf("target set:\n")
- foreach (pid in _target_set+)
- printf("%d begat %d\n", _target_set[pid], pid)
+ printf("target set:\n")
+ foreach (pid in _target_set+)
+ printf("%d begat %d\n", _target_set[pid], pid)
}