netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 bpf-next 0/2] Strip away modifiers from BPF skeleton global variables
@ 2020-07-13 23:24 Andrii Nakryiko
  2020-07-13 23:24 ` [PATCH v2 bpf-next 1/2] libbpf: support stripping modifiers for btf_dump Andrii Nakryiko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andrii Nakryiko @ 2020-07-13 23:24 UTC (permalink / raw)
  To: bpf, netdev, ast, daniel
  Cc: andrii.nakryiko, kernel-team, Andrii Nakryiko, Anton Protopopov

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 <a.s.protopopov@gmail.com>

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(-)

-- 
2.24.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-14  0:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-13 23:24 [PATCH v2 bpf-next 0/2] Strip away modifiers from BPF skeleton global variables Andrii Nakryiko
2020-07-13 23:24 ` [PATCH v2 bpf-next 1/2] libbpf: support stripping modifiers for btf_dump Andrii Nakryiko
2020-07-13 23:24 ` [PATCH v2 bpf-next 2/2] tools/bpftool: strip away modifiers from global variables Andrii Nakryiko
2020-07-14  0:11 ` [PATCH v2 bpf-next 0/2] Strip away modifiers from BPF skeleton " Alexei Starovoitov

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 NNTP newsgroup(s).