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 /testsuite/systemtap.examples/process/forktracker.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 'testsuite/systemtap.examples/process/forktracker.stp')
-rw-r--r-- | testsuite/systemtap.examples/process/forktracker.stp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/systemtap.examples/process/forktracker.stp b/testsuite/systemtap.examples/process/forktracker.stp new file mode 100644 index 00000000..525aa0a5 --- /dev/null +++ b/testsuite/systemtap.examples/process/forktracker.stp @@ -0,0 +1,23 @@ +#! /usr/bin/env stap +# +# This is a stap script to monitor process creations (fork(), exec()'s). +# Based off of stap script found: http://picobot.org/wordpress/?p=27 +# With some minor modifications (i.e. timestamping) +# +# Usage: stap forktracker.stp +# +# Sample output: +# +# timestamp: process_name (pid) new_pid +# +# Version 0.1 + +probe kprocess.create { + printf("%-25s: %s (%d) created %d\n", + ctime(gettimeofday_s()), execname(), pid(), new_pid) +} + +probe kprocess.exec { + printf("%-25s: %s (%d) is exec'ing %s\n", + ctime(gettimeofday_s()), execname(), pid(), filename) +} |