BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next 1/2] libbpf: Fix error message in attach_kprobe_session
@ 2024-05-02  7:55 Jiri Olsa
  2024-05-02  7:55 ` [PATCH bpf-next 2/2] libbpf: Fix error message in attach_kprobe_multi Jiri Olsa
  2024-05-02 16:30 ` [PATCH bpf-next 1/2] libbpf: Fix error message in attach_kprobe_session patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Jiri Olsa @ 2024-05-02  7:55 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
  Cc: bpf, Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Stanislav Fomichev, Hao Luo

We just failed to retrieve pattern, so we need to print spec instead.

Fixes: 2ca178f02b2f ("libbpf: Add support for kprobe session attach")
Reported-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/lib/bpf/libbpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 4ffc8873d1ad..68c87aed8335 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -11605,7 +11605,7 @@ static int attach_kprobe_session(const struct bpf_program *prog, long cookie,
 	spec = prog->sec_name + sizeof("kprobe.session/") - 1;
 	n = sscanf(spec, "%m[a-zA-Z0-9_.*?]", &pattern);
 	if (n < 1) {
-		pr_warn("kprobe session pattern is invalid: %s\n", pattern);
+		pr_warn("kprobe session pattern is invalid: %s\n", spec);
 		return -EINVAL;
 	}
 
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-05-02 16:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-02  7:55 [PATCH bpf-next 1/2] libbpf: Fix error message in attach_kprobe_session Jiri Olsa
2024-05-02  7:55 ` [PATCH bpf-next 2/2] libbpf: Fix error message in attach_kprobe_multi Jiri Olsa
2024-05-02 16:30 ` [PATCH bpf-next 1/2] libbpf: Fix error message in attach_kprobe_session patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox