Commit 4deecdd2 authored by Tyrone Wu's avatar Tyrone Wu Committed by Alexei Starovoitov
Browse files

bpf: fix unpopulated name_len field in perf_event link info



Previously when retrieving `bpf_link_info.perf_event` for
kprobe/uprobe/tracepoint, the `name_len` field was not populated by the
kernel, leaving it to reflect the value initially set by the user. This
behavior was inconsistent with how other input/output string buffer
fields function (e.g. `raw_tracepoint.tp_name_len`).

This patch fills `name_len` with the actual size of the string name.

Fixes: 1b715e1b ("bpf: Support ->fill_link_info for perf_event")
Signed-off-by: default avatarTyrone Wu <wudevelops@gmail.com>
Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
Acked-by: default avatarYafang Shao <laoar.shao@gmail.com>
Link: https://lore.kernel.org/r/20241008164312.46269-1-wudevelops@gmail.com


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 43424763
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment