diff options
author | Daniel T. Lee <danieltimlee@gmail.com> | 2019-12-05 17:01:13 +0900 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-12 12:17:13 +0100 |
commit | 5663eb75ee9ad591b089e92f03029ed970e05baf (patch) | |
tree | 08460dff488b9886ec2e41d4c6183bd10ac570bd | |
parent | 712cd9d02b8400f1752db9cc2050e402ff874e66 (diff) | |
download | linux-stable-5663eb75ee9ad591b089e92f03029ed970e05baf.tar.gz linux-stable-5663eb75ee9ad591b089e92f03029ed970e05baf.tar.bz2 linux-stable-5663eb75ee9ad591b089e92f03029ed970e05baf.zip |
samples: bpf: Replace symbol compare of trace_event
[ Upstream commit bba1b2a890253528c45aa66cf856f289a215bfbc ]
Previously, when this sample is added, commit 1c47910ef8013
("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: 1c47910ef8013 ("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>
-rw-r--r-- | samples/bpf/trace_event_user.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/samples/bpf/trace_event_user.c b/samples/bpf/trace_event_user.c index d08046ab81f0..d33022447d6b 100644 --- a/samples/bpf/trace_event_user.c +++ b/samples/bpf/trace_event_user.c @@ -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; } |