xref: /aosp_15_r20/external/bcc/libbpf-tools/drsnoop_example.txt (revision 387f9dfdfa2baef462e92476d413c7bc2470293e)
1Demonstrations of drsnoop, the Linux BPF CO-RE version.
2
3
4drsnoop traces the direct reclaim system-wide, and prints various details.
5Example output:
6
7# drsnoop
8
9Tracing direct reclaim events... Hit Ctrl-C to end.
10TIME     COMM             TID     LAT(ms) PAGES
1114:56:43 in:imklog        268     106.637    39
1214:56:43 systemd-udevd    232     110.708    53
1314:56:43 systemd-journal  19531   106.083    62
14^C
15
16While tracing, the processes alloc pages due to insufficient memory available
17in the system, direct reclaim events happened, which will increase the waiting
18delay of the processes.
19
20drsnoop can be useful for discovering when allocstall(/proc/vmstat) continues
21to increase, whether it is caused by some critical processes or not.
22
23The -p option can be used to filter on a PID, which is filtered in-kernel.
24
25# drsnoop -p 17491
26
27Tracing direct reclaim events... Hit Ctrl-C to end.
28TIME     COMM             TID     LAT(ms) PAGES
2914:59:56 summond          17491      0.24    50
3014:59:56 summond          17491      0.26    38
3114:59:56 summond          17491      0.36    72
32^C
33
34This shows the summond process allocs pages, and direct reclaim events happening,
35and the delays are not affected much.
36
37A maximum tracing duration can be set with the -d option. For example, to trace
38for 2 seconds:
39
40# drsnoop -d 2
41
42Tracing direct reclaim events for 2 secs.
43TIME     COMM             TID     LAT(ms) PAGES
4415:02:16 head             21715      0.15   195
45
46USAGE message:
47
48# drsnoop --help
49
50Usage: drsnoop [OPTION...]
51Trace direct reclaim latency.
52
53USAGE: drsnoop [--help] [-p PID] [-t TID] [-d DURATION] [-e]
54
55EXAMPLES:
56    drsnoop         # trace all direct reclaim events
57    drsnoop -p 123  # trace pid 123
58    drsnoop -t 123  # trace tid 123 (use for threads only)
59    drsnoop -d 10   # trace for 10 seconds only
60    drsnoop -e      # trace all direct reclaim events with extended faileds
61
62  -d, --duration=DURATION    Total duration of trace in seconds
63  -e, --extended             Extended fields output
64  -p, --pid=PID              Process PID to trace
65  -t, --tid=TID              Thread TID to trace
66  -v, --verbose              Verbose debug output
67  -?, --help                 Give this help list
68      --usage                Give a short usage message
69  -V, --version              Print program version
70
71Report bugs to <[email protected]>.
72