summaryrefslogtreecommitdiff
path: root/tools/lib
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2024-05-02 09:55:40 +0200
committerAndrii Nakryiko <andrii@kernel.org>2024-05-02 08:56:23 -0700
commit5a3941f84b8f91bb1e111499d803b32188d33e5d (patch)
treeb17b5aeba04269535dff4f7436c3503cf96c67fc /tools/lib
parentac2f438c2a85acd07e0ac7dc2f69d45bda1bb498 (diff)
libbpf: Fix error message in attach_kprobe_session
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> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20240502075541.1425761-1-jolsa@kernel.org
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/bpf/libbpf.c2
1 files changed, 1 insertions, 1 deletions
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;
}