summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/process/forktracker.stp
diff options
context:
space:
mode:
authorStan Cox <scox@redhat.com>2009-06-19 14:06:52 -0400
committerStan Cox <scox@redhat.com>2009-06-19 14:06:52 -0400
commitd138d3d71a1685c53cc5c2b72ed8ae64d3e012d2 (patch)
tree966ff2622c07fb84513b487482a1a1f46bae5dfc /testsuite/systemtap.examples/process/forktracker.stp
parent45148f5b5e371ff852dbbb08d83c5e87932b372e (diff)
parenteba61c56888482553551a16ec651444a583522e0 (diff)
downloadsystemtap-steved-d138d3d71a1685c53cc5c2b72ed8ae64d3e012d2.tar.gz
systemtap-steved-d138d3d71a1685c53cc5c2b72ed8ae64d3e012d2.tar.xz
systemtap-steved-d138d3d71a1685c53cc5c2b72ed8ae64d3e012d2.zip
Merge branch 'master' of ssh://sourceware.org/git/systemtap
Diffstat (limited to 'testsuite/systemtap.examples/process/forktracker.stp')
-rwxr-xr-xtestsuite/systemtap.examples/process/forktracker.stp23
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 100755
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)
+}