Demonstrations of alisyslatency, the Linux eBPF/bcc version.


This program traces time spent in kernel context (between
context_tracking:user_exit and context_tracking:user_enter),
and stores timing statistics in-kernel for efficiency.


**Note**  This tool needs Context tracking subsystem, which can not
work without support of full dynticks.


Example 1

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

# alisyslatency
Tracing time in kernel context... Hit Ctrl-C to end.
^C
       CPU      Count TOTAL_usecs  MAX_usecs


Example 2

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

# alisyslatency -c 6
Tracing time in kernel context... Hit Ctrl-C to end.
^C
       PID      Count TOTAL_usecs  MAX_usecs



Exampel 3

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


# alisyslatency -p 3550
Tracing time in kernel context... Hit Ctrl-C to end.
^C
       CPU      Count TOTAL_usecs  MAX_usecs



USAGE message:

# alisyslatency -h
usage: alisyslatency.py [-h] [-T] [-N] [-c CPU | -p PID] [interval] [outputs]

Summarize time spent in kernel context.

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
  -c CPU, --cpu CPU  output statistics on specific CPU only
  -p PID, --pid PID  output statistics of specific pid only

examples:
    ./alisyslatency            # sum time in kernel context per CPU
    ./alisyslatency -c 0       # show time in kernel context in CPU 0 only
    ./alisyslatency -p 25      # show time in kernel context in pid 25 only
    ./alisyslatency 1 10       # print 1 second summaries, 10 times
    ./alisyslatency -NT 1      # 1s summaries, nanoseconds, and timestamps
