libbpf: Fix error message in attach_kprobe_session
Jiri Olsa
reviewerPATCH 1/2 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 <[email protected]>
Signed-off-by Jiri Olsa <[email protected]>
--- tools/lib/bpf/libbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/libbpf.c +1 -1
@@ -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 ; }
Signature · 1 line
2.44.0
Jiri Olsa
reviewerPATCH 2/2 libbpf: Fix error message in attach_kprobe_multi
We just failed to retrieve pattern, so we need to print spec instead.
Fixes ddc6b04989eb ("libbpf: Add bpf_program__attach_kprobe_multi_opts function")
Reported-by Andrii Nakryiko <[email protected]>
Signed-off-by Jiri Olsa <[email protected]>
--- tools/lib/bpf/libbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/libbpf.c +1 -1
@@ -11579,7 +11579,7 @@ static int attach_kprobe_multi(const struct bpf_program *prog, long cookie, stru n =sscanf (spec,"%m[a-zA-Z0-9_.*?]" , &pattern);if (n <1 ) { -pr_warn ("kprobe multi pattern is invalid: %s\n" , pattern); +pr_warn ("kprobe multi pattern is invalid: %s\n" , spec);return -EINVAL ; }
Signature · 1 line
2.44.0
This series was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:
Hello:
This series was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:
Quoted 8 lines · On Thu, 2 May 2024 09:55:40 +0200 you wrote:
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 <[email protected]>Signed-off-by Jiri Olsa <[email protected]>--- tools/lib/bpf/libbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- [bpf-next,1/2] libbpf: Fix error message in attach_kprobe_session
https://git.kernel.org/bpf/bpf-next/c/5a3941f84b8f - [bpf-next,2/2] libbpf: Fix error message in attach_kprobe_multi https://git.kernel.org/bpf/bpf-next/c/7c13ef16e87a
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html