Commit 0cdf296a authored by Paul Chaignon's avatar Paul Chaignon

tools: Remove unnecessary bpf_probe_read

Dereferences of structure members pointing to external addresses are
now correctly recognized and replaced by bpf_probe_read calls by the
rewriter.
parent b341d8fd
......@@ -224,8 +224,8 @@ static int trace_return(struct pt_regs *ctx, int type)
// 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);
......
......@@ -219,8 +219,8 @@ static int trace_return(struct pt_regs *ctx, int type)
// 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);
......
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