Skip to content

Commit

Permalink
save one bpf_probe_read()
Browse files Browse the repository at this point in the history
  • Loading branch information
brendangregg committed Feb 11, 2016
1 parent 0a7f5ac commit d18657e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/dcsnoop.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@
{
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;
Expand Down

0 comments on commit d18657e

Please sign in to comment.