Commit 71cff670 authored by Qiang Wang's avatar Qiang Wang Committed by Andrii Nakryiko

libbpf: Use probe_name for legacy kprobe

Fix a bug in commit 46ed5fc3, which wrongly used the
func_name instead of probe_name to register legacy kprobe.

Fixes: 46ed5fc3 ("libbpf: Refactor and simplify legacy kprobe code")
Co-developed-by: default avatarChengming Zhou <zhouchengming@bytedance.com>
Signed-off-by: default avatarQiang Wang <wangqiang.wq.frank@bytedance.com>
Signed-off-by: default avatarChengming Zhou <zhouchengming@bytedance.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Tested-by: default avatarHengqi Chen <hengqi.chen@gmail.com>
Reviewed-by: default avatarHengqi Chen <hengqi.chen@gmail.com>
Link: https://lore.kernel.org/bpf/20211227130713.66933-1-wangqiang.wq.frank@bytedance.com
parent 7218c28c
......@@ -10017,7 +10017,7 @@ bpf_program__attach_kprobe_opts(const struct bpf_program *prog,
gen_kprobe_legacy_event_name(probe_name, sizeof(probe_name),
func_name, offset);
legacy_probe = strdup(func_name);
legacy_probe = strdup(probe_name);
if (!legacy_probe)
return libbpf_err_ptr(-ENOMEM);
......
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