Skip to content

Commit

Permalink
filelife: use d_name.name and d_name.len instead of d_iname (iovisor#700
Browse files Browse the repository at this point in the history
)

This is similar in spirit to what was done in PR iovisor#677 to fix the
problem reported in iovisor#609.

filelife.py is now converted to use the right struct field.

Signed-off-by: Marco Leogrande <[email protected]>
  • Loading branch information
dark authored and 4ast committed Sep 26, 2016
1 parent 5246458 commit 6644186
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/filelife.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,14 @@
delta = (bpf_ktime_get_ns() - *tsp) / 1000000;
birth.delete(&dentry);
if (dentry->d_iname[0] == 0)
if (dentry->d_name.len == 0)
return 0;
if (bpf_get_current_comm(&data.comm, sizeof(data.comm)) == 0) {
data.pid = pid;
data.delta = delta;
bpf_probe_read(&data.fname, sizeof(data.fname), dentry->d_iname);
bpf_probe_read(&data.fname, sizeof(data.fname),
(void *)dentry->d_name.name);
}
events.perf_submit(ctx, &data, sizeof(data));
Expand Down

0 comments on commit 6644186

Please sign in to comment.