summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/process/pf2.stp
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/systemtap.examples/process/pf2.stp')
-rwxr-xr-xtestsuite/systemtap.examples/process/pf2.stp16
1 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/systemtap.examples/process/pf2.stp b/testsuite/systemtap.examples/process/pf2.stp
new file mode 100755
index 00000000..a804c3ff
--- /dev/null
+++ b/testsuite/systemtap.examples/process/pf2.stp
@@ -0,0 +1,16 @@
+#! /usr/bin/env stap
+
+global profile, pcount
+probe timer.profile {
+ pcount <<< 1
+ fn = probefunc ()
+ if (fn != "") profile[fn] <<< 1
+}
+probe timer.ms(5000) {
+ printf ("\n--- %d samples recorded:\n", @count(pcount))
+ foreach (f in profile- limit 10) {
+ printf ("%-30s\t%6d\n", f, @count(profile[f]))
+ }
+ delete profile
+ delete pcount
+}