Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4685759imw; Tue, 12 Jul 2022 12:23:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ssNTb7hM7ZW1XX/md3XQ+Y/iRmbCuUOQYIUzz0Vco4p3MGh1MOCMzXMXJYibcJvAW4WXHX X-Received: by 2002:a17:90b:2384:b0:1ef:8506:374e with SMTP id mr4-20020a17090b238400b001ef8506374emr6082834pjb.99.1657653818053; Tue, 12 Jul 2022 12:23:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657653818; cv=none; d=google.com; s=arc-20160816; b=t08wgs+Op0bm3MYDpmdSyqnkEoo5erkqu5mNGK6GHQhQGvais8iK5U8aYX6z8gKGOQ ZZdbT+kzVg6dYwnPfds//Hx3LARB1/5AbolUlqR/aS0+GQUz6g1rGPD8trssnu2+EP7B 4XxRVXTau9jgOCG+wl6JFJeBmZgCC4AkfZ3vNgy+V/6eY1DOog60TxMCsfx00rVHlyQz +CP/SWoqrpGh0/goqu62AbNA+JGURlOBFwH/1c4teWuiqFWIvcv0KzAkl1tjIZ+Zr1tH mCAErgdCTh7TH4tGD8w+rDue5zXMurtdGdUQfptBD9qK6I0nRkxKvZuybbOSEeajCNtO kloQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=yODtK+pWFU5tp6GF0WS8ShyocW5RT9w0VzszRl7ckAE=; b=t0M6QJuMDwtFq+Fs5cB5hH69T/Jb94jFQoNdUuSivS5LN/BodE9SBwgl0iOrqInMZW 91aDSAdcT1RH8WDH7NgldfvOv/BFPcvmiS+wYKG2ApIDNSrsEEaqy9+5jGxemT9aEIpJ KwZqrQDG4d3/PYyE8MGR5uKU8D79wyp6HO01pbirCaiIFLMilND7CAy6RrJIGMBO+MR9 SKBc5lePn55D9m/33+sLxQB8HyQgjLh9HHKGv9w089g0igBPod9A+Ytz6T7YsVJR4Xqn l6z2jg5VUU8RlREGndxGNUIvjZ1pCyA8QBhJGCytFfPXyfrZKtaaRDXDQuiLHF31iWKp 9mEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b="eWWRt/mh"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id br7-20020a056a00440700b005255dd30819si13277621pfb.4.2022.07.12.12.23.25; Tue, 12 Jul 2022 12:23:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b="eWWRt/mh"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234203AbiGLSqO (ORCPT + 99 others); Tue, 12 Jul 2022 14:46:14 -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 X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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