提交 bba1b2a8 编写于 作者: D Daniel T. Lee 提交者: Alexei Starovoitov

samples: bpf: Replace symbol compare of trace_event

Previously, when this sample is added, commit 1c47910e
("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: 1c47910e ("samples/bpf: add perf_event+bpf example")
Signed-off-by: NDaniel T. Lee <danieltimlee@gmail.com>
Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20191205080114.19766-2-danieltimlee@gmail.com
上级 7f193c25
......@@ -37,9 +37,9 @@ static void print_ksym(__u64 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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册