diff options
author | Andrii Nakryiko <andriin@fb.com> | 2019-05-24 11:59:03 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-05-24 14:05:58 -0700 |
commit | 351131b51c7a27daf0fbdce80b619b8d130374c6 (patch) | |
tree | a6dc197b7f4fa83f8b8b83b6c19460a79a0feea4 /tools/lib/bpf/Build | |
parent | 2fc3fc0bcdcc5429947d1e5ed8f6f0a77ba80997 (diff) | |
download | linux-351131b51c7a27daf0fbdce80b619b8d130374c6.tar.bz2 |
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 <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/lib/bpf/Build')
-rw-r--r-- | tools/lib/bpf/Build | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/lib/bpf/Build b/tools/lib/bpf/Build index dcf0d36598e0..e3962cfbc9a6 100644 --- a/tools/lib/bpf/Build +++ b/tools/lib/bpf/Build @@ -1 +1,3 @@ -libbpf-y := libbpf.o bpf.o nlattr.o btf.o libbpf_errno.o str_error.o netlink.o bpf_prog_linfo.o libbpf_probes.o xsk.o hashmap.o +libbpf-y := libbpf.o bpf.o nlattr.o btf.o libbpf_errno.o str_error.o \ + netlink.o bpf_prog_linfo.o libbpf_probes.o xsk.o hashmap.o \ + btf_dump.o |