dcsnoop(8)
π dcsnoop(8) β the dcache snoop tool π
okay bestie, this is the manual for dcsnoop, the tool that spies on your directory entry cache (dcache) lookups π΅οΈββοΈβ¨
β¨ NAME β¨
dcsnoop β trace directory entry cache (dcache) lookups. It uses Linux eBPF/bcc π¦
β¨ SYNOPSIS β¨
dcsnoop [-h] [-a]
β¨ DESCRIPTION β¨
okay so by default, this traces every failed dcache lookup (a cache miss) π. For each one it shows the process doing the lookup and the filename it asked for. want to see everything instead? use -a and it'll show all lookups, not just the failed ones π
the output can get pretty verbose, so it's really meant for deeper digging into dcache performance after you've checked in with dcstat(8), which gives you per-second summaries πΈ
this works by dynamically tracing the d_lookup() function in the kernel. it'll need updating whenever that function changes, so keep that in mind π§
also, since this uses BPF, only the root user can run this tool π not me being dramatic, it's a hard rule π
β¨ REQUIREMENTS β¨
you need CONFIG_BPF in your kernel, plus bcc π§
β¨ OPTIONS β¨
-hβ prints the usage message π-aβ traces references too, not just the failed lookups π
β¨ EXAMPLES β¨
trace failed dcache lookups:
# dcsnoop
trace all dcache lookups:
# dcsnoop -a
β¨ FIELDS β¨
here's what shows up in the output, bestie π
TIME(s)β when the lookup happened, in seconds β°PIDβ the process ID πCOMMβ the process name πTβ the type:Rmeans reference (only shows up with-a), andMmeans miss. a miss prints two lines, one for the reference and one for the miss, so don't panic when you see doubles πFILEβ the filename component that was being looked up. it can include trailing pathname components (the bits after a/), and those become the subject of the lookups that come next ποΈ
β¨ OVERHEAD β¨
β οΈ heads up, this one matters! file name lookups can happen a LOT depending on the workload, and this tool prints a line for every failed lookup. with-ait prints every reference as well π± the output can be verbose, and even though it's optimized to some extent, the overhead can go from noticeable all the way to significant π this is only really for deeper investigations beyonddcstat(8), and only when you absolutely need it. measure and quantify the overhead in a test environment before using it π«Ά
β¨ SOURCE β¨
this comes from bcc π you can find it at:
https://github.com/iovisor/bcc
also check the bcc distribution for a companion file called _examples.txt. it has example usage, output, and commentary for this tool π
β¨ OS β¨
Linux π§
β¨ STABILITY β¨
Unstable β still in development π§
β¨ AUTHOR β¨
Brendan Gregg π
β¨ SEE ALSO β¨
dcstat(1) π
and that's the tea, bestie π«π this page is from the USER COMMANDS section, dated 2016-02-10, and it's all about dcsnoop(8) πβ¨ stay iconic and keep those caches warm πΈπ
π¦ where this page comes from
- alpine 3.24: bcc-doc 0.36.1-r1 Β· Apache-2.0
- nixpkgs unstable: bcc 0.37.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms