[PATCH v4 2/3] libbpf: fix wrong variable used in perf_event_uprobe_open_legacy()

From: Chuang Wang
Date: Wed Jun 29 2022 - 11:19:39 EST


Use "type" as opposed to "err" in pr_warn() after
determine_uprobe_perf_type_legacy() returns an error.

Signed-off-by: Chuang Wang <nashuiliang@xxxxxxxxx>
---
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 8a33a52e01a5..159b69d8b941 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -10241,7 +10241,7 @@ static int perf_event_uprobe_open_legacy(const char *probe_name, bool retprobe,
type = determine_uprobe_perf_type_legacy(probe_name, retprobe);
if (type < 0) {
pr_warn("failed to determine legacy uprobe event id for %s:0x%zx: %d\n",
- binary_path, offset, err);
+ binary_path, offset, type);
return type;
}

--
2.34.1