This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH] examples: Print header once in interrupts-by-dev.stp
- From: Aaron Tomlin <atomlin at redhat dot com>
- To: systemtap at sourceware dot org
- Cc: atomlin at redhat dot com
- Date: Wed, 13 Nov 2013 20:26:59 +0000
- Subject: [PATCH] examples: Print header once in interrupts-by-dev.stp
- Authentication-results: sourceware.org; auth=none
Trivial change. Avoid printing the header multiple times.
For instance:
DEVICE NUMBER OF INTERRUPTS
virtio0-input : 2
virtio0-input : 1
virtio0-input : 1
virtio0-input : 2
virtio3-requests : 4
Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
---
testsuite/systemtap.examples/interrupt/interrupts-by-dev.stp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/testsuite/systemtap.examples/interrupt/interrupts-by-dev.stp b/testsuite/systemtap.examples/interrupt/interrupts-by-dev.stp
index 3bcfd5e..561295c 100755
--- a/testsuite/systemtap.examples/interrupt/interrupts-by-dev.stp
+++ b/testsuite/systemtap.examples/interrupt/interrupts-by-dev.stp
@@ -19,12 +19,15 @@
global devices
+probe begin {
+ printf("\t DEVICE \t NUMBER OF INTERRUPTS \n");
+}
+
probe irq_handler.entry {
devices[dev_name]++;
}
probe timer.ms(100) {
- printf("\t DEVICE \t NUMBER OF INTERRUPTS \n");
foreach ( devname in devices )
printf(" %20s : %5d\n",kernel_string(devname),devices[devname]);
delete devices
--
1.8.1.4