libbpf: Replace '.' with '_' in legacy kprobe event name
authorMenglong Dong <imagedong@tencent.com>
Fri, 13 Jan 2023 09:34:27 +0000 (17:34 +0800)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 13 Jan 2023 22:05:47 +0000 (14:05 -0800)
commit2fa074536590a82ee6c670d5f119f3dfb4ca6015
tree1b17e1c7a76fae27f4c0dad931d3c15687410cb0
parent878625e1c7a10dfbb1fdaaaae2c4d2a58fbce627
libbpf: Replace '.' with '_' in legacy kprobe event name

'.' is not allowed in the event name of kprobe. Therefore, we will get a
EINVAL if the kernel function name has a '.' in legacy kprobe attach
case, such as 'icmp_reply.constprop.0'.

In order to adapt this case, we need to replace the '.' with other char
in gen_kprobe_legacy_event_name(). And I use '_' for this propose.

Signed-off-by: Menglong Dong <imagedong@tencent.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Alan Maguire <alan.maguire@oracle.com>
Link: https://lore.kernel.org/bpf/20230113093427.1666466-1-imagedong@tencent.com
tools/lib/bpf/libbpf.c