This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] examples: Print header once in interrupts-by-dev.stp


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]