diff options
Diffstat (limited to 'tapset')
-rw-r--r-- | tapset/ChangeLog | 5 | ||||
-rw-r--r-- | tapset/target_set.stp | 27 |
2 files changed, 32 insertions, 0 deletions
diff --git a/tapset/ChangeLog b/tapset/ChangeLog index 87c3db0b..7c96175c 100644 --- a/tapset/ChangeLog +++ b/tapset/ChangeLog @@ -1,3 +1,8 @@ +2007-08-16 Frank Ch. Eigler <fche@elastic.org> + + PR 1315. + * target_set.stp: New tapset file. + 2007-08-16 Martin Hunt <hunt@redhat.com> * aux_syscalls.stp (_sock_family_str): diff --git a/tapset/target_set.stp b/tapset/target_set.stp new file mode 100644 index 00000000..c7878c52 --- /dev/null +++ b/tapset/target_set.stp @@ -0,0 +1,27 @@ + +global _target_set # map: target-set-pid -> ancestor-pid + +function target_set_pid (pid) +{ + return ([pid] in _target_set) +} + +probe begin +{ + if (target()) _target_set [target()] = stp_pid() +} + +probe syscall.fork.return +{ + pid=pid() + if (pid in _target_set) next + ppid=ppid() + if (ppid in _target_set) _target_set[pid]=ppid +} + +function target_set_report () +{ + printf("target set:\n") + foreach (pid in _target_set+) + printf("%d begat %d\n", _target_set[pid], pid) +} |