Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7484673rwr; Wed, 10 May 2023 08:47:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ZENKMISXD3NxUUxwTfzk6fQR1o94d0pLJPyqGI/8acRfwmjJJPHn8Y93p3Fvwhe8MA2Mi X-Received: by 2002:a05:6a00:88f:b0:648:24c1:fe5a with SMTP id q15-20020a056a00088f00b0064824c1fe5amr4092241pfj.16.1683733635558; Wed, 10 May 2023 08:47:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683733635; cv=none; d=google.com; s=arc-20160816; b=pPzhc6/fg+okgUawAuCM+nwZK9VtbLZ8CTM0aFaQlYxd1ocRERtOkpQszyJal+1V+n 3h0jvnXFOh5y/QpHA7xyp/jUekegs5R/m9Fd+6TuuX1tzuh1oHgJKLRGx3oer8DpSakR upy8aVTdnMt4E8BiKGN5rk24pXEKemvZzLUQx+c7l36C+xvRO2rdDIeLGQUCWNAYwWuf 2xD9JAQdVH+yb5HW1AaYdBaEuTChttbLz57I1vsWuSh7IQ11d5t0f0slX1m4P5ewKyS5 6k37xFiI+3VywZWwTwKs39msu0bQRGIPFu9ufyjDSxiu3HQNuvKxo0aagWnY0JXGARHL r7pw== 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=FlS8e82tA+4UbAgf7L17Ur3cwdcK3uK43JSnKTsHi3c=; b=SF6NZqn86ESzgx/4nriEUYZZ07Y2xn8dis2CRFaJ08SU0iyS/VN43svCotS4eOin8K 2+G5I7J1amh7HmXN+mX/CEAmevh0LSCse3c6dL6yPnQaWz418eaxTSGrdd21bY8NzxFG XLPLSJ5J4u1DjDR9Fh9cWTwxptW5O5KlXwZBQ9T9faJYooPqnzfZs62j4l1YT9rBmfl5 T6TxgBo26SO4Bfc1apAn96eOKGjTm90zqmX+/IZHUHqGoBMBNBsw7G/1EWr/LiT7zIXr OId4LMo2AjISMqay+WfCmazrB0NgVLM6bok94E9Y0rOwcTKcTI43q4nh9MGZOGNEirll z2tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ad9KCxfE; 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 4-20020a620504000000b00645edbb3911si5026881pff.281.2023.05.10.08.46.58; Wed, 10 May 2023 08:47:15 -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=Ad9KCxfE; 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 S237448AbjEJPkp (ORCPT + 99 others); Wed, 10 May 2023 11:40:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232912AbjEJPkn (ORCPT ); Wed, 10 May 2023 11:40:43 -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 463BA19B4; Wed, 10 May 2023 08:40:42 -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 CEF2B6349F; Wed, 10 May 2023 15:40:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07336C433EF; Wed, 10 May 2023 15:40:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683733241; bh=suHZgHXOnhG+Y0EFAZh64AmTpplHYWDqeWTt0Ihyy88=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ad9KCxfE8ESkuSqBrrG4ePhVwIU5ALLDNXUNIFoD23t9ppM3dDkA7kwy61c1cCP3Y 8uT6T0wlcWGQ6lDHqdgsOf1DwmGh4efj+/HdG1C0pZNCY72nsE2HPiryeFQflUqg1T t1O45+r0sbGFWXH7sQHtQ5VbX6zLNilU2zhv+lPEPX82CWfY/1zHTk02sMdUz1pyEa uG/SOPDA6K1LcAcI1WL+OOK9jumodP9d9I+fVSSdUEjwgRXkzbfl3eaF6pqYjzogX1 IanWFsuOLhkiIG0cxM8XW5fwgshQagvaOm5VySGZtBiYAFb8XVl4x7TVAZFrE3PEiQ K8U7kwGkn5uig== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 4692C403B5; Wed, 10 May 2023 12:40:38 -0300 (-03) Date: Wed, 10 May 2023 12:40:38 -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, nathan@kernel.org, ndesaulniers@google.com, trix@redhat.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] perf bpf skels: Make vmlinux.h use bpf.h and perf_event.h in source directory Message-ID: References: <20230510064401.225051-1-yangjihong1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230510064401.225051-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 Wed, May 10, 2023 at 06:44:01AM +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; > > Use the bpf.h and perf_event.h files in the source code directory to > avoid compilation compatibility problems. Applied, will test it in my build containers. - Arnaldo > 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 > -- - Arnaldo