drsnoop(8)
πΈ NAME πΈ
okay bestie, meet drsnoop β Trace direct reclaim events. Uses Linux eBPF/bcc. This is the drsnoop(8) page from the System Manager's Manual, and itβs here to help you understand the direct-reclaim tea π.
β¨ SYNOPSIS β¨
drsnoop [-h] [-T] [-U] [-p PID] [-t TID] [-u UID] [-d DURATION] [-n name] [-v]
π¦ DESCRIPTION π¦
okay so drsnoop traces direct reclaim events, showing which processes are allocing pages with direct reclaiming. This can be useful for discovering when allocstall (/proc/vmstat) continues to increase, whether it is caused by some critical processes or not. Thatβs the whole βwho is causing the memory-pressure momentβ vibe check π.
It works by tracing the direct reclaim events using kernel tracepoints. Lowkey elegant, highkey useful β¨.
This makes use of a Linux 4.4 feature (bpf_perf_event_output()); for kernels older than 4.4, see the version under tools/old, which uses an older mechanism.
Since this uses BPF, only the root user can use this tool. No cap, bestie β root only π.
π REQUIREMENTS π
CONFIG_BPF and bcc. Thatβs the requirement stack, periodt π«Ά.
π OPTIONS π
-hβ print usage message.-Tβ include a timestamp column.-Uβ show UID.-p PIDβ trace this process ID only (filtered in-kernel).-t TIDβ trace this thread ID only (filtered in-kernel).-u UIDβ trace this UID only (filtered in-kernel).-d DURATIONβ total duration of trace in seconds.-n nameβ only print processes where its name partially matches name. (The original page glues a-v verbosebit onto this line; keep reading, bestie π.)-vβ verbose. Run in verbose mode. Will output system memory state.-vβ show system memory state. Yes, the page lists-vtwice; both lines are part of the original, so weβre keeping both π .
π₯ EXAMPLES π₯
Trace all direct reclaim events:
# drsnoop
Trace all direct reclaim events, for 10 seconds only:
# drsnoop -d 10
Trace all direct reclaim events, and include timestamps:
# drsnoop -T
Show UID:
# drsnoop -U
Trace PID 181 only:
# drsnoop -p 181
Trace UID 1000 only:
# drsnoop -u 1000
Trace all direct reclaim events from processes where its name partially matches 'mond':
# drnsnoop -n mond
Yep, that command says drnsnoop β weβre copying it exactly as the page has it π.
π FIELDS π
TIME(s)β time of the call, in seconds.UIDβ User ID.PIDβ Process ID.TIDβ Thread ID.COMMβ Process name.
π OVERHEAD π
This traces the kernel direct reclaim tracepoints and prints output for each event. As the rate of this is generally expected to be low (< 1000/s), the overhead is also expected to be negligible. So like, chill β itβs not trying to eat your CPU for breakfast π.
π§ SOURCE π§
This is from bcc.
https://github.com/iovisor/bcc
Also look in the bcc distribution for a companion _examples.txt file containing example usage, output, and commentary for this tool. Itβs giving documentation bestie π§.
π OS π
Linux.
β STABILITY β
Unstable - in development. Thatβs the status, bestie β in development, so treat it accordingly β.
π AUTHOR π
Wenbo Zhang. Iconic π.
xoxo π«Ά β thatβs the drsnoop(8) page, signed off under USER COMMANDS on 2019-02-20 π
β¨
π¦ where this page comes from
- alpine 3.24: bcc-doc 0.36.1-r1 Β· Apache-2.0
- nixpkgs unstable: bcc 0.37.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms