On Mon, Jun 5, 2023 at 1:58 AM Yang Bo <yyyeer.bo@xxxxxxxxx> wrote: > > From: Yang Bo <bo@xxxxxxxx> > > implement function. > refactor code. > > Signed-off-by: Yang Bo <bo@xxxxxxxx> > --- There is no need for libbpf to add new APIs for this. First, BPF skeleton is the preferred and natural way to work with BPF global variables. Second, if you don't want to use BPF skeleton, you can find all this information in BTF directly by using bpf_object__btf() + bpf_map__btf_value_type_id() APIs. > tools/lib/bpf/bpf.c | 808 +++++++++++++++++++++++++++++++++++++++ > tools/lib/bpf/bpf.h | 9 + > tools/lib/bpf/libbpf.map | 2 + > 3 files changed, 819 insertions(+) > [...]