From nobody Wed Feb 11 12:08:30 2026 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 69C8BC7EE22 for ; Tue, 9 May 2023 06:38:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234904AbjEIGiY (ORCPT ); Tue, 9 May 2023 02:38:24 -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: quoted-printable 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 =20 -#include #include -#include #include =20 +// 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. =20 // Just the fields used in these tools preserving the access index so that --=20 2.30.GIT