xref: /aosp_15_r20/external/bcc/libbpf-tools/runqslower_example.txt (revision 387f9dfdfa2baef462e92476d413c7bc2470293e)
1*387f9dfdSAndroid Build Coastguard WorkerDemonstrations of runqslower, the Linux BPF CO-RE version.
2*387f9dfdSAndroid Build Coastguard Worker
3*387f9dfdSAndroid Build Coastguard Worker
4*387f9dfdSAndroid Build Coastguard Workerrunqslower shows high latency scheduling times between tasks being
5*387f9dfdSAndroid Build Coastguard Workerready to run and them running on CPU after that. For example:
6*387f9dfdSAndroid Build Coastguard Worker
7*387f9dfdSAndroid Build Coastguard Worker# runqslower
8*387f9dfdSAndroid Build Coastguard Worker
9*387f9dfdSAndroid Build Coastguard WorkerTracing run queue latency higher than 10000 us.
10*387f9dfdSAndroid Build Coastguard Worker
11*387f9dfdSAndroid Build Coastguard WorkerTIME     COMM             TID           LAT(us)
12*387f9dfdSAndroid Build Coastguard Worker04:16:32 cc1              12924           12739
13*387f9dfdSAndroid Build Coastguard Worker04:16:32 sh               13640           12118
14*387f9dfdSAndroid Build Coastguard Worker04:16:32 make             13639           12730
15*387f9dfdSAndroid Build Coastguard Worker04:16:32 bash             13655           12047
16*387f9dfdSAndroid Build Coastguard Worker04:16:32 bash             13657           12744
17*387f9dfdSAndroid Build Coastguard Worker04:16:32 bash             13656           12880
18*387f9dfdSAndroid Build Coastguard Worker04:16:32 sh               13660           10846
19*387f9dfdSAndroid Build Coastguard Worker04:16:32 gcc              13663           12681
20*387f9dfdSAndroid Build Coastguard Worker04:16:32 make             13668           10814
21*387f9dfdSAndroid Build Coastguard Worker04:16:32 make             13670           12988
22*387f9dfdSAndroid Build Coastguard Worker04:16:32 gcc              13677           11770
23*387f9dfdSAndroid Build Coastguard Worker04:16:32 gcc              13678           23519
24*387f9dfdSAndroid Build Coastguard Worker04:16:32 as               12999           20541
25*387f9dfdSAndroid Build Coastguard Worker[...]
26*387f9dfdSAndroid Build Coastguard Worker
27*387f9dfdSAndroid Build Coastguard WorkerThis shows various processes waiting for available CPU during a Linux kernel
28*387f9dfdSAndroid Build Coastguard Workerbuild. By default the output contains delays for more than 10ms.
29*387f9dfdSAndroid Build Coastguard Worker
30*387f9dfdSAndroid Build Coastguard WorkerThese delays can be analyzed in depth with "perf sched" tool, see:
31*387f9dfdSAndroid Build Coastguard Worker
32*387f9dfdSAndroid Build Coastguard Worker* http://www.brendangregg.com/blog/2017-03-16/perf-sched.html
33*387f9dfdSAndroid Build Coastguard Worker
34*387f9dfdSAndroid Build Coastguard WorkerUSAGE message:
35*387f9dfdSAndroid Build Coastguard Worker
36*387f9dfdSAndroid Build Coastguard Worker# runqslower --help
37*387f9dfdSAndroid Build Coastguard WorkerTrace high run queue latency.
38*387f9dfdSAndroid Build Coastguard Worker
39*387f9dfdSAndroid Build Coastguard WorkerUSAGE: runqslower [--help] [-p PID] [-t TID] [min_us]
40*387f9dfdSAndroid Build Coastguard Worker
41*387f9dfdSAndroid Build Coastguard WorkerEXAMPLES:
42*387f9dfdSAndroid Build Coastguard Worker    runqslower         # trace latency higher than 10000 us (default)
43*387f9dfdSAndroid Build Coastguard Worker    runqslower 1000    # trace latency higher than 1000 us
44*387f9dfdSAndroid Build Coastguard Worker    runqslower -p 123  # trace pid 123
45*387f9dfdSAndroid Build Coastguard Worker    runqslower -t 123  # trace tid 123 (use for threads only)
46*387f9dfdSAndroid Build Coastguard Worker
47*387f9dfdSAndroid Build Coastguard Worker  -p, --pid=PID              Process PID to trace
48*387f9dfdSAndroid Build Coastguard Worker  -t, --tid=TID              Thread TID to trace
49*387f9dfdSAndroid Build Coastguard Worker  -v, --verbose              Verbose debug output
50*387f9dfdSAndroid Build Coastguard Worker  -?, --help                 Give this help list
51*387f9dfdSAndroid Build Coastguard Worker      --usage                Give a short usage message
52*387f9dfdSAndroid Build Coastguard Worker  -V, --version              Print program version
53*387f9dfdSAndroid Build Coastguard Worker
54*387f9dfdSAndroid Build Coastguard WorkerReport bugs to <[email protected]>.
55