Skip to content

Commit

Permalink
libbpf: Use probe_name for legacy kprobe
Browse files Browse the repository at this point in the history
Fix a bug in commit 46ed5fc, which wrongly used the
func_name instead of probe_name to register legacy kprobe.

Fixes: 46ed5fc ("libbpf: Refactor and simplify legacy kprobe code")
Co-developed-by: Chengming Zhou <zhouchengming@bytedance.com>
Signed-off-by: Qiang Wang <wangqiang.wq.frank@bytedance.com>
Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Tested-by: Hengqi Chen <hengqi.chen@gmail.com>
Reviewed-by: Hengqi Chen <hengqi.chen@gmail.com>
Link: https://lore.kernel.org/bpf/20211227130713.66933-1-wangqiang.wq.frank@bytedance.com
  • Loading branch information
Qiang Wang authored and Andrii Nakryiko committed Jan 5, 2022
1 parent 7218c28 commit 71cff67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/lib/bpf/libbpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 71cff67

Please sign in to comment.