bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/3] Add generic and raw BTF parsing APIs to libbpf
@ 2020-08-02  1:32 Andrii Nakryiko
  2020-08-02  1:32 ` [PATCH bpf-next 1/3] libbpf: add btf__parse_raw() and generic btf__parse() APIs Andrii Nakryiko
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Andrii Nakryiko @ 2020-08-02  1:32 UTC (permalink / raw)
  To: bpf, netdev, ast, daniel; +Cc: andrii.nakryiko, kernel-team, Andrii Nakryiko

It's pretty common for applications to want to parse raw (binary) BTF data
from file, as opposed to parsing it from ELF sections. It's also pretty common
for tools to not care whether given file is ELF or raw BTF format. This patch
series exposes internal raw BTF parsing API and adds generic variant of BTF
parsing, which will efficiently determine the format of a given fail and will
parse BTF appropriately.

Patches #2 and #3 removes re-implementations of such APIs from bpftool and
resolve_btfids tools.

Andrii Nakryiko (3):
  libbpf: add btf__parse_raw() and generic btf__parse() APIs
  tools/bpftool: use libbpf's btf__parse() API for parsing BTF from file
  tools/resolve_btfids: use libbpf's btf__parse() API

 tools/bpf/bpftool/btf.c             |  54 +------------
 tools/bpf/resolve_btfids/.gitignore |   4 +
 tools/bpf/resolve_btfids/main.c     |  58 +-------------
 tools/lib/bpf/btf.c                 | 114 +++++++++++++++++++---------
 tools/lib/bpf/btf.h                 |   5 +-
 tools/lib/bpf/libbpf.map            |   2 +
 6 files changed, 89 insertions(+), 148 deletions(-)
 create mode 100644 tools/bpf/resolve_btfids/.gitignore

-- 
2.24.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-08-06 18:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-02  1:32 [PATCH bpf-next 0/3] Add generic and raw BTF parsing APIs to libbpf Andrii Nakryiko
2020-08-02  1:32 ` [PATCH bpf-next 1/3] libbpf: add btf__parse_raw() and generic btf__parse() APIs Andrii Nakryiko
2020-08-02  1:32 ` [PATCH bpf-next 2/3] tools/bpftool: use libbpf's btf__parse() API for parsing BTF from file Andrii Nakryiko
2020-08-02  1:32 ` [PATCH bpf-next 3/3] tools/resolve_btfids: use libbpf's btf__parse() API Andrii Nakryiko
2020-08-03 14:45 ` [PATCH bpf-next 0/3] Add generic and raw BTF parsing APIs to libbpf Daniel Borkmann
2020-08-06 17:39 ` Arnaldo Carvalho de Melo
2020-08-06 17:49   ` Andrii Nakryiko
2020-08-06 18:01     ` Alexei Starovoitov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).