From 351131b51c7a27daf0fbdce80b619b8d130374c6 Mon Sep 17 00:00:00 2001 From: Andrii Nakryiko Date: Fri, 24 May 2019 11:59:03 -0700 Subject: libbpf: add btf_dump API for BTF-to-C conversion BTF contains enough type information to allow generating valid compilable C header w/ correct layout of structs/unions and all the typedef/enum definitions. This patch adds a new "object" - btf_dump to facilitate dumping BTF as valid C. btf_dump__dump_type() is the main API which takes care of dumping out (through user-provided printf-like callback function) C definitions for given type ID and it's required dependencies. This allows for not just dumping out entirety of BTF types, but also selective filtering based on user-provided criterias w/ minimal set of dependent types. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov --- tools/lib/bpf/libbpf.map | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tools/lib/bpf/libbpf.map') diff --git a/tools/lib/bpf/libbpf.map b/tools/lib/bpf/libbpf.map index 6ea5ce19b9e0..8bf51d0a6072 100644 --- a/tools/lib/bpf/libbpf.map +++ b/tools/lib/bpf/libbpf.map @@ -167,5 +167,8 @@ LIBBPF_0.0.3 { LIBBPF_0.0.4 { global: + btf_dump__dump_type; + btf_dump__free; + btf_dump__new; btf__parse_elf; } LIBBPF_0.0.3; -- cgit v1.2.3-59-g8ed1b