Skip to content

Commit

Permalink
tools: Remove unnecessary bpf_probe_read
Browse files Browse the repository at this point in the history
Dereferences of structure members pointing to external addresses are
now correctly recognized and replaced by bpf_probe_read calls by the
rewriter.
  • Loading branch information
pchaigno committed May 6, 2018
1 parent b341d8f commit 0cdf296
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tools/btrfsslower.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@
// 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);
de = valp->fp->f_path.dentry;
qs = de->d_name;
if (qs.len == 0)
return 0;
bpf_probe_read(&data.file, sizeof(data.file), (void *)qs.name);
Expand Down
4 changes: 2 additions & 2 deletions tools/ext4slower.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@
// 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);
de = valp->fp->f_path.dentry;
qs = de->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 0cdf296

Please sign in to comment.