Skip to content

Commit bba1b2a

Browse files
DanielTimLeeAlexei Starovoitov
authored andcommitted
samples: bpf: Replace symbol compare of trace_event
Previously, when this sample is added, commit 1c47910 ("samples/bpf: add perf_event+bpf example"), a symbol 'sys_read' and 'sys_write' has been used without no prefixes. But currently there are no exact symbols with these under kallsyms and this leads to failure. This commit changes exact compare to substring compare to keep compatible with exact symbol or prefixed symbol. Fixes: 1c47910 ("samples/bpf: add perf_event+bpf example") Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20191205080114.19766-2-danieltimlee@gmail.com
1 parent 7f193c2 commit bba1b2a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎samples/bpf/trace_event_user.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ static void print_ksym(__u64 addr)
3737
}
3838

3939
printf("%s;", sym->name);
40-
if (!strcmp(sym->name, "sys_read"))
40+
if (!strstr(sym->name, "sys_read"))
4141
sys_read_seen = true;
42-
else if (!strcmp(sym->name, "sys_write"))
42+
else if (!strstr(sym->name, "sys_write"))
4343
sys_write_seen = true;
4444
}
4545

0 commit comments

Comments
 (0)