From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Yonghong Song <yhs@fb.com>
Cc: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>,
dwarves@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
bpf@vger.kernel.org, Daniel Borkmann <daniel@iogearbox.net>,
kernel-team@fb.com
Subject: Re: [PATCH dwarves v3 2/2] btf: Support BTF_KIND_ENUM64
Date: Wed, 29 Jun 2022 17:00:32 -0300 [thread overview]
Message-ID: <YryvYNjbDFWDHtvY@kernel.org> (raw)
In-Reply-To: <YrykE1zgKXvKaAgx@kernel.org>
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]$
next prev parent reply other threads:[~2022-06-29 20:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-29 7:12 [PATCH dwarves v3 0/2] btf: support BTF_KIND_ENUM64 Yonghong Song
2022-06-29 7:12 ` [PATCH dwarves v3 1/2] libbpf: Sync with latest libbpf repo Yonghong Song
2022-06-29 7:12 ` [PATCH dwarves v3 2/2] btf: Support BTF_KIND_ENUM64 Yonghong Song
2022-06-29 19:12 ` Arnaldo Carvalho de Melo
2022-06-29 20:00 ` Arnaldo Carvalho de Melo [this message]
2022-06-29 13:16 ` [PATCH dwarves v3 0/2] btf: support BTF_KIND_ENUM64 Arnaldo Carvalho de Melo
2022-06-29 21:44 ` Arnaldo Carvalho de Melo
2022-06-30 2:33 ` Yonghong Song
2022-07-11 9:16 ` Jiri Olsa
2022-07-11 9:37 ` Jiri Olsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YryvYNjbDFWDHtvY@kernel.org \
--to=acme@kernel.org \
--cc=andrii@kernel.org \
--cc=arnaldo.melo@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=dwarves@vger.kernel.org \
--cc=kernel-team@fb.com \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox