[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <69f99d56-4738-5e94-4bf5-73b60fe03312@fb.com>
Date: Fri, 25 Oct 2019 05:10:31 +0000
From: Andrii Nakryiko <andriin@...com>
To: Jiri Olsa <jolsa@...nel.org>, Alexei Starovoitov <ast@...nel.org>,
"Daniel Borkmann" <daniel@...earbox.net>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"bpf@...r.kernel.org" <bpf@...r.kernel.org>,
Yonghong Song <yhs@...com>, Martin Lau <kafai@...com>,
Jakub Kicinski <jakub.kicinski@...ronome.com>,
"andrii.nakryiko@...il.com" <andrii.nakryiko@...il.com>
Subject: Re: [PATCH] bpftool: Allow to read btf as raw data
On 10/24/19 6:30 AM, Jiri Olsa wrote:
> 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@...nel.org>
> ---
> v3 changes:
> - fix title
The subject (by now) should be "[PATCH v3 bpf-next] ...". Include both
version and intended tree (bpf-next usually).
>
> v2 changes:
> - added is_btf_raw to find out which btf__parse_* function to call
> - changed labels and error propagation in btf__parse_raw
> - drop the err initialization, which is not needed under this change
>
> tools/bpf/bpftool/btf.c | 57 ++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 56 insertions(+), 1 deletion(-)
>
Overall looks good. It's kind of sad that we re-open that file twice,
but we can optimize that later, if it ever is a problem. We should
probably eventually implement btf__parse_raw as libbpf API with mmap2().
But perfect is the enemy of the good, so:
Acked-by: Andrii Nakryiko <andriin@...com>
> diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c
> index 9a9376d1d3df..a7b8bf233cf5 100644
> --- a/tools/bpf/bpftool/btf.c
> +++ b/tools/bpf/bpftool/btf.c
> @@ -12,6 +12,9 @@
[...]
Powered by blists - more mailing lists