summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/profiling/topsys.stp
diff options
context:
space:
mode:
authorWilliam Cohen <wcohen@redhat.com>2009-02-02 14:21:25 -0500
committerWilliam Cohen <wcohen@redhat.com>2009-02-02 14:21:25 -0500
commit1bf72dfea404434f954214298367817d5c591903 (patch)
treed2775acea2d9fc2f01fcf731d3d432eb942b3e0d /testsuite/systemtap.examples/profiling/topsys.stp
parent492d227f2caa558c4fdcd4e7aae65cf32b4549cc (diff)
downloadsystemtap-steved-1bf72dfea404434f954214298367817d5c591903.tar.gz
systemtap-steved-1bf72dfea404434f954214298367817d5c591903.tar.xz
systemtap-steved-1bf72dfea404434f954214298367817d5c591903.zip
Revised topsys.stp and moved to the testsuite/systemtap.examples directory.
Diffstat (limited to 'testsuite/systemtap.examples/profiling/topsys.stp')
-rw-r--r--testsuite/systemtap.examples/profiling/topsys.stp24
1 files changed, 24 insertions, 0 deletions
diff --git a/testsuite/systemtap.examples/profiling/topsys.stp b/testsuite/systemtap.examples/profiling/topsys.stp
new file mode 100644
index 00000000..34cf826c
--- /dev/null
+++ b/testsuite/systemtap.examples/profiling/topsys.stp
@@ -0,0 +1,24 @@
+#! /usr/bin/env stap
+#
+# This script continuously lists the top 20 systemcalls in the interval
+# 5 seconds
+#
+
+global syscalls_count
+
+probe syscall.* {
+ syscalls_count[name]++
+}
+
+function print_systop () {
+ printf ("%25s %10s\n", "SYSCALL", "COUNT")
+ foreach (syscall in syscalls_count- limit 20) {
+ printf("%25s %10d\n", syscall, syscalls_count[syscall])
+ }
+ delete syscalls_count
+}
+
+probe timer.s(5) {
+ print_systop ()
+ printf("--------------------------------------------------------------\n")
+}