mbox series

[bpf-next,0/5,v2] libbpf: Add btf__type_cnt() and btf__raw_data() APIs

Message ID 20211022130623.1548429-1-hengqi.chen@gmail.com (mailing list archive)
Headers show
Series libbpf: Add btf__type_cnt() and btf__raw_data() APIs | expand

Message

Hengqi Chen Oct. 22, 2021, 1:06 p.m. UTC
Add btf__type_cnt() and btf__raw_data() APIs and deprecate
btf__get_nr_type() and btf__get_raw_data() since the old APIs
don't follow libbpf naming convention. Also update tools/selftests
to use these new APIs. This is part of effort towards libbpf v1.0

v1->v2:
 - Update commit message, deprecate the old APIs in libbpf v0.7 (Andrii)
 - Separate changes in tools/ to individual patches (Andrii)

Hengqi Chen (5):
  libbpf: Add btf__type_cnt() and btf__raw_data() APIs
  perf bpf: Switch to new btf__raw_data API
  tools/resolve_btfids: Switch to new btf__type_cnt API
  bpftool: Switch to new btf__type_cnt API
  selftests/bpf: Switch to new btf__type_cnt/btf__raw_data APIs

 tools/bpf/bpftool/btf.c                       | 12 +++----
 tools/bpf/bpftool/gen.c                       |  4 +--
 tools/bpf/resolve_btfids/main.c               |  4 +--
 tools/lib/bpf/btf.c                           | 36 +++++++++++--------
 tools/lib/bpf/btf.h                           |  4 +++
 tools/lib/bpf/btf_dump.c                      |  8 ++---
 tools/lib/bpf/libbpf.c                        | 36 +++++++++----------
 tools/lib/bpf/libbpf.map                      |  2 ++
 tools/lib/bpf/linker.c                        | 28 +++++++--------
 tools/perf/util/bpf-event.c                   |  2 +-
 tools/testing/selftests/bpf/btf_helpers.c     |  4 +--
 tools/testing/selftests/bpf/prog_tests/btf.c  | 10 +++---
 .../selftests/bpf/prog_tests/btf_dump.c       |  8 ++---
 .../selftests/bpf/prog_tests/btf_endian.c     | 12 +++----
 .../selftests/bpf/prog_tests/btf_split.c      |  2 +-
 .../selftests/bpf/prog_tests/core_autosize.c  |  2 +-
 .../selftests/bpf/prog_tests/core_reloc.c     |  2 +-
 .../selftests/bpf/prog_tests/resolve_btfids.c |  4 +--
 18 files changed, 97 insertions(+), 83 deletions(-)

--
2.30.2

Comments

Andrii Nakryiko Oct. 22, 2021, 11:39 p.m. UTC | #1
On Fri, Oct 22, 2021 at 6:06 AM Hengqi Chen <hengqi.chen@gmail.com> wrote:
>
> Add btf__type_cnt() and btf__raw_data() APIs and deprecate
> btf__get_nr_type() and btf__get_raw_data() since the old APIs
> don't follow libbpf naming convention. Also update tools/selftests
> to use these new APIs. This is part of effort towards libbpf v1.0
>
> v1->v2:
>  - Update commit message, deprecate the old APIs in libbpf v0.7 (Andrii)
>  - Separate changes in tools/ to individual patches (Andrii)
>

Applied to bpf-next, thanks.

> Hengqi Chen (5):
>   libbpf: Add btf__type_cnt() and btf__raw_data() APIs
>   perf bpf: Switch to new btf__raw_data API
>   tools/resolve_btfids: Switch to new btf__type_cnt API
>   bpftool: Switch to new btf__type_cnt API
>   selftests/bpf: Switch to new btf__type_cnt/btf__raw_data APIs
>
>  tools/bpf/bpftool/btf.c                       | 12 +++----
>  tools/bpf/bpftool/gen.c                       |  4 +--
>  tools/bpf/resolve_btfids/main.c               |  4 +--
>  tools/lib/bpf/btf.c                           | 36 +++++++++++--------
>  tools/lib/bpf/btf.h                           |  4 +++
>  tools/lib/bpf/btf_dump.c                      |  8 ++---
>  tools/lib/bpf/libbpf.c                        | 36 +++++++++----------
>  tools/lib/bpf/libbpf.map                      |  2 ++
>  tools/lib/bpf/linker.c                        | 28 +++++++--------
>  tools/perf/util/bpf-event.c                   |  2 +-
>  tools/testing/selftests/bpf/btf_helpers.c     |  4 +--
>  tools/testing/selftests/bpf/prog_tests/btf.c  | 10 +++---
>  .../selftests/bpf/prog_tests/btf_dump.c       |  8 ++---
>  .../selftests/bpf/prog_tests/btf_endian.c     | 12 +++----
>  .../selftests/bpf/prog_tests/btf_split.c      |  2 +-
>  .../selftests/bpf/prog_tests/core_autosize.c  |  2 +-
>  .../selftests/bpf/prog_tests/core_reloc.c     |  2 +-
>  .../selftests/bpf/prog_tests/resolve_btfids.c |  4 +--
>  18 files changed, 97 insertions(+), 83 deletions(-)
>
> --
> 2.30.2