summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorDaniel T. Lee <danieltimlee@gmail.com>2019-12-05 11:01:13 +0300
committerAlexei Starovoitov <ast@kernel.org>2019-12-12 02:27:28 +0300
commitbba1b2a890253528c45aa66cf856f289a215bfbc (patch)
tree9904527553fc4a39078b9602f0d99ab1905e1e04 /samples
parent7f193c2519a3dcfd61cd5e676b2959370f4b15be (diff)
downloadlinux-bba1b2a890253528c45aa66cf856f289a215bfbc.tar.xz
samples: bpf: Replace symbol compare of trace_event
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
Diffstat (limited to 'samples')
-rw-r--r--samples/bpf/trace_event_user.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/samples/bpf/trace_event_user.c b/samples/bpf/trace_event_user.c
index 16a16eadd509..749a50f2f9f3 100644
--- a/samples/bpf/trace_event_user.c
+++ b/samples/bpf/trace_event_user.c
@@ -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;
}