selftests/bpf: Test tracing_multi link with BTF ids of the same address
The stub of a syscall without arguments is an alias of its __do_sys_ function. Find such pair where both have BTF ids. Which ones do depends on the compiler, so don't hard code the names. Check that each id can be attached and that the attach of both in one link fails with -EINVAL. With CONFIG_DEBUG_INFO_BTF_INLINE vmlinux BTF has 26 names with more than one BTF_KIND_FUNC: [117318] FUNC 'hash' type_id=76715 linkage=static [117319] FUNC 'hash' type_id=76722 linkage=static [117320] FUNC 'hash' type_id=76789 linkage=static while there is one 'hash' in kallsyms. tracing_multi_bench_attach skips the names that are not unique in kallsyms only and passes all three ids to the kernel. Take the first id of the name. Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Leon Hwang <leon.hwang@linux.dev> Acked-by: Jiri Olsa <jolsa@kernel.org> Link: https://lore.kernel.org/bpf/20261011164836.2233874-3-alexei.starovoitov@gmail.com Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>