Re: [RFC bpf-next 2/3] libbpf: bpf__find_by_name[_kind] should use btf__get_nr_types()

2020-11-13 Thread Andrii Nakryiko
On Fri, Nov 13, 2020 at 10:11 AM Alan Maguire wrote: > > When operating on split BTF, btf__find_by_name[_kind] will not > iterate over all types since they use btf->nr_types to show > the number of types to iterate over. For split BTF this is > the number of types _on top of base BTF_, so it

[RFC bpf-next 2/3] libbpf: bpf__find_by_name[_kind] should use btf__get_nr_types()

2020-11-13 Thread Alan Maguire
When operating on split BTF, btf__find_by_name[_kind] will not iterate over all types since they use btf->nr_types to show the number of types to iterate over. For split BTF this is the number of types _on top of base BTF_, so it will underestimate the number of types to iterate over, especially