Re: [PATCH dwarves v3 2/2] btf: Support BTF_KIND_ENUM64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Em Wed, Jun 29, 2022 at 04:12:19PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Wed, Jun 29, 2022 at 12:12:24AM -0700, Yonghong Song escreveu:
> > BTF_KIND_ENUM64 is supported with latest libbpf, which
> > supports 64-bit enum values. Latest libbpf also supports
> > signedness for enum values. Add enum64 support in
> > dwarf-to-btf conversion.
> > 
> > The following is an example of new encoding which covers
> > signed/unsigned enum64/enum variations.
> 
> So, testing this with torvalds/master I'm getting:
> 
> FAILED: load BTF from vmlinux: Invalid argument
> make[1]: *** [/var/home/acme/git/linux/Makefile:1164: vmlinux] Error 255
> make[1]: *** Deleting file 'vmlinux'
> make[1]: Leaving directory '/var/home/acme/git/build/v5.19-rc4+'
> make: *** [Makefile:219: __sub-make] Error 2
> 
> real	8m12.396s
> user	183m18.009s
> sys	44m27.085s
> ⬢[acme@toolbox linux]$ find . -name "*.c" | xargs grep "load BTF from vmlinux"
> ⬢[acme@toolbox linux]$ find . -name "*.c" | xargs grep "load BTF from"
> ./tools/bpf/bpftool/btf.c:			p_err("failed to load BTF from %s: %s",
> ./tools/bpf/resolve_btfids/main.c:		pr_err("FAILED: load BTF from %s: %s\n",
> ./tools/testing/selftests/bpf/prog_tests/resolve_btfids.c:		  "Failed to load BTF from btf_data.o\n"))
> ⬢[acme@toolbox linux]$ vim ./tools/bpf/resolve_btfids/main.c
> 
> Which is:
> 
>         btf = btf__parse_split(obj->btf ?: obj->path, base_btf);
>         err = libbpf_get_error(btf);
>         if (err) {
>                 pr_err("FAILED: load BTF from %s: %s\n",
>                         obj->btf ?: obj->path, strerror(-err));
>                 goto out;
>         }
> 
> I.e. tools/lib/bpf in torvalds/master doesn´t support BTF_KIND_ENUM64,
> right? So to build it with a new pahole one needs to ask for
> --skip_encoding_btf_enum64? How to do this automagically? I.e. its a
> matter of checking if the in-kernel libbpf has support for it and if not
> use --skip_encoding_btf_enum64?
> 
> I'm now going to try with bpf-next/master

Yeah, works with bpf-next:

⬢[acme@toolbox bpf-next]$ pdwtags -F btf ../build/bpf-next/vmlinux | grep -A5 -B5 BPF_F_CTXLEN_MASK

/* 28548 */
enum {
	BPF_F_INDEX_MASK  = 4294967295,
	BPF_F_CURRENT_CPU = 4294967295,
	BPF_F_CTXLEN_MASK = 4503595332403200,
} __attribute__((__packed__)); /* size: 8 */

/* 28549 */
enum {
	BPF_F_GET_BRANCH_RECORDS_SIZE = 1,
⬢[acme@toolbox bpf-next]$



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux