Commit 19b7f74f authored by yonghong-song's avatar yonghong-song Committed by GitHub

Merge pull request #1767 from pchaigno/fix-xfsslower

xfsslower: Fix compilation error due to rewriter update
parents b8fccc5f 3ba742e5
...@@ -187,10 +187,7 @@ static int trace_return(struct pt_regs *ctx, int type) ...@@ -187,10 +187,7 @@ static int trace_return(struct pt_regs *ctx, int type)
bpf_get_current_comm(&data.task, sizeof(data.task)); bpf_get_current_comm(&data.task, sizeof(data.task));
// workaround (rewriter should handle file to d_name in one step): // workaround (rewriter should handle file to d_name in one step):
struct dentry *de = NULL; struct qstr qs = valp->fp->f_path.dentry->d_name;
struct qstr qs = {};
bpf_probe_read(&de, sizeof(de), &valp->fp->f_path.dentry);
bpf_probe_read(&qs, sizeof(qs), (void *)&de->d_name);
if (qs.len == 0) if (qs.len == 0)
return 0; return 0;
bpf_probe_read(&data.file, sizeof(data.file), (void *)qs.name); bpf_probe_read(&data.file, sizeof(data.file), (void *)qs.name);
......
...@@ -190,11 +190,7 @@ static int trace_return(struct pt_regs *ctx, int type) ...@@ -190,11 +190,7 @@ static int trace_return(struct pt_regs *ctx, int type)
data.offset = valp->offset; data.offset = valp->offset;
bpf_get_current_comm(&data.task, sizeof(data.task)); bpf_get_current_comm(&data.task, sizeof(data.task));
// workaround (rewriter should handle file to d_name in one step): struct qstr qs = valp->fp->f_path.dentry->d_name;
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);
if (qs.len == 0) if (qs.len == 0)
return 0; return 0;
bpf_probe_read(&data.file, sizeof(data.file), (void *)qs.name); 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