From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50D87C433EF for ; Tue, 12 Jul 2022 18:46:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234341AbiGLSqQ (ORCPT ); Tue, 12 Jul 2022 14:46:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233797AbiGLSpi (ORCPT ); Tue, 12 Jul 2022 14:45:38 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AA9B1DB2EF; Tue, 12 Jul 2022 11:42:37 -0700 (PDT) Received: from pwmachine.numericable.fr (240.119.92.79.rev.sfr.net [79.92.119.240]) by linux.microsoft.com (Postfix) with ESMTPSA id 6F4EA204DE80; Tue, 12 Jul 2022 11:42:34 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 6F4EA204DE80 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1657651357; bh=yODtK+pWFU5tp6GF0WS8ShyocW5RT9w0VzszRl7ckAE=; h=From:To:Cc:Subject:Date:From; b=eWWRt/mhYU89qS8WtfgxLuxkSJX85zY/lrwIuPFEguOdBjjTUTf2WT6BpKUfWweNR zU0XKO6K4vndpeqRboYyF54XgCnAJuSD0ABUrOgmxyR0J5Y64vl4Ussb314BGkZwHE 43Tto3Dj3u4mKL3f2lwyqqeNxmeBMY01GARWG8DE= From: Francis Laniel To: bpf@vger.kernel.org Cc: Francis Laniel , Quentin Monnet , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , linux-kernel@vger.kernel.org (open list) Subject: [RFC PATCH v1 0/1] bpftool: Add generating command to C dumped file. Date: Tue, 12 Jul 2022 20:42:24 +0200 Message-Id: <20220712184225.52429-1-flaniel@linux.microsoft.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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