From: Yonghong Song <yhs@fb.com>
To: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>,
<dwarves@vger.kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>, <bpf@vger.kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>, <kernel-team@fb.com>
Subject: [PATCH dwarves v3 0/2] btf: support BTF_KIND_ENUM64
Date: Wed, 29 Jun 2022 00:12:13 -0700 [thread overview]
Message-ID: <20220629071213.3178592-1-yhs@fb.com> (raw)
Add support for enum64. For 64-bit enumerator value,
previously, the value is truncated into 32bit, e.g.,
for the following enum in linux uapi bpf.h,
enum {
BPF_F_INDEX_MASK = 0xffffffffULL,
BPF_F_CURRENT_CPU = BPF_F_INDEX_MASK,
/* BPF_FUNC_perf_event_output for sk_buff input context. */
BPF_F_CTXLEN_MASK = (0xfffffULL << 32),
};
BPF_F_CTXLEN_MASK will be encoded with 0 with BTF_KIND_ENUM
after pahole dwarf-to-btf conversion.
With this patch, the BPF_F_CTXLEN_MASK will be encoded properly
with BTF_KIND_ENUM64.
This patch is on top of tmp.master since tmp.master has not
been sync'ed with master branch yet.
Changelogs:
v2 -> v3:
- pass struct type/conf_load pointers to btf_encoder__add_enum[_value]
to make code easier to understand.
v1 -> v2:
- Add flag --skip_encoding_btf_enum64 to disable newly-added functionality.
Yonghong Song (2):
libbpf: Sync with latest libbpf repo
btf: Support BTF_KIND_ENUM64
btf_encoder.c | 67 +++++++++++++++++++++++++++++++++++------------
btf_encoder.h | 2 +-
dwarf_loader.c | 12 +++++++++
dwarves.h | 4 ++-
dwarves_fprintf.c | 6 ++++-
lib/bpf | 2 +-
pahole.c | 10 ++++++-
7 files changed, 81 insertions(+), 22 deletions(-)
--
2.30.2
next reply other threads:[~2022-06-29 7:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-29 7:12 Yonghong Song [this message]
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
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=20220629071213.3178592-1-yhs@fb.com \
--to=yhs@fb.com \
--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 \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).