kernel-hacking-2024-linux-s.../tools/lib/bpf
Andrii Nakryiko 189f1a976e libbpf: Fix no-args func prototype BTF dumping syntax
For all these years libbpf's BTF dumper has been emitting not strictly
valid syntax for function prototypes that have no input arguments.

Instead of `int (*blah)()` we should emit `int (*blah)(void)`.

This is not normally a problem, but it manifests when we get kfuncs in
vmlinux.h that have no input arguments. Due to compiler internal
specifics, we get no BTF information for such kfuncs, if they are not
declared with proper `(void)`.

The fix is trivial. We also need to adjust a few ancient tests that
happily assumed `()` is correct.

Fixes: 351131b51c ("libbpf: add btf_dump API for BTF-to-C conversion")
Reported-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://lore.kernel.org/bpf/20240712224442.282823-1-andrii@kernel.org
2024-07-17 22:42:47 +02:00
..
.gitignore
bpf.c libbpf: fix feature detectors when using token_fd 2024-05-15 09:34:53 -07:00
bpf.h libbpf: add support for BPF cookie for raw_tp/tp_btf programs 2024-03-19 23:05:34 -07:00
bpf_core_read.h bpf: Avoid uninitialized value in BPF_CORE_READ_BITFIELD 2024-05-08 15:00:55 -07:00
bpf_endian.h
bpf_gen_internal.h
bpf_helpers.h libbpf: Fix bpf_ksym_exists() in GCC 2024-05-02 22:47:22 -07:00
bpf_prog_linfo.c
bpf_tracing.h libbpf: Avoid casts from pointers to enums in bpf_tracing.h 2024-05-02 22:58:58 -07:00
btf.c libbpf: Fix error handling in btf__distill_base() 2024-07-01 17:05:08 +02:00
btf.h libbpf: Make btf_parse_elf process .BTF.base transparently 2024-06-17 14:38:31 -07:00
btf_dump.c libbpf: Fix no-args func prototype BTF dumping syntax 2024-07-17 22:42:47 +02:00
btf_iter.c libbpf,bpf: Share BTF relocate-related code with kernel 2024-06-21 14:45:07 -07:00
btf_relocate.c libbpf: Fix clang compilation error in btf_relocate.c 2024-06-26 16:38:59 -07:00
Build libbpf: Split field iter code into its own file kernel 2024-06-21 14:45:07 -07:00
elf.c libbpf: Move feature detection code into its own file 2024-01-24 16:21:02 -08:00
features.c libbpf: don't close(-1) in multi-uprobe feature detector 2024-05-31 14:56:51 -07:00
gen_loader.c libbpf: Store zero fd to fd_array for loader kfunc relocation 2023-05-16 22:09:23 -07:00
hashmap.c
hashmap.h libbpf: Remove HASHMAP_INIT static initialization helper 2023-07-11 09:40:05 -07:00
libbpf.c libbpf: improve old BPF skeleton handling for map auto-attach 2024-07-09 19:03:36 -07:00
libbpf.h libbpf: Auto-attach struct_ops BPF maps in BPF skeleton 2024-06-06 10:06:05 -07:00
libbpf.map libbpf: Split BTF relocation 2024-06-17 14:38:31 -07:00
libbpf.pc.template
libbpf_common.h libbpf: Fix potential uninitialized tail padding with LIBBPF_OPTS_RESET 2023-11-09 19:07:51 -08:00
libbpf_errno.c
libbpf_internal.h libbpf: Split BTF relocation 2024-06-17 14:38:31 -07:00
libbpf_legacy.h
libbpf_probes.c bpf: improve error message for unsupported helper 2024-03-28 18:30:53 -07:00
libbpf_version.h libbpf: Start v1.5 development cycle 2024-04-06 09:11:10 -07:00
linker.c libbpf: Checking the btf_type kind when fixing variable offsets 2024-06-21 20:00:17 +02:00
Makefile kbuild: unexport abs_srctree and abs_objtree 2024-03-10 17:27:17 +09:00
netlink.c libbpf: Use OPTS_SET() macro in bpf_xdp_query() 2024-02-06 09:51:26 -08:00
nlattr.c
nlattr.h
relo_core.c libbpf: fix signedness determination in CO-RE relo handling logic 2023-08-23 21:13:48 -07:00
relo_core.h
ringbuf.c libbpf: fix ring_buffer__consume_n() return result logic 2024-05-02 16:41:03 -07:00
skel_internal.h
str_error.c libbpf: fix libbpf_strerror_r() handling unknown errors 2024-05-07 16:21:59 -07:00
str_error.h libbpf: Move feature detection code into its own file 2024-01-24 16:21:02 -08:00
strset.c
strset.h
usdt.bpf.h libbpf: Avoid casts from pointers to enums in bpf_tracing.h 2024-05-02 22:58:58 -07:00
usdt.c libbpf: Add uprobe multi link support to bpf_program__attach_usdt 2023-08-21 15:51:26 -07:00
zip.c
zip.h