diff options
| author | Jiri Olsa <[email protected]> | 2024-09-10 12:53:36 +0000 |
|---|---|---|
| committer | Andrii Nakryiko <[email protected]> | 2024-09-10 18:35:13 +0000 |
| commit | 8c8b4759740359a6f2e7ffdf6531dea871130c63 (patch) | |
| tree | 05927811c0ec86e093f21a5bc1e5e0ad164fe5a8 /tools/lib/bpf/libbpf.c | |
| parent | libbpf: Fix some typos in comments (diff) | |
| download | kernel-8c8b4759740359a6f2e7ffdf6531dea871130c63.tar.gz kernel-8c8b4759740359a6f2e7ffdf6531dea871130c63.zip | |
libbpf: Fix uretprobe.multi.s programs auto attachment
As reported by Andrii we don't currently recognize uretprobe.multi.s
programs as return probes due to using (wrong) strcmp function.
Using str_has_pfx() instead to match uretprobe.multi prefix.
Tests are passing, because the return program was executed
as entry program and all counts were incremented properly.
Reported-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Jiri Olsa <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/libbpf.c')
| -rw-r--r-- | tools/lib/bpf/libbpf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 4f29e06c2641..84d4ec0e1f60 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -11688,7 +11688,7 @@ static int attach_uprobe_multi(const struct bpf_program *prog, long cookie, stru ret = 0; break; case 3: - opts.retprobe = strcmp(probe_type, "uretprobe.multi") == 0; + opts.retprobe = str_has_pfx(probe_type, "uretprobe.multi"); *link = bpf_program__attach_uprobe_multi(prog, -1, binary_path, func_name, &opts); ret = libbpf_get_error(*link); break; |
