Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5356622rwr; Mon, 8 May 2023 23:39:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5XsPUFUmNQwAwGNjZKkR6Pw4YPF274NNBdA0mtcNa6Ti0kwBxJ0BOQrxTqahWOHokB3XVt X-Received: by 2002:a17:90a:502:b0:250:648b:781d with SMTP id h2-20020a17090a050200b00250648b781dmr9566948pjh.23.1683614381490; Mon, 08 May 2023 23:39:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683614381; cv=none; d=google.com; s=arc-20160816; b=XhMupquKKM1bIJQk5JFizCUWjSwAvn15t+WTpeQy5fZw/ZPN+eZRT/Axq9+Uz2yjor OTM8KZmXMq6yZszzG8CeVRKh6l1ViwkE6qLz6IreQbkBC0354juGJjGIOBUsb9wgPT8m TPDYvwp0rk75IaRxjM3YtPMqqhpBI6vkejuLIaoiuFdbhrsLtdQo5POanKdS9aoMZowQ LUF+ncft7Nt9vmz6PStIErj8DF2NWvZ6vIS+lhKvImyki2F6RVvWDO1Kl9MdkNSbnapL ZQc/ZsPD7flkCJHjve43Z0ncfrT9VSMGUb27ihqS1PkTe3miDIlQHIQRRrLBO1ZEln4k FdnQ== 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=qyjgBqbcq3l/YIyR2DEulE02txdrzwgIKZerZcp1kII=; b=UbDc3SJcjo85miyaI33Ae8XMz0tEAENss8pBrX9WEXZqOFqfL8eKEK3D5yyrc5Aob0 0GmV0S5GY2ufDgpVeMn5aBgOtf+RwAKSka8kQjbK1D43QdOXuEMOBNr+ZhsYPQbtdIvW tl/gdTK0EiMWMrwJIyQXXPeF7wpkJz3wCtVBdo+camFlTYrck5fTmrllxWf6KqHkoxAa 40bnJi9B8pGJXxMpY3GfK9uFf8VBc0d+e/JDd8j2n56ueZ+96v8TOR12DNkJgC3XAcAe Lz3vT3DKgu8tQMLYyrot2aXFq5TwEf3X7cyXcA9wez9X3lT8ymrhPsEDIZXBuA6l8Xkc BN3Q== 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 lw1-20020a17090b180100b0024b60d77608si26290793pjb.30.2023.05.08.23.39.23; Mon, 08 May 2023 23:39:41 -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 S234896AbjEIGiX (ORCPT + 99 others); Tue, 9 May 2023 02:38:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234897AbjEIGiV (ORCPT ); Tue, 9 May 2023 02:38:21 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A7BDAD25; Mon, 8 May 2023 23:38:19 -0700 (PDT) Received: from kwepemm600003.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4QFpLm0cZLzLpd7; Tue, 9 May 2023 14:35:28 +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; Tue, 9 May 2023 14:38:17 +0800 From: Yang Jihong To: , , , , , , , , , , CC: Subject: [PATCH] perf bpf skels: vmlinux.h uses bpf.h and perf_event.h in the source directory Date: Tue, 9 May 2023 06:36:49 +0000 Message-ID: <20230509063649.239942-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: dggems702-chm.china.huawei.com (10.3.19.179) 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, 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 --- tools/perf/util/bpf_skel/vmlinux.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/bpf_skel/vmlinux.h b/tools/perf/util/bpf_skel/vmlinux.h index 449b1ea91fc4..af79bcc4c4b7 100644 --- a/tools/perf/util/bpf_skel/vmlinux.h +++ b/tools/perf/util/bpf_skel/vmlinux.h @@ -1,11 +1,13 @@ #ifndef __VMLINUX_H #define __VMLINUX_H -#include #include -#include #include +// Use header files in source directory to avoid compilation compatibility problems. +#include "../../../include/uapi/linux/perf_event.h" +#include "../../../include/uapi/linux/bpf.h" + // non-UAPI kernel data structures, used in the .bpf.c BPF tool component. // Just the fields used in these tools preserving the access index so that -- 2.30.GIT