filelife(8)
π filelife(8) π
Okay bestie, the filelife manual page is giving main character energy, so let's go through it together β¨
β¨ NAME β¨
filelife is a tool that traces the lifespan of short-lived files π¦ It uses Linux eBPF/bcc, so it's giving low-level kernel vibes π
π SYNOPSIS π
filelife [-h] [-p PID]
πΈ DESCRIPTION πΈ
Okay so this one traces files being created and deleted π For every deletion, it tells you who deleted the file, how old the file was, and what its name was. The whole point is to catch short-lived files so you can debug stuff or do performance analysis π₯
It works by tracing the kernel vfs_create() and vfs_delete() functions π§ There might be more it touches too, so check the source if you're curious π It uses dynamic tracing to do this, which means it will need updating if those functions ever change. Not me having to babysit it π
This tool uses a Linux 4.4 feature called bpf_perf_event_output() β¨ If you're on a kernel older than 4.4, look in the version under tools/old. That one uses an older mechanism instead π«Ά
Heads up: since this runs on BPF, only the root user can use this tool π
π REQUIREMENTS π
You need CONFIG_BPF and bcc π
β¨ OPTIONS β¨
-hβ Pulls up the usage message π-p PIDβ Only traces this process ID, and the filtering happens in-kernel π―
π EXAMPLES π
Trace all short-lived files and print the details:
# filelife
Trace all short-lived files created AND deleted by PID 181:
# filelife -p 181
π¦ FIELDS π¦
TIMEβ When the deletion happened β°PIDβ The process ID that deleted the file πͺͺCOMMβ The process name for that PID π·οΈAGE(s)β How old the file was, from creation to deletion, in seconds β³FILEβ The filename π
π OVERHEAD π
This traces the kernel VFS file create and delete functions and prints output for each delete. The rate is usually expected to be low (< 1000/s), so the overhead should be negligible π This is from bcc.
Check out the project here: https://github.com/iovisor/bcc
Also, look in the bcc distribution for a companion _examples.txt file. It has example usage, output, and commentary for this tool π
π» OS π»
Linux only π§
π§ͺ STABILITY π§ͺ
Unstable - it's still in development π§
π AUTHOR π
Brendan Gregg π«Ά
π SEE ALSO π
opensnoop(1)π
Okay bestie, that's the whole filelife page π
It's the manual for the filelife tool, from the USER COMMANDS section, dated 2016-02-08 π Go trace some short-lived files and slay the debugging game ππΈ
π¦ where this page comes from
- centos-stream 10: bcc-tools 0.36.1-1.el10 Β· Apache-2.0
- centos-stream 9: bcc-tools 0.36.1-1.el9 Β· ASL 2.0
- fedora 43: bcc-tools 0.35.0-2.fc43 Β· Apache-2.0
- fedora 44: bcc-tools 0.35.0-5.fc44 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms