Skip to content

Strip away modifiers from BPF skeleton global variables

Andrii Nakryiko bpf netdev 2 versions – Applied

Status from this message: Applied. Thanks

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 1 replyApplied
  2. v13 patches 5 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2libbpf: support stripping modifiers for btf_dumptools/lib/bpf/btf.h tools/lib/bpf/btf_dump.c+10 -20 replies
2/2tools/bpftool: strip away modifiers from global variablestools/bpf/bpftool/gen.c tools/lib/bpf/btf.h tools/testing/selftests/bpf/prog_tests/skeleton.c +1 more+18 -190 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 bpf-next 0/2] Strip away modifiers from BPF skeleton global variables

Fix bpftool logic of stripping away const/volatile modifiers for all global variables during BPF skeleton generation. See patch #1 for details on when existing logic breaks and why it's important. Support special .strip_mods=true mode in btf_dump__emit_type_decl.

Recent example of when this has caused problems can be found in [0].

[0] https://github.com/iovisor/bcc/pull/2994#issuecomment-650588533

Cc Anton Protopopov <[email protected]>

Andrii Nakryiko (2):
libbpf: support stripping modifiers for btf_dump tools/bpftool: strip away modifiers from global variables

 tools/bpf/bpftool/gen.c                       | 23 ++++++++-----------
 tools/lib/bpf/btf.h                           |  4 +++-
 tools/lib/bpf/btf_dump.c                      | 10 ++++++--
 .../selftests/bpf/prog_tests/skeleton.c       |  6 ++---
 .../selftests/bpf/progs/test_skeleton.c       |  6 +++--
 5 files changed, 28 insertions(+), 21 deletions(-)
Signature · 1 line
2.24.1