]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: btf: export btf types and name by offset from lib
authorOkash Khawaja <osk@fb.com>
Sat, 14 Jul 2018 04:57:02 +0000 (21:57 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Sat, 14 Jul 2018 11:00:40 +0000 (13:00 +0200)
commit1d0cf6fbec8e106109b5db0d4fefe5123878b913
treef8890e7c3f08e4796dbeaa8e0592fc4394c3672d
parentab323ad15fc6e6ca269e0d55666c19c3835cc231
bpf: btf: export btf types and name by offset from lib

This patch introduces btf__resolve_type() function and exports two
existing functions from libbpf. btf__resolve_type follows modifier
types like const and typedef until it hits a type which actually takes
up memory, and then returns it. This function follows similar pattern
to btf__resolve_size but instead of computing size, it just returns
the type.

These  functions will be used in the followig patch which parses
information inside array of `struct btf_type *`. btf_name_by_offset is
used for printing variable names.

Signed-off-by: Okash Khawaja <osk@fb.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Song Liu <songliubraving@fb.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/lib/bpf/btf.c
tools/lib/bpf/btf.h