OSDN Git Service

bpftool: Allow to read btf as raw data
authorJiri Olsa <jolsa@kernel.org>
Thu, 24 Oct 2019 13:30:25 +0000 (15:30 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 25 Oct 2019 21:34:47 +0000 (23:34 +0200)
commita94364603610f341564351a0e130c4bbcaeddfa0
tree5ac57486a112f1541e608298a60c69478f597ee8
parent3820729160440158a014add69cc0d371061a96b2
bpftool: Allow to read btf as raw data

The bpftool interface stays the same, but now it's possible
to run it over BTF raw data, like:

  $ bpftool btf dump file /sys/kernel/btf/vmlinux
  [1] INT '(anon)' size=4 bits_offset=0 nr_bits=32 encoding=(none)
  [2] INT 'long unsigned int' size=8 bits_offset=0 nr_bits=64 encoding=(none)
  [3] CONST '(anon)' type_id=2

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Link: https://lore.kernel.org/bpf/20191024133025.10691-1-jolsa@kernel.org
tools/bpf/bpftool/btf.c