Skip to content

Commit

Permalink
tools: Fix compilation error due to rewriter update
Browse files Browse the repository at this point in the history
Since ad2d0d9, the bcc rewriter is able to track more external
pointers going through maps.  xfsslower and zfsslower were relying on
the rewriter not being able to replace some dereferences.  This
commit takes this into account and removes two unnecessary calls to
bpf_probe_read.
  • Loading branch information
pchaigno committed May 17, 2018
1 parent b8fccc5 commit 3ba742e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
5 changes: 1 addition & 4 deletions tools/xfsslower.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,7 @@
bpf_get_current_comm(&data.task, sizeof(data.task));
// workaround (rewriter should handle file to d_name in one step):
struct dentry *de = NULL;
struct qstr qs = {};
bpf_probe_read(&de, sizeof(de), &valp->fp->f_path.dentry);
bpf_probe_read(&qs, sizeof(qs), (void *)&de->d_name);
struct qstr qs = valp->fp->f_path.dentry->d_name;
if (qs.len == 0)
return 0;
bpf_probe_read(&data.file, sizeof(data.file), (void *)qs.name);
Expand Down
6 changes: 1 addition & 5 deletions tools/zfsslower.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,7 @@
data.offset = valp->offset;
bpf_get_current_comm(&data.task, sizeof(data.task));
// workaround (rewriter should handle file to d_name in one step):
struct dentry *de = NULL;
struct qstr qs = {};
bpf_probe_read(&de, sizeof(de), &valp->fp->f_path.dentry);
bpf_probe_read(&qs, sizeof(qs), (void *)&de->d_name);
struct qstr qs = valp->fp->f_path.dentry->d_name;
if (qs.len == 0)
return 0;
bpf_probe_read(&data.file, sizeof(data.file), (void *)qs.name);
Expand Down

0 comments on commit 3ba742e

Please sign in to comment.