dcstat(8)
π dcstat(8) π
dcstat - Directory entry cache (dcache) stats. Uses Linux eBPF/bcc. β¨
πΈ SYNOPSIS πΈ
dcstat [interval [count]]
π DESCRIPTION π
okay so the Linux directory entry cache (dcache) is what makes file and directory name lookups feel fast ποΈπ¨ it's giving performance, no cap. this tool spits out per-second summary stats of how the dcache is doing πβ¨
this uses kernel dynamic tracing on the kernel functions lookup_fast() and d_lookup() π and fair warning, those will probably need updating whenever the kernel changes π so keep that in mind bestie
β οΈ since this uses BPF, only the root user can run this tool. sorry, not sorry π
π§ REQUIREMENTS π§
CONFIG_BPF and bcc. π§
π EXAMPLES π
Print summaries each second:
# dcstat
Print output every five seconds, three times:
# dcstat 5 3
π FIELDS π
REFS/sβ number of dcache lookups (references) per second. the main character count πSLOW/sβ number of dcache lookups that failed thelookup_fast()path and had to run thelookup_slow()path instead π’MISS/sβ number of dcache misses, meaning lookups that failed both the fast and slow paths πHIT%β percentage of dcache hits out of the total references π―
π¦ OVERHEAD π¦
the overhead depends on how often file and directory name lookups happen π« the per-event overhead is low, lowkey, but some apps can do over 100k lookups per second π at that point the low per-event cost starts adding up and could become measurable (over 10% CPU usage) π₯
π§ͺ measure this in a test environment first, please and thank you.
π SOURCE π
this is from bcc π
https://github.com/iovisor/bcc
also check out the companion _examples.txt file in the bcc distribution. it has example usage, output, and commentary for this tool π
π§ OS π§
Linux π§
π STABILITY π
Unstable - in development. it's still cooking, so be gentle π³
π©βπ» AUTHOR π©βπ»
Brendan Gregg, the legend himself ππ«Ά
π SEE ALSO π
dcsnoop(8)β the sibling tool you should check out next π¦
Manual page dcstat(8) from USER COMMANDS, dated 2016-02-09, signing off with love πβ¨ bye bestie ππ
π¦ 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