From: "Daniel T. Lee" <danieltimlee@gmail.com>
To: Daniel Borkmann <daniel@iogearbox.net>,
Alexei Starovoitov <ast@kernel.org>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org
Subject: [PATCH,bpf-next 1/2] samples: bpf: replace symbol compare of trace_event
Date: Sat, 23 Nov 2019 14:51:50 +0900 [thread overview]
Message-ID: <20191123055151.9990-2-danieltimlee@gmail.com> (raw)
In-Reply-To: <20191123055151.9990-1-danieltimlee@gmail.com>
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.
Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>
---
samples/bpf/trace_event_user.c | 4 ++--
1 file 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;
}
--
2.24.0
next prev parent reply other threads:[~2019-11-23 5:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-23 5:51 [PATCH,bpf-next 0/2] Fix broken samples due to symbol mismatch Daniel T. Lee
2019-11-23 5:51 ` Daniel T. Lee [this message]
2019-11-23 5:51 ` [PATCH,bpf-next 2/2] samples: bpf: fix syscall_tp due to unused syscall Daniel T. Lee
2019-11-25 23:11 ` Daniel Borkmann
2019-11-25 18:42 ` [PATCH,bpf-next 0/2] Fix broken samples due to symbol mismatch John Fastabend
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191123055151.9990-2-danieltimlee@gmail.com \
--to=danieltimlee@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.