bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 bpf-next 0/9] bpf: Add d_path helper - preparation changes
@ 2020-07-03  9:51 Jiri Olsa
  2020-07-03  9:51 ` [PATCH v5 bpf-next 1/9] bpf: Add resolve_btfids tool to resolve BTF IDs in ELF object Jiri Olsa
                   ` (8 more replies)
  0 siblings, 9 replies; 22+ messages in thread
From: Jiri Olsa @ 2020-07-03  9:51 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann
  Cc: netdev, bpf, Song Liu, Yonghong Song, Martin KaFai Lau,
	David Miller, John Fastabend, Wenbo Zhang, KP Singh,
	Andrii Nakryiko, Brendan Gregg, Florent Revest, Al Viro

hi,
this patchset does preparation work for adding d_path helper,
which still needs more work, but the initial set of patches
is ready and useful to have.

This patchset adds:
  - support to generate BTF ID lists that are resolved during
    kernel linking and usable within kernel code with following
    macros:

      BTF_ID_LIST(bpf_skb_output_btf_ids)
      BTF_ID(struct, sk_buff)

    and access it in kernel code via:
      extern u32 bpf_skb_output_btf_ids[];

  - resolve_btfids tool that scans elf object for .BTF_ids
    section and resolves its symbols with BTF ID values
  - resolving of bpf_ctx_convert struct and several other
    objects with BTF_ID_LIST


v5 changes:
  - added acks to patches I did not change in this version
  - split the original patchset into 2 parts and sending the first one
    where the support to define BTF list is added, the BTF set support
    will be posted later on [Andrii]
  - used u32 instead of int in btf_ids.h [Andrii]
  - changed the btf_ids.h define guard [Andrii]
  - added resolve_btfids_clean target [Andrii]
  - moved resolve_btfids test into prog_tests suite [Andrii]
  - fixed BTF type iteration index in test [Andrii]
  - removed btf_id checks in bpf_ctx_convert resolve code [Yonghong]
  - removed WARN_ON_ONCE from btf_resolve_helper_id [Yonghong]
  - added BTF_ID_UNUSED macro [Yonghong]
  - fixed out of the tree build failure [0day bot]

Also available at:
  https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
  bpf/d_path

thanks,
jirka


---
Jiri Olsa (9):
      bpf: Add resolve_btfids tool to resolve BTF IDs in ELF object
      bpf: Compile resolve_btfids tool at kernel compilation start
      bpf: Add BTF_ID_LIST/BTF_ID/BTF_ID_UNUSED macros
      bpf: Resolve BTF IDs in vmlinux image
      bpf: Remove btf_id helpers resolving
      bpf: Use BTF_ID to resolve bpf_ctx_convert struct
      bpf: Add info about .BTF.ids section to btf.rst
      tools headers: Adopt verbatim copy of btf_ids.h from kernel sources
      selftests/bpf: Add test for resolve_btfids

 Documentation/bpf/btf.rst                               |  36 +++++
 Makefile                                                |  25 +++-
 include/asm-generic/vmlinux.lds.h                       |   4 +
 include/linux/btf_ids.h                                 |  87 ++++++++++++
 kernel/bpf/btf.c                                        | 103 ++------------
 kernel/trace/bpf_trace.c                                |   9 +-
 net/core/filter.c                                       |   9 +-
 scripts/link-vmlinux.sh                                 |   6 +
 tools/Makefile                                          |   3 +
 tools/bpf/Makefile                                      |   9 +-
 tools/bpf/resolve_btfids/Build                          |  26 ++++
 tools/bpf/resolve_btfids/Makefile                       |  77 +++++++++++
 tools/bpf/resolve_btfids/main.c                         | 716 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/include/linux/btf_ids.h                           |  87 ++++++++++++
 tools/include/linux/compiler.h                          |   4 +
 tools/testing/selftests/bpf/Makefile                    |  22 ++-
 tools/testing/selftests/bpf/prog_tests/resolve_btfids.c | 170 +++++++++++++++++++++++
 17 files changed, 1289 insertions(+), 104 deletions(-)
 create mode 100644 include/linux/btf_ids.h
 create mode 100644 tools/bpf/resolve_btfids/Build
 create mode 100644 tools/bpf/resolve_btfids/Makefile
 create mode 100644 tools/bpf/resolve_btfids/main.c
 create mode 100644 tools/include/linux/btf_ids.h
 create mode 100644 tools/testing/selftests/bpf/prog_tests/resolve_btfids.c


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

end of thread, other threads:[~2020-07-08 21:18 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-03  9:51 [PATCH v5 bpf-next 0/9] bpf: Add d_path helper - preparation changes Jiri Olsa
2020-07-03  9:51 ` [PATCH v5 bpf-next 1/9] bpf: Add resolve_btfids tool to resolve BTF IDs in ELF object Jiri Olsa
2020-07-07  0:34   ` Andrii Nakryiko
2020-07-07 15:43     ` Jiri Olsa
2020-07-03  9:51 ` [PATCH v5 bpf-next 2/9] bpf: Compile resolve_btfids tool at kernel compilation start Jiri Olsa
2020-07-03  9:51 ` [PATCH v5 bpf-next 3/9] bpf: Add BTF_ID_LIST/BTF_ID/BTF_ID_UNUSED macros Jiri Olsa
2020-07-03  9:51 ` [PATCH v5 bpf-next 4/9] bpf: Resolve BTF IDs in vmlinux image Jiri Olsa
2020-07-07  0:38   ` Andrii Nakryiko
2020-07-07 15:35     ` Jiri Olsa
2020-07-03  9:51 ` [PATCH v5 bpf-next 5/9] bpf: Remove btf_id helpers resolving Jiri Olsa
2020-07-07  0:46   ` Andrii Nakryiko
2020-07-03  9:51 ` [PATCH v5 bpf-next 6/9] bpf: Use BTF_ID to resolve bpf_ctx_convert struct Jiri Olsa
2020-07-07  0:47   ` Andrii Nakryiko
2020-07-03  9:51 ` [PATCH v5 bpf-next 7/9] bpf: Add info about .BTF.ids section to btf.rst Jiri Olsa
2020-07-03  9:51 ` [PATCH v5 bpf-next 8/9] tools headers: Adopt verbatim copy of btf_ids.h from kernel sources Jiri Olsa
2020-07-07  0:56   ` Andrii Nakryiko
2020-07-07 15:44     ` Jiri Olsa
2020-07-03  9:51 ` [PATCH v5 bpf-next 9/9] selftests/bpf: Add test for resolve_btfids Jiri Olsa
2020-07-07  1:26   ` Andrii Nakryiko
2020-07-07 15:57     ` Jiri Olsa
2020-07-07 17:49       ` Andrii Nakryiko
2020-07-08 21:18         ` Jiri Olsa

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