xref: /aosp_15_r20/external/bcc/tools/runqslower_example.txt (revision 387f9dfdfa2baef462e92476d413c7bc2470293e)
1Demonstrations of runqslower, the Linux eBPF/bcc version.
2
3
4runqslower shows high latency scheduling times between tasks being
5ready to run and them running on CPU after that. For example:
6
7# runqslower
8
9Note: Showing TID (thread id) in the report column. The smallest
10execution unit becomes a TID when using the --pid flag as
11in that case the tool reports not only the parent pid but
12its children threads as well.
13
14Tracing run queue latency higher than 10000 us.
15
16TIME     COMM             TID           LAT(us)
1704:16:32 cc1              12924           12739
1804:16:32 sh               13640           12118
1904:16:32 make             13639           12730
2004:16:32 bash             13655           12047
2104:16:32 bash             13657           12744
2204:16:32 bash             13656           12880
2304:16:32 sh               13660           10846
2404:16:32 gcc              13663           12681
2504:16:32 make             13668           10814
2604:16:32 make             13670           12988
2704:16:32 gcc              13677           11770
2804:16:32 gcc              13678           23519
2904:16:32 as               12999           20541
30[...]
31
32This shows various processes waiting for available CPU during a Linux kernel
33build. By default the output contains delays for more than 10ms.
34
35These delays can be analyzed in depth with "perf sched" tool, see:
36
37* http://www.brendangregg.com/blog/2017-03-16/perf-sched.html
38
39USAGE message:
40
41# ./runqslower -h
42usage: runqslower.py [-h] [-p PID | -t TID] [min_us]
43
44Trace high run queue latency
45
46positional arguments:
47  min_us             minimum run queue latency to trace, in us (default 10000)
48
49optional arguments:
50  -h, --help         show this help message and exit
51  -p PID, --pid PID  trace this PID only
52  -t TID, --tid TID  trace this TID only
53  -P, --previous     also show previous task name and TID
54
55examples:
56    ./runqslower         # trace run queue latency higher than 10000 us (default)
57    ./runqslower 1000    # trace run queue latency higher than 1000 us
58    ./runqslower -p 123  # trace pid 123
59    ./runqslower -t 123  # trace tid 123 (use for threads only)
60    ./runqslower -P      # also show previous task comm and TID
61