samples: bpf: Replace symbol compare of trace_event
[ Upstream commitbba1b2a890] Previously, when this sample is added, commit1c47910ef8("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:1c47910ef8("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 Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
712cd9d02b
commit
5663eb75ee
1 changed files with 2 additions and 2 deletions
|
|
@ -35,9 +35,9 @@ static void print_ksym(__u64 addr)
|
|||
return;
|
||||
sym = ksym_search(addr);
|
||||
printf("%s;", sym->name);
|
||||
if (!strcmp(sym->name, "sys_read"))
|
||||
if (!strstr(sym->name, "sys_read"))
|
||||
sys_read_seen = true;
|
||||
else if (!strcmp(sym->name, "sys_write"))
|
||||
else if (!strstr(sym->name, "sys_write"))
|
||||
sys_write_seen = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue