mbox series

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

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

Message

Andrii Nakryiko June 3, 2024, 11:17 p.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.

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          |  60 +++---
 4 files changed, 264 insertions(+), 166 deletions(-)

Comments

Eduard Zingerman June 4, 2024, 8:56 p.m. UTC | #1
On Mon, 2024-06-03 at 16:17 -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.
> 
> 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

All looks good, thank you.

Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Alan Maguire June 5, 2024, 10:11 a.m. UTC | #2
On 04/06/2024 21:56, Eduard Zingerman wrote:
> On Mon, 2024-06-03 at 16:17 -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.
>>
>> 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
> 
> All looks good, thank you.
> 
> Acked-by: Eduard Zingerman <eddyz87@gmail.com>

looks great to me too; I tested and put together a selftest of field
iteration across all BTF kinds which I'll send out after this lands;
all tests pass as expected and for all kinds we see the expected strings
and ids.

For the series,

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