Skip to content

btf: support BTF_KIND_ENUM64

Yonghong Song bpf dwarves 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 7 repliesIn review
  2. v22 patches 4 repliesSuperseded
  3. v12 patches 0 repliesSuperseded

Changes in v3 from the cover letter

- pass struct type/conf_load pointers to btf_encoder__add_enum[_value] to make code easier to understand.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2libbpf: Sync with latest libbpf repolib/bpf+1 -10 replies
2/2btf: Support BTF_KIND_ENUM64btf_encoder.c btf_encoder.h dwarf_loader.c +3 more+80 -212 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchAndrii NakryikoJiri Olsa
SeriesT-b
1/2
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH dwarves v3 0/2] btf: support BTF_KIND_ENUM64

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(-)
Signature · 1 line
2.30.2