summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/interrupt
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2009-02-20 14:56:38 +0100
committerMark Wielaard <mjw@redhat.com>2009-02-20 14:56:38 +0100
commit02615365a92ca2570c1f96abc8a97674aa2ccae1 (patch)
treeebedfd91a0f6d299b39e84295e091e12c0767dc8 /testsuite/systemtap.examples/interrupt
parentc3bad3042df505a3470f1e20b09822a9df1d4761 (diff)
parentadc67597f327cd43d58b1d0cb740dab14a75a058 (diff)
downloadsystemtap-steved-02615365a92ca2570c1f96abc8a97674aa2ccae1.tar.gz
systemtap-steved-02615365a92ca2570c1f96abc8a97674aa2ccae1.tar.xz
systemtap-steved-02615365a92ca2570c1f96abc8a97674aa2ccae1.zip
Merge branch 'master' into pr6866
Conflicts: ChangeLog: Removed runtime/ChangeLog: Removed runtime/sym.c: Merged runtime/task_finder.c: Merged tapset/ChangeLog: Removed testsuite/ChangeLog: Removed
Diffstat (limited to 'testsuite/systemtap.examples/interrupt')
-rw-r--r--testsuite/systemtap.examples/interrupt/scf.meta13
-rw-r--r--testsuite/systemtap.examples/interrupt/scf.stp21
2 files changed, 34 insertions, 0 deletions
diff --git a/testsuite/systemtap.examples/interrupt/scf.meta b/testsuite/systemtap.examples/interrupt/scf.meta
new file mode 100644
index 00000000..1d6ec3d8
--- /dev/null
+++ b/testsuite/systemtap.examples/interrupt/scf.meta
@@ -0,0 +1,13 @@
+title: Tally Backtraces for Inter-Processor Interrupt (IPI)
+name: scf.stp
+version: 1.0
+author: William Cohen
+keywords: interrupt backtrace
+subsystem: kernel
+status: production
+exit: user-controlled
+output: sorted-list
+scope: system-wide
+description: The Linux kernel function smp_call_function causes expensive inter-processor interrupts (IPIs). The scf.stp script tallies the processes and backtraces causing the interprocessor interrupts to identify the cause of the expensive IPI. On exit the script prints the tallies in descending frequency.
+test_check: stap -p4 scf.stp
+test_installcheck: stap scf.stp -c "sleep 1"
diff --git a/testsuite/systemtap.examples/interrupt/scf.stp b/testsuite/systemtap.examples/interrupt/scf.stp
new file mode 100644
index 00000000..f84c2494
--- /dev/null
+++ b/testsuite/systemtap.examples/interrupt/scf.stp
@@ -0,0 +1,21 @@
+#! /usr/bin/env stap
+# scf.stp
+# A reimplementation of user script:smp_call_function example given at OLS 2005
+# in the current language.
+
+global traces
+
+probe begin { print("Starting probe, type control-c to stop.\n") }
+
+probe kernel.function("smp_call_function")
+{
+ traces[pid(), pexecname(), backtrace()] ++
+}
+
+probe end {
+ foreach ([pid, name, stack] in traces-) { # sort by frequency encountered
+ printf ("traces[%d,%s,\n", pid, name)
+ print_stack (stack)
+ printf ("] = %d\n", traces[pid, name, stack]);
+ }
+}