Commit ba404cfe authored by Brendan Gregg's avatar Brendan Gregg Committed by 4ast

fix filelife missing output (#729)

parent 6e60fbc8
...@@ -9,9 +9,9 @@ on who deleted the file, the file age, and the file name. The intent is to ...@@ -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 provide information on short-lived files, for debugging or performance
analysis. analysis.
This works by tracing the kernel vfs_create() and vfs_delete() functions using This works by tracing the kernel vfs_create() and vfs_delete() functions (and
dynamic tracing, and will need updating to match any changes to these maybe more, see the source) using dynamic tracing, and will need updating to
functions. match any changes to these functions.
This makes use of a Linux 4.5 feature (bpf_perf_event_output()); 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, for kernels older than 4.5, see the version under tools/old,
......
...@@ -120,6 +120,9 @@ if debug: ...@@ -120,6 +120,9 @@ if debug:
# initialize BPF # initialize BPF
b = BPF(text=bpf_text) b = BPF(text=bpf_text)
b.attach_kprobe(event="vfs_create", fn_name="trace_create") 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") b.attach_kprobe(event="vfs_unlink", fn_name="trace_unlink")
# header # header
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment