Commit d18657ec authored by Brendan Gregg's avatar Brendan Gregg

save one bpf_probe_read()

parent 0a7f5ac9
......@@ -70,8 +70,9 @@ int kprobe__d_lookup(struct pt_regs *ctx, const struct dentry *parent,
{
u32 pid = bpf_get_current_pid_tgid();
struct entry_t entry = {};
if (name->name) {
bpf_probe_read(&entry.name, sizeof(entry.name), (void *)name->name);
const char *fname = name->name;
if (fname) {
bpf_probe_read(&entry.name, sizeof(entry.name), (void *)fname);
}
entrybypid.update(&pid, &entry);
return 0;
......
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