Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6186456rwr; Tue, 9 May 2023 11:25:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5JzuOUT2mrCcnyP8OZg3l+QB9DRM6bNZwOQZq7suuv3zbUhB8TqW1hL91ukvGTVQJ5oIAL X-Received: by 2002:a05:6a00:cd5:b0:646:f971:b179 with SMTP id b21-20020a056a000cd500b00646f971b179mr4652903pfv.16.1683656742113; Tue, 09 May 2023 11:25:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683656742; cv=none; d=google.com; s=arc-20160816; b=pjDZykykJYiIeCMaFrNHC+2mYcwSZhU4XV4rp28hu+oL30bHSf84ErvyH1Ify9iu4s lXDshy8eru4SFgapRhlEefUg2Ht/biEJwXrOEWa/uOOVu8ZFTuexyhd3m9t1VGwfNcB7 0MoxfVEoaVoo/EgdcndkU8AeG5Ew/uYMVl6xoXtDLBzYDHNYsvvvqc2wnjhSlPFZ/8OR xoAacvTSZXp8K0zPtjO/7s5Zh4hR6/NnqjgLY3BinsDgzR5tF1veSAnBTCMDjGVVzqNG 5AWNBlCfzejeuAM+7Jr4U8DnHDRoISvPP5piBrMD4UwgsGmINqoMR6rfPz7d6bN/pOHj IWFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1yvab2920PZOXFxLHZeazSBfY+8MlT2SlPyitdXEOmA=; b=Jpjm3dpz9yB3BWYpzGP8V05oqacQqjV82sEsozJlL6tSJqvfZnpLfhpWJmX9ktwQ+4 53tehFzYb25Msz3eDQQvVhiJMzG7DYuinWuA0Q7HlBuSXeEapwPnpKIqijXrd8FHqGco IcpUHMci/pU1eQ2LL9PNSF9k5Yqh+KlOQU0zlHBBp6q0ak7Bo4YVgj1Z8Nb47wTSWanp /mqCpliC0FfdBP4SY68QtYxftZEXROgibWWq9JSRQjRAWAkwm6tnOKnWZKjjkIu+2sfN R333M2906oBcs1TpU2MjZi8oYVz9szZXm812bjalmOIaKTlKvWRQ5KUV41KLvqRukHrp lBiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="BSPiyVS/"; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l185-20020a6391c2000000b0052c47df208dsi2150302pge.326.2023.05.09.11.25.27; Tue, 09 May 2023 11:25:42 -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=@kernel.org header.s=k20201202 header.b="BSPiyVS/"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234666AbjEISVx (ORCPT + 99 others); Tue, 9 May 2023 14:21:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234627AbjEISVr (ORCPT ); Tue, 9 May 2023 14:21:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AA365FEF; Tue, 9 May 2023 11:21:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0C9E9647A6; Tue, 9 May 2023 18:21:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B1E4C4339B; Tue, 9 May 2023 18:21:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683656492; bh=p9LFEEvugQN4++dg+fFPMCKLX5fbDpBS5vLiqTGWuAw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BSPiyVS/u4Dh6cFjjlZoWUokqgfgqlhpWfvp1WyYZZ9bX7gmUBIXRhylO7TtjeG2v Wq7JWpRd/tLwmfFjIhFexYdTJ70QbbQNt8jJYD2mGVXVRdXZYXXmx8AltjwOnMlCrC 7+MKYBGJx4KObTNwfbb74iiEnheGOwraTe/Ujj0bOFLOSUxA96yRLC3qarTMATE2+a zUXE+fpzF6lyp+u1bOOclxnGBtb7PNQCOBli/a76mestdMsokB+0VGZHKEm9mYEb7u 7OHywAhXmZ5Kr9a6bDBgsH1qPZNv9YN2SIbvMDYrL+Szi38uWvsiw2LHNBKqiw0L6j q/53SlojreDaw== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id E5A4F403B5; Tue, 9 May 2023 15:21:29 -0300 (-03) Date: Tue, 9 May 2023 15:21:29 -0300 From: Arnaldo Carvalho de Melo To: Yang Jihong Cc: peterz@infradead.org, mingo@redhat.com, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com, adrian.hunter@intel.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf bpf skels: vmlinux.h uses bpf.h and perf_event.h in the source directory Message-ID: References: <20230509063649.239942-1-yangjihong1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230509063649.239942-1-yangjihong1@huawei.com> X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Em Tue, May 09, 2023 at 06:36:49AM +0000, Yang Jihong escreveu: > 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; Can this be solved in the Makefile directives for building BPF targets? - Arnaldo > 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 > -- - Arnaldo