]> sourceware.org Git - systemtap.git/commitdiff
examples: Print header once in interrupts-by-dev.stp
authorAaron Tomlin <atomlin@redhat.com>
Wed, 13 Nov 2013 20:26:59 +0000 (20:26 +0000)
committerFrank Ch. Eigler <fche@redhat.com>
Tue, 26 Nov 2013 17:25:51 +0000 (12:25 -0500)
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

index 3bcfd5e122b919a034761051e166a09c4375721e..561295c27588cc0b3f0c9f86f5a081c646379ab2 100755 (executable)
 
 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
This page took 0.028833 seconds and 5 git commands to generate.