Commit 5a3941f8 authored by Jiri Olsa's avatar Jiri Olsa Committed by Andrii Nakryiko

libbpf: Fix error message in attach_kprobe_session

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

Fixes: 2ca178f0 ("libbpf: Add support for kprobe session attach")
Reported-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20240502075541.1425761-1-jolsa@kernel.org
parent ac2f438c
...@@ -11605,7 +11605,7 @@ static int attach_kprobe_session(const struct bpf_program *prog, long cookie, ...@@ -11605,7 +11605,7 @@ static int attach_kprobe_session(const struct bpf_program *prog, long cookie,
spec = prog->sec_name + sizeof("kprobe.session/") - 1; spec = prog->sec_name + sizeof("kprobe.session/") - 1;
n = sscanf(spec, "%m[a-zA-Z0-9_.*?]", &pattern); n = sscanf(spec, "%m[a-zA-Z0-9_.*?]", &pattern);
if (n < 1) { 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; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment