diff options
author | David Smith <dsmith@redhat.com> | 2009-06-19 10:58:03 -0500 |
---|---|---|
committer | David Smith <dsmith@redhat.com> | 2009-06-19 10:58:03 -0500 |
commit | 76d9a838820b78ab93f9faeb1dcf20f2ec509fc3 (patch) | |
tree | 93bdad0ee02177e9af895772d3ad6ebccc156138 /tapset/target_set.stp | |
parent | ac4f1eca71edee2feb2cbdad1a044549f30da023 (diff) | |
parent | 0c98234c86877cfea3df762dc8627b3f05c38e75 (diff) | |
download | systemtap-steved-76d9a838820b78ab93f9faeb1dcf20f2ec509fc3.tar.gz systemtap-steved-76d9a838820b78ab93f9faeb1dcf20f2ec509fc3.tar.xz systemtap-steved-76d9a838820b78ab93f9faeb1dcf20f2ec509fc3.zip |
Merge commit 'origin/master' into pr7043
Diffstat (limited to 'tapset/target_set.stp')
-rw-r--r-- | tapset/target_set.stp | 28 |
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) } |