From patchwork Wed Nov 16 07:22:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 20746 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a40e:b0:83:7221:86ba with SMTP id ck14csp252938dyb; Tue, 15 Nov 2022 23:29:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf4fPeXa52FWLP5JhbGB5svT5NbR12xWJdE77uLZmQW5JRx598MN3K250YF7JiG9F5JceyUS X-Received: by 2002:a63:881:0:b0:46e:c7be:16fc with SMTP id 123-20020a630881000000b0046ec7be16fcmr19037708pgi.462.1668583782428; Tue, 15 Nov 2022 23:29:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668583782; cv=none; d=google.com; s=arc-20160816; b=YcFZzU/yMJyuFKoBGdUDS3yoNI0y4HzOfhJPXAzzzPylnLNGZhC/hr/CIDYcXlEPle AASjAEqKpGdAqL5/9QLPF8Ju08Ce1uFmYtdZGJ1PJmBNDtG5tUo1Cm9f+u3mMgbu+oE6 T/t9UIK2T4/SJTR1AJrBdbTyc+Ca1fgfUn8SfsgS5BUJrdEfpS/VoqYnAK3Twx5c9DV8 bZThvZLfjqe2bXPlqe5Uaj3KPbsAXhEgx+jXMvuI2VYE/VqRxF175djDAoqSJO1KqXCp OPVzhfuZqJU340x68j3wT/g7N6a74AKLBUelvBKc1HsmjkUsXAzUQjPl3c3w8DeUNEas N8wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=NO6Jy27duk4navDIf91BiAlCfPwecqqBj66fQCAI5+k=; b=rG5y1KW+n4pVeNnmORL5OEZxKvCmgKpnmzy115Cq59hqSf5w+3OwVc7peynk6Xk2X9 HFi9TMK45ClXiGYff30RKajaCS5lBkWAcmHnRLCVn7s+T+U+1gp2jOz9I9kGxSqH7tDs DcxXOv1Ju1NDrAamH0W+YMhCW5nujuwHMfgHkgzEzrGDoEI+n0azfVtt3vG8ycTC/OkF K2K/XdJkqfxo9LffO/nT4ojJxZROzW6wTur6Hyma8xEPIOdQ7GEBSUhjPRFHthxxmEiG 46aB1Q0ZprYWSzkIiqaF2PLXq/i+fNa2TIOdkAtv07eCu3JfehUOrjaw+6hYMwnV9EPk 4Hew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Pr7mjdcY; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w15-20020a17090aea0f00b00213959f5a91si1287640pjy.2.2022.11.15.23.29.29; Tue, 15 Nov 2022 23:29:42 -0800 (PST) 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=@google.com header.s=20210112 header.b=Pr7mjdcY; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231801AbiKPHWV (ORCPT + 99 others); Wed, 16 Nov 2022 02:22:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231183AbiKPHWS (ORCPT ); Wed, 16 Nov 2022 02:22:18 -0500 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CCBBA193 for ; Tue, 15 Nov 2022 23:22:18 -0800 (PST) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-36810cfa61fso154636587b3.6 for ; Tue, 15 Nov 2022 23:22:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=NO6Jy27duk4navDIf91BiAlCfPwecqqBj66fQCAI5+k=; b=Pr7mjdcYb4qAEw3uOgulSRygcajgBXTmQtAjMOaT4ntJSmqQPXKpb2/w3lKfSLncYU iJB3rB6o6rbI5+Ulkzx5Vle1i67dxwFL9s45ZSE+3wwN4PQCTR8uR59jgQdpzQtvX3ln 9CeyrdspkbVCWBDKJySYuge6+beWXNM61UM6BnQtSL8y7boc8j/X58P071TDKAGD3pJ7 esUo7Cudp+Jg4L72D+3gQ2eeI/UxkEUfSkPmPJU7Jvh3zTG1+mlSvI7jspnqocGA/hSZ TYbBphk5VzKjXeQHjL4fvvRAr0aVHQAi8WtOY8wpCklTel+uGRpCJI5S7ZLhekCsnQ56 HteA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NO6Jy27duk4navDIf91BiAlCfPwecqqBj66fQCAI5+k=; b=AcVbWuoV/t3/2ZBsPIqL8VABi0XIAIadkr47cAGLdL7nYxn9KonF3PPipsK7jxmd60 QnRCJ1utlDvrnqZlnWJor1ABrigS9tWmGFb6/DlNdKugp21pZlyq9bO6ysf2pRux0E+5 lZxb/BzFS+cWhwxAjuv5ehneObmd1e0EofNwfERcA+vTteiTQ75n9s1/a4Ld9UujLYbV J5gJdB40P6sGIFitPY2ZYIfGfEcQrp8T3uc/F2tzlu3H8zPFo2/I31C9dE8X4czei0mG RVy8Oui8WtSriBcV4YCD+A4R7iE9OYtRTtb7Q6nNAasM38yDP8aZn4kfA8elqjGfRv7n OjNA== X-Gm-Message-State: ANoB5pnb+SsniBm2T/cerRtu8zsaTixwn50b1bDGTMmoGJH+3p4s+Tu1 GbxyK3YZiIdYAtE9ZanJjUD63v1fSZ+P X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:bf0f:58f3:342e:c1ec]) (user=irogers job=sendgmr) by 2002:a25:2fd6:0:b0:6bc:738d:65c9 with SMTP id v205-20020a252fd6000000b006bc738d65c9mr18993829ybv.521.1668583337411; Tue, 15 Nov 2022 23:22:17 -0800 (PST) Date: Tue, 15 Nov 2022 23:22:11 -0800 In-Reply-To: <20221116072211.2837834-1-irogers@google.com> Message-Id: <20221116072211.2837834-2-irogers@google.com> Mime-Version: 1.0 References: <20221116072211.2837834-1-irogers@google.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Subject: [PATCH 1/1] perf build: Use tools/lib headers from install path From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Masahiro Yamada , Nicolas Schier , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, bpf@vger.kernel.org, Nick Desaulniers , Andrii Nakryiko Cc: Stephane Eranian , Ian Rogers , Arnaldo Carvalho de Melo X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749636908301329081?= X-GMAIL-MSGID: =?utf-8?q?1749636908301329081?= Switch -I from tools/lib to the install path for the tools/lib libraries. Add the include_headers build targets to prepare target, as well as pmu-events.c compilation that dependes on libperf. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Andrii Nakryiko Cc: Jiri Olsa Cc: Mark Rutland Cc: Masahiro Yamada Cc: Nick Desaulniers Cc: Nicolas Schier Cc: Peter Zijlstra Cc: Stephane Eranian Cc: bpf@vger.kernel.org Link: http://lore.kernel.org/lkml/20221109184914.1357295-15-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/Makefile.config | 2 -- tools/perf/Makefile.perf | 14 +++++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index a7f6c0669fae..9cc3c48f3288 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -349,7 +349,6 @@ ifeq ($(DEBUG),0) endif endif -INC_FLAGS += -I$(srctree)/tools/lib/perf/include INC_FLAGS += -I$(src-perf)/util/include INC_FLAGS += -I$(src-perf)/arch/$(SRCARCH)/include INC_FLAGS += -I$(srctree)/tools/include/ @@ -367,7 +366,6 @@ endif INC_FLAGS += -I$(src-perf)/util INC_FLAGS += -I$(src-perf) -INC_FLAGS += -I$(srctree)/tools/lib/ CORE_CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 6c1a2a3ccc38..dd096aba4430 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -305,6 +305,7 @@ LIBTRACEEVENT_INCLUDE = $(LIBTRACEEVENT_DESTDIR)/include LIBTRACEEVENT = $(LIBTRACEEVENT_OUTPUT)/libtraceevent.a export LIBTRACEEVENT LIBTRACEEVENT_DYNAMIC_LIST = $(LIBTRACEEVENT_PLUGINS_OUTPUT)/libtraceevent-dynamic-list +CFLAGS += -I$(LIBTRACEEVENT_OUTPUT)/include # # The static build has no dynsym table, so this does not work for @@ -322,6 +323,7 @@ LIBAPI_DESTDIR = $(LIBAPI_OUTPUT) LIBAPI_INCLUDE = $(LIBAPI_DESTDIR)/include LIBAPI = $(LIBAPI_OUTPUT)/libapi.a export LIBAPI +CFLAGS += -I$(LIBAPI_OUTPUT)/include ifneq ($(OUTPUT),) LIBBPF_OUTPUT = $(abspath $(OUTPUT))/libbpf @@ -331,6 +333,7 @@ endif LIBBPF_DESTDIR = $(LIBBPF_OUTPUT) LIBBPF_INCLUDE = $(LIBBPF_DESTDIR)/include LIBBPF = $(LIBBPF_OUTPUT)/libbpf.a +CFLAGS += -I$(LIBBPF_OUTPUT)/include ifneq ($(OUTPUT),) LIBSUBCMD_OUTPUT = $(abspath $(OUTPUT))/libsubcmd @@ -340,6 +343,7 @@ endif LIBSUBCMD_DESTDIR = $(LIBSUBCMD_OUTPUT) LIBSUBCMD_INCLUDE = $(LIBSUBCMD_DESTDIR)/include LIBSUBCMD = $(LIBSUBCMD_OUTPUT)/libsubcmd.a +CFLAGS += -I$(LIBSUBCMD_OUTPUT)/include ifneq ($(OUTPUT),) LIBSYMBOL_OUTPUT = $(abspath $(OUTPUT))/libsymbol @@ -349,6 +353,7 @@ endif LIBSYMBOL_DESTDIR = $(LIBSYMBOL_OUTPUT) LIBSYMBOL_INCLUDE = $(LIBSYMBOL_DESTDIR)/include LIBSYMBOL = $(LIBSYMBOL_OUTPUT)/libsymbol.a +CFLAGS += -I$(LIBSYMBOL_OUTPUT)/include ifneq ($(OUTPUT),) LIBPERF_OUTPUT = $(abspath $(OUTPUT))/libperf @@ -359,6 +364,7 @@ LIBPERF_DESTDIR = $(LIBPERF_OUTPUT) LIBPERF_INCLUDE = $(LIBPERF_DESTDIR)/include LIBPERF = $(LIBPERF_OUTPUT)/libperf.a export LIBPERF +CFLAGS += -I$(LIBPERF_OUTPUT)/include # python extension build directories PYTHON_EXTBUILD := $(OUTPUT)python_ext_build/ @@ -691,7 +697,7 @@ build := -f $(srctree)/tools/build/Makefile.build dir=. obj $(PERF_IN): prepare FORCE $(Q)$(MAKE) $(build)=perf -$(PMU_EVENTS_IN): FORCE +$(PMU_EVENTS_IN): FORCE prepare $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=pmu-events obj=pmu-events $(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBTRACEEVENT_DYNAMIC_LIST) @@ -774,6 +780,12 @@ prepare: $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h archheaders $(drm_ioc $(rename_flags_array) \ $(arch_errno_name_array) \ $(sync_file_range_arrays) \ + $(LIBAPI) \ + $(LIBBPF) \ + $(LIBPERF) \ + $(LIBSUBCMD) \ + $(LIBSYMBOL) \ + $(LIBTRACEEVENT) \ bpf-skel $(OUTPUT)%.o: %.c prepare FORCE