mbox series

[v2,bpf-next,0/5] libbpf: BTF field iterator

Message ID 20240605001629.4061937-1-andrii@kernel.org (mailing list archive)
Headers show
Series libbpf: BTF field iterator | expand

Message

Andrii Nakryiko June 5, 2024, 12:16 a.m. UTC
Add BTF field (type and string fields, right now) iterator support instead of
using existing callback-based approaches, which make it harder to understand
and support BTF-processing code.

v1->v2:
  - t_cnt -> t_off_cnt, m_cnt -> m_off_cnt (Eduard);
  - simpified code in linker.c (Jiri);
rfcv1->v1:
  - check errors when initializing iterators (Jiri);
  - split RFC patch into separate patches.

Andrii Nakryiko (5):
  libbpf: add BTF field iterator
  libbpf: make use of BTF field iterator in BPF linker code
  libbpf: make use of BTF field iterator in BTF handling code
  bpftool: use BTF field iterator in btfgen
  libbpf: remove callback-based type/string BTF field visitor helpers

 tools/bpf/bpftool/gen.c         |  16 +-
 tools/lib/bpf/btf.c             | 328 +++++++++++++++++++-------------
 tools/lib/bpf/libbpf_internal.h |  26 ++-
 tools/lib/bpf/linker.c          |  58 +++---
 4 files changed, 262 insertions(+), 166 deletions(-)

Comments

Jiri Olsa June 5, 2024, 8:52 a.m. UTC | #1
On Tue, Jun 04, 2024 at 05:16:24PM -0700, Andrii Nakryiko wrote:
> Add BTF field (type and string fields, right now) iterator support instead of
> using existing callback-based approaches, which make it harder to understand
> and support BTF-processing code.
> 
> v1->v2:
>   - t_cnt -> t_off_cnt, m_cnt -> m_off_cnt (Eduard);
>   - simpified code in linker.c (Jiri);
> rfcv1->v1:
>   - check errors when initializing iterators (Jiri);
>   - split RFC patch into separate patches.
> 
> Andrii Nakryiko (5):
>   libbpf: add BTF field iterator
>   libbpf: make use of BTF field iterator in BPF linker code
>   libbpf: make use of BTF field iterator in BTF handling code
>   bpftool: use BTF field iterator in btfgen
>   libbpf: remove callback-based type/string BTF field visitor helpers

Acked-by: Jiri Olsa <jolsa@kernel.org>

jirka

> 
>  tools/bpf/bpftool/gen.c         |  16 +-
>  tools/lib/bpf/btf.c             | 328 +++++++++++++++++++-------------
>  tools/lib/bpf/libbpf_internal.h |  26 ++-
>  tools/lib/bpf/linker.c          |  58 +++---
>  4 files changed, 262 insertions(+), 166 deletions(-)
> 
> -- 
> 2.43.0
>
Alan Maguire June 5, 2024, 2:48 p.m. UTC | #2
On 05/06/2024 09:52, Jiri Olsa wrote:
> On Tue, Jun 04, 2024 at 05:16:24PM -0700, Andrii Nakryiko wrote:
>> Add BTF field (type and string fields, right now) iterator support instead of
>> using existing callback-based approaches, which make it harder to understand
>> and support BTF-processing code.
>>
>> v1->v2:
>>   - t_cnt -> t_off_cnt, m_cnt -> m_off_cnt (Eduard);
>>   - simpified code in linker.c (Jiri);
>> rfcv1->v1:
>>   - check errors when initializing iterators (Jiri);
>>   - split RFC patch into separate patches.
>>
>> Andrii Nakryiko (5):
>>   libbpf: add BTF field iterator
>>   libbpf: make use of BTF field iterator in BPF linker code
>>   libbpf: make use of BTF field iterator in BTF handling code
>>   bpftool: use BTF field iterator in btfgen
>>   libbpf: remove callback-based type/string BTF field visitor helpers
> 
> Acked-by: Jiri Olsa <jolsa@kernel.org>
>

Retested v2, all looks good

Tested-by: Alan Maguire <alan.maguire@oracle.com>

> jirka
> 
>>
>>  tools/bpf/bpftool/gen.c         |  16 +-
>>  tools/lib/bpf/btf.c             | 328 +++++++++++++++++++-------------
>>  tools/lib/bpf/libbpf_internal.h |  26 ++-
>>  tools/lib/bpf/linker.c          |  58 +++---
>>  4 files changed, 262 insertions(+), 166 deletions(-)
>>
>> -- 
>> 2.43.0
>>
patchwork-bot+netdevbpf@kernel.org June 5, 2024, 3 p.m. UTC | #3
Hello:

This series was applied to bpf/bpf-next.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:

On Tue,  4 Jun 2024 17:16:24 -0700 you wrote:
> Add BTF field (type and string fields, right now) iterator support instead of
> using existing callback-based approaches, which make it harder to understand
> and support BTF-processing code.
> 
> v1->v2:
>   - t_cnt -> t_off_cnt, m_cnt -> m_off_cnt (Eduard);
>   - simpified code in linker.c (Jiri);
> rfcv1->v1:
>   - check errors when initializing iterators (Jiri);
>   - split RFC patch into separate patches.
> 
> [...]

Here is the summary with links:
  - [v2,bpf-next,1/5] libbpf: add BTF field iterator
    https://git.kernel.org/bpf/bpf-next/c/68153bb2fffb
  - [v2,bpf-next,2/5] libbpf: make use of BTF field iterator in BPF linker code
    https://git.kernel.org/bpf/bpf-next/c/2bce2c1cb2f0
  - [v2,bpf-next,3/5] libbpf: make use of BTF field iterator in BTF handling code
    https://git.kernel.org/bpf/bpf-next/c/c2641123696b
  - [v2,bpf-next,4/5] bpftool: use BTF field iterator in btfgen
    https://git.kernel.org/bpf/bpf-next/c/e1a8630291fd
  - [v2,bpf-next,5/5] libbpf: remove callback-based type/string BTF field visitor helpers
    https://git.kernel.org/bpf/bpf-next/c/072088704433

You are awesome, thank you!