[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220712184225.52429-1-flaniel@linux.microsoft.com>
Date: Tue, 12 Jul 2022 20:42:24 +0200
From: Francis Laniel <flaniel@...ux.microsoft.com>
To: bpf@...r.kernel.org
Cc: Francis Laniel <flaniel@...ux.microsoft.com>,
Quentin Monnet <quentin@...valent.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
Martin KaFai Lau <martin.lau@...ux.dev>,
Song Liu <song@...nel.org>, Yonghong Song <yhs@...com>,
John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>,
Stanislav Fomichev <sdf@...gle.com>,
Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
linux-kernel@...r.kernel.org (open list)
Subject: [RFC PATCH v1 0/1] bpftool: Add generating command to C dumped file.
Hi.
First, I hope you are fine and the same for your relatives.
In this patch, I added the command used to generate a BTF dump at the top of the
dump when outputting to C:
/*
* File generated by bpftool using:
* bpftool btf dump file /sys/kernel/btf/vmlinux format c
* DO NOT EDIT.
*/
The goal of this is to first warn users this file must not be edited and also
to document the command used to get it.
The idea was gathered from a message posted on iovisor/bcc repository and from
message written by bpf2go when it generates a file [1, 2].
This patch is clearly not a big change which impacts the future of bpftool but
I think it could be welcomed.
If you see any way to improve it or have any question, feel free to ask.
Francis Laniel (1):
bpftool: Add generating command to dumped file.
tools/bpf/bpftool/btf.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
Best regards and thank you in advance.
---
[1] https://github.com/iovisor/bcc/pull/4088#pullrequestreview-1032543916
[2] https://github.com/cilium/ebpf/blob/951bb28908d23e50fca063a2d51098ca028352bf/cmd/bpf2go/output.go#L21
--
2.25.1
Powered by blists - more mailing lists