-c "sleep 1"</pre></font></p>
</li><li><a name="interrupt/interrupts-by-dev.stp"></a><a href="#interrupt/interrupts-by-dev.stp">¶</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 "sleep 1"</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">¶</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 "sleep 1"</pre></font></p>
-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
+}
--- /dev/null
+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
<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 "sleep 1"</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 "sleep 1"</pre></font></p>