Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6862837rwr; Tue, 9 May 2023 23:53:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4yWh2tjKjjwq7V0uuWxbAvrxjsUFDWTKVuwLWu2y3tYk6Uv/Pq0XWZP9n6hfrTA+a9vPD/ X-Received: by 2002:a17:903:1103:b0:1ab:d89:5ef6 with SMTP id n3-20020a170903110300b001ab0d895ef6mr19893157plh.68.1683701592551; Tue, 09 May 2023 23:53:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683701592; cv=none; d=google.com; s=arc-20160816; b=hKQn94mnyqAAG0cEDvaokLJ846zRyf/MbY7X07wHzpL3OctL+5Td6kHiUR3lOb6O+q GkkL0QRe6P1SupY6UmT131Vv/SZ/sar9yZdk4QKHeQPFxGnz+5gMtezHTM8Pv/OUGOlG DQu4JFsIyGyLRPrIC4jp8hq6i414DkfXlYmdbjeE9a+5ot3zdud+VelOTQl0b2J5++su 6KdIVmfYcS0oiQwp8D3pbtOUYgn8Gfxx/WUTHomT3DlOVtVtmysyfL4FIJobI2rcKLg1 bo6cf9eS3EGUSlGAE0cD7lxtllgj6rnM4vihXOv+zBevITy3HUnh7ZxntNXp40RkcxFK HV4g== 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; bh=z7fJeKo2PvTNM5va1UrRJqn1FvgSMnXoASpUfko11bQ=; b=CApIuYOfrN8npq3v7YZRaTWYoATvdBW/2tUI3Pxph1h5L8BlLdW4lk6vZbrjRxQGGC bjbF+XdwFFZftz0xvopV7vfBrZ2mtztkciPLRc8jhPTxJzDBuClR7xes7HiKkM02urmq o1u4FKQaXXQQPJyrazZoJ8MLQnE+VHrIeCUm3jkjkdj1iOj0VWWskwtzDEGR3rM3cNed QbpQ+GTlFt1zd1+feuNJ2XowJKF8MXSjtn6lV4cprUUoNQwBe/Un/uNgJnqEJlQNqQ2O nRuh4kyCBJDifYbADs3tMAgYH84HNZRlEPaTqTU3BdLTvRUdM8xHpYnKJ0tcdNiRaUAW tQCw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id be6-20020a170902aa0600b001a1f3916f4bsi3185246plb.265.2023.05.09.23.53.00; Tue, 09 May 2023 23:53:12 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236038AbjEJGph (ORCPT + 99 others); Wed, 10 May 2023 02:45:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236016AbjEJGpf (ORCPT ); Wed, 10 May 2023 02:45:35 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 995C71B8; Tue, 9 May 2023 23:45:33 -0700 (PDT) Received: from kwepemm600003.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4QGQR43x1sz18LN2; Wed, 10 May 2023 14:41:20 +0800 (CST) Received: from localhost.localdomain (10.67.174.95) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 10 May 2023 14:45:30 +0800 From: Yang Jihong To: , , , , , , , , , , , , , CC: Subject: [PATCH v2] perf bpf skels: Make vmlinux.h use bpf.h and perf_event.h in source directory Date: Wed, 10 May 2023 06:44:01 +0000 Message-ID: <20230510064401.225051-1-yangjihong1@huawei.com> X-Mailer: git-send-email 2.30.GIT MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.174.95] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Currently, vmlinux.h uses the bpf.h and perf_event.h header files in the system path. If the header files in compilation environment are old, compilation may fail. For example: /home/yangjihong/linux/tools/perf/util/bpf_skel/.tmp/../vmlinux.h:151:27: error: field has incomplete type 'union perf_sample_weight' union perf_sample_weight weight; Use the bpf.h and perf_event.h files in the source code directory to avoid compilation compatibility problems. Signed-off-by: Yang Jihong --- Changes since v1: - Use Makefile to specify that header files in tools/include/uapi directory are preferentially used. tools/perf/Makefile.perf | 3 ++- tools/perf/util/bpf_skel/vmlinux.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index a42a6a99c2bc..9b92749280b2 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -1058,13 +1058,14 @@ $(SKEL_TMP_OUT) $(LIBAPI_OUTPUT) $(LIBBPF_OUTPUT) $(LIBPERF_OUTPUT) $(LIBSUBCMD_ ifdef BUILD_BPF_SKEL BPFTOOL := $(SKEL_TMP_OUT)/bootstrap/bpftool BPF_INCLUDE := -I$(SKEL_TMP_OUT)/.. -I$(LIBBPF_INCLUDE) +TOOLS_UAPI_INCLUDE := -I$(srctree)/tools/include/uapi $(BPFTOOL): | $(SKEL_TMP_OUT) $(Q)CFLAGS= $(MAKE) -C ../bpf/bpftool \ OUTPUT=$(SKEL_TMP_OUT)/ bootstrap $(SKEL_TMP_OUT)/%.bpf.o: util/bpf_skel/%.bpf.c $(LIBBPF) | $(SKEL_TMP_OUT) - $(QUIET_CLANG)$(CLANG) -g -O2 -target bpf -Wall -Werror $(BPF_INCLUDE) \ + $(QUIET_CLANG)$(CLANG) -g -O2 -target bpf -Wall -Werror $(BPF_INCLUDE) $(TOOLS_UAPI_INCLUDE) \ -c $(filter util/bpf_skel/%.bpf.c,$^) -o $@ && $(LLVM_STRIP) -g $@ $(SKEL_OUT)/%.skel.h: $(SKEL_TMP_OUT)/%.bpf.o | $(BPFTOOL) diff --git a/tools/perf/util/bpf_skel/vmlinux.h b/tools/perf/util/bpf_skel/vmlinux.h index 449b1ea91fc4..c7ed51b0c1ef 100644 --- a/tools/perf/util/bpf_skel/vmlinux.h +++ b/tools/perf/util/bpf_skel/vmlinux.h @@ -1,6 +1,7 @@ #ifndef __VMLINUX_H #define __VMLINUX_H +#include // for define __always_inline #include #include #include -- 2.30.GIT