Skip to content

Commit

Permalink
fix filelife missing output (iovisor#729)
Browse files Browse the repository at this point in the history
  • Loading branch information
brendangregg authored and 4ast committed Oct 5, 2016
1 parent 6e60fbc commit ba404cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions man/man8/filelife.8
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ on who deleted the file, the file age, and the file name. The intent is to
provide information on short-lived files, for debugging or performance
analysis.

This works by tracing the kernel vfs_create() and vfs_delete() functions using
dynamic tracing, and will need updating to match any changes to these
functions.
This works by tracing the kernel vfs_create() and vfs_delete() functions (and
maybe more, see the source) using dynamic tracing, and will need updating to
match any changes to these functions.

This makes use of a Linux 4.5 feature (bpf_perf_event_output());
for kernels older than 4.5, see the version under tools/old,
Expand Down
3 changes: 3 additions & 0 deletions tools/filelife.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ class Data(ct.Structure):
# initialize BPF
b = BPF(text=bpf_text)
b.attach_kprobe(event="vfs_create", fn_name="trace_create")
# newer kernels (say, 4.8) may don't fire vfs_create, so record (or overwrite)
# the timestamp in security_inode_create():
b.attach_kprobe(event="security_inode_create", fn_name="trace_create")
b.attach_kprobe(event="vfs_unlink", fn_name="trace_unlink")

# header
Expand Down

0 comments on commit ba404cf

Please sign in to comment.