]> sourceware.org Git - systemtap.git/commitdiff
sample interrupts-by-dev: unbreak accidental .txt/.stp overwrite
authorFrank Ch. Eigler <fche@redhat.com>
Mon, 16 Feb 2015 22:54:14 +0000 (17:54 -0500)
committerFrank Ch. Eigler <fche@redhat.com>
Mon, 16 Feb 2015 22:54:14 +0000 (17:54 -0500)
testsuite/systemtap.examples/index.html
testsuite/systemtap.examples/interrupt/interrupts-by-dev.stp [changed mode: 0755->0644]
testsuite/systemtap.examples/interrupt/interrupts-by-dev.txt [new file with mode: 0755]
testsuite/systemtap.examples/keyword-index.html

index e80cc6cfc29c2231242874788891e537a03c361d..d24f12885a0430b406823e4dd16e8b8613e46559 100644 (file)
@@ -115,7 +115,7 @@ keywords: <a href="keyword-index.html#WATCHDOG">WATCHDOG</a> <a href="keyword-in
 -c &quot;sleep 1&quot;</pre></font></p>
 </li><li><a name="interrupt/interrupts-by-dev.stp"></a><a href="#interrupt/interrupts-by-dev.stp">&para;</a> <a href="interrupt/interrupts-by-dev.stp">interrupt/interrupts-by-dev.stp</a> - Record Interrupts on a Per-Device Basis<br>
 keywords: <a href="keyword-index.html#INTERRUPT">INTERRUPT</a> <br>
-<p>The interrupts-by-dev.stp script profiles interrupts received by each device per 100 ms.</p><p><font size="-2"><pre># stap interrupts-by-dev.stp -c &quot;sleep 1&quot;</pre></font></p>
+<p>The interrupts-by-dev.stp script profiles interrupts received by each device per 100 ms.</p><p><i><a href="interrupt/interrupts-by-dev.txt">sample usage in interrupt/interrupts-by-dev.txt</i></font></p>
 </li><li><a name="interrupt/scf.stp"></a><a href="#interrupt/scf.stp">&para;</a> <a href="interrupt/scf.stp">interrupt/scf.stp</a> - Tally Backtraces for Inter-Processor Interrupt<br>
 keywords: <a href="keyword-index.html#INTERRUPT">INTERRUPT</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
 <p>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.</p><p><font size="-2"><pre># stap scf.stp -c &quot;sleep 1&quot;</pre></font></p>
old mode 100755 (executable)
new mode 100644 (file)
index 8d607b7..561295c
@@ -1,17 +1,34 @@
-This script reports every 100ms, so we limit it to 10 reports.
+#! /usr/bin/env stap
+/*
+ *      Copyright (C) 2009 IBM Corp.
+ *      This file is part of systemtap, and is free software.  You can
+ *      redistribute it and/or modify it under the terms of the GNU General
+ *      Public License (GPL); either version 2, or (at your option) any
+ *      later version.
+ *
+ *      Version 1.0     prerna@linux.vnet.ibm.com     2009-10-28
+ *
+ *     Name:
+ *     interrupts-by-dev.stp
+ *
+ *     Description:
+ *     Script to profile interrupts received by each device per 100 ms.
+ *
+ *
+ */
 
-# stap interrupts-by-dev.stp -c 'sleep 1'
+global devices
 
-         DEVICE         NUMBER OF INTERRUPTS 
-                 p2p1 :      4
-                 p2p1 :      5
-                 p2p1 :     12
-                 p2p1 :      8
-                 p2p1 :      5
-                 p2p1 :      6
-                 p2p1 :      4
-             xhci_hcd :     20
-                 p2p1 :      5
-                 p2p1 :      6
-                 p2p1 :      4
-               nvidia :      1
+probe begin {
+        printf("\t  DEVICE \t NUMBER OF INTERRUPTS \n");
+}
+
+probe irq_handler.entry {
+        devices[dev_name]++;
+}
+
+probe timer.ms(100) {
+        foreach ( devname in devices )
+                printf(" %20s :  %5d\n",kernel_string(devname),devices[devname]);
+        delete devices
+}
diff --git a/testsuite/systemtap.examples/interrupt/interrupts-by-dev.txt b/testsuite/systemtap.examples/interrupt/interrupts-by-dev.txt
new file mode 100755 (executable)
index 0000000..8d607b7
--- /dev/null
@@ -0,0 +1,17 @@
+This script reports every 100ms, so we limit it to 10 reports.
+
+# stap interrupts-by-dev.stp -c 'sleep 1'
+
+         DEVICE         NUMBER OF INTERRUPTS 
+                 p2p1 :      4
+                 p2p1 :      5
+                 p2p1 :     12
+                 p2p1 :      8
+                 p2p1 :      5
+                 p2p1 :      6
+                 p2p1 :      4
+             xhci_hcd :     20
+                 p2p1 :      5
+                 p2p1 :      6
+                 p2p1 :      4
+               nvidia :      1
index d8b7d928fa319e7bac6286b3a514311f5053f4ab..1602e34aa060b95d89285e2c625eee645f2e31f6 100644 (file)
@@ -259,7 +259,7 @@ keywords: <a href="keyword-index.html#THREAD">THREAD</a> <a href="keyword-index.
 <ul>
 <li><a href="interrupt/interrupts-by-dev.stp">interrupt/interrupts-by-dev.stp</a> - Record Interrupts on a Per-Device Basis<br>
 keywords: <a href="keyword-index.html#INTERRUPT">INTERRUPT</a> <br>
-<p>The interrupts-by-dev.stp script profiles interrupts received by each device per 100 ms.</p><p><font size="-2"><pre># stap interrupts-by-dev.stp -c &quot;sleep 1&quot;</pre></font></p>
+<p>The interrupts-by-dev.stp script profiles interrupts received by each device per 100 ms.</p><p><i><a href="interrupt/interrupts-by-dev.txt">sample usage in interrupt/interrupts-by-dev.txt</i></font></p>
 </li><li><a href="interrupt/scf.stp">interrupt/scf.stp</a> - Tally Backtraces for Inter-Processor Interrupt<br>
 keywords: <a href="keyword-index.html#INTERRUPT">INTERRUPT</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
 <p>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.</p><p><font size="-2"><pre># stap scf.stp -c &quot;sleep 1&quot;</pre></font></p>
This page took 0.038105 seconds and 5 git commands to generate.