Demonstrations of alihardirqs, the enhanced version of BCC hardirqs.

This program traces hard interrupts (irqs), and stores timing statistics
in-kernel for efficiency.


Example 1

By default, all statistics of all hardirq on all CPUs are sampled,
and the output is displayed in a per-hardirq and per-CPU flavor.

# alihardirqs
Tracing hard irq event time... Hit Ctrl-C to end.
^C

CPU3:
   HARDIRQ           IRQHandler      Count TOTAL_usecs  MAX_usecs
        31      virtio0-input.0          2          4          2


Example 2

You can sample statistics on specified CPU only with "-c" option,
and the output will be displayed in a per-hardirq flavor.

# alihardirqs -c 3
Tracing hard irq event time... Hit Ctrl-C to end.
^C

CPU3:
   HARDIRQ           IRQHandler      Count TOTAL_usecs  MAX_usecs
        31      virtio0-input.0          3         10          7


Exampel 3

You can sample statistics of specified hardirq only with "-i" option,
and the output will be displayed in a per-CPU flavor.

# alihardirqs -i 31
Tracing hard irq event time... Hit Ctrl-C to end.
^C

CPU3:
   HARDIRQ           IRQHandler      Count TOTAL_usecs  MAX_usecs
        31      virtio0-input.0          3          8          6


Example 4

The distribution of hardirq run time can be printed as a histogram with "-D"
option. The output will be displayed in a per-hardirq and per-CPU flavor.

# alihardirqs -D
Tracing hard irq event time... Hit Ctrl-C to end.
^C

section = CPU 3, hardIRQ 31 (virtio0-input.0)
     time_usecs          : count     distribution
         0 -> 1          : 1        |****************************************|
         2 -> 3          : 0        |                                        |
         4 -> 7          : 1        |****************************************|



USAGE message:

# alihardirqs -h
usage: alihardirqs.py [-h] [-T] [-N] [-D] [-c CPU] [-i IRQ]
                       [interval] [outputs]

Summarize hard irq statistics, including total count, time, etc.

positional arguments:
  interval           output interval, in seconds
  outputs            number of outputs

optional arguments:
  -h, --help         show this help message and exit
  -T, --timestamp    include timestamp on output
  -N, --nanoseconds  output in nanoseconds
  -D, --dist         show distributions as histograms
  -c CPU, --cpu CPU  output hardIRQ statistics on specific CPU only
  -i IRQ, --irq IRQ  output statistics of specific hardIRQ

examples:
    ./alihardirqs            # sum hard irq event time
    ./alihardirqs -D         # show hard irq event time as histograms
    ./alihardirqs -c 0       # show hard irq event time of CPU 0 only
    ./alihardirqs -i 25      # show event time of IRQ 25 only
    ./alihardirqs -c 0 -i 25 # show event time of IRQ 25 on CPU 0 only
    ./alihardirqs 1 10       # print 1 second summaries, 10 times
    ./alihardirqs -NT 1      # 1s summaries, nanoseconds, and timestamps
