From patchwork Tue Nov 8 07:35:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 16901 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2544398wru; Mon, 7 Nov 2022 23:37:50 -0800 (PST) X-Google-Smtp-Source: AMsMyM75RBT+PoP2qNh9Wxclawk/pNjFLfKhQTRbqgv3U1d3zVzcwEIo3UVIIIMd1gQkY9xY9Q+a X-Received: by 2002:a17:902:7849:b0:186:68b9:e1ae with SMTP id e9-20020a170902784900b0018668b9e1aemr54568360pln.139.1667893070060; Mon, 07 Nov 2022 23:37:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667893070; cv=none; d=google.com; s=arc-20160816; b=LtF9nu7sGkDk1qPhaa3bhrb5diLOG4tZ9uAUi0rRnvqgFCIaTK+l4ONxeCxOcFZFHl FL/53KYzbhJDz9Dlo2Jr60MkQNy8DvALkdlmxZEvnqyeiHOcHcddb95T5+lZAR1WMxEK tHnNz0tcU+TSYnV/v0f9/Pdldbs8d1lH01y+VcpmfCni6JiGDpy5wlpBZl7wxesth/A2 2Tjbr5VpylFWlLWMkvzY6q10DTWQ/2YDcN1CXHIVE2e61cMkdncVA3L2vNIAiqsxOeto 3AJkjXF+nD65PeJQO9cfMua5I9GwANCm1f0rmOhmb+PQjQ0bBnUdZmy92mJUZytmCyzk YM/w== 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=rOWTS1f0segyhlSbmQWDTAnD8D0Og1YhYgrPvc18rTU=; b=TyrArFSzVPdNenRl3aacqH4mz7oM7eIwfjs3fURc+SAVIrdC3HTB9/2ESKvYRQqeIS dAyYi0gTr9qR5CfBBv6AUAc7p9WeTANs3mECMQgCeMFYgUGvDytV2s9+fPY4itYCxq6s XSFHkmg02Ei+/1Md6pGItP5qA0L4X3cXkJet+w+tGchbvrKAEBOSPha4R6cDff+ahF9m AAH9F/Ct/mOnOQ5vhbzNMUlo6iUjgbjRcaVUtH3OnpIIyBexmQ6S7gl9voYdBkz+NRnp N4nOZyMFhOmuB6Gw/37Zjcz+MDyg5649i1h6s5yTDEFoFA4wPH4hkjgDTTwRM0larVKk OTAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=EmO+WsH8; 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 z196-20020a6333cd000000b004227041e9d2si13879803pgz.405.2022.11.07.23.37.36; Mon, 07 Nov 2022 23:37:50 -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=EmO+WsH8; 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 S233482AbiKHHfn (ORCPT + 99 others); Tue, 8 Nov 2022 02:35:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233452AbiKHHfi (ORCPT ); Tue, 8 Nov 2022 02:35:38 -0500 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FCDA183BB for ; Mon, 7 Nov 2022 23:35:37 -0800 (PST) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-368036d93abso129908617b3.18 for ; Mon, 07 Nov 2022 23:35:37 -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=rOWTS1f0segyhlSbmQWDTAnD8D0Og1YhYgrPvc18rTU=; b=EmO+WsH8dN6GDO6/5h7GCdX/Cnv9NhRf6EYSqpe4AqmNS2cH2SGTPbKtl6G7yQjMAz CwnXS6hLmcL64RHhKL4RTxmTGjPO+Kkvjgsj+uoBkr1/5rDfcdZtlSB+/eq0kuXDIaWc dCfNfHNVqf5PoEK+/GtMHiSjIPbLSPIE/PWCKmc2ikni/UHY4xXbhZR6in0lwhf3LVi3 3ovYrwdURdQKrKJtYn0r7TO6abLkNaf9kll6D0w5PKsLerjX9mioksy5T102jb4GTJ0b UcNeWv0Nn7M91jk4hEFODz2prIJIrQoZvPF9JB83knRIcNQX0tDHnH8VEcYnrWmOfx4Z Ohtw== 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=rOWTS1f0segyhlSbmQWDTAnD8D0Og1YhYgrPvc18rTU=; b=P/8b1v8WrrPBk3vDagtv6/6P0zRJv1vQPAB5fmnszFjZrxYltRTJ7OZRsILHvBGQWD De2pAP3rr40i+4tk2QsI03zbhurk080CFR+gFVZmGBHW0/56l3cSidZRG3HOY8KrF91k BYmKj3+oWmq4oCMQ40oSE10olE6JHRp/hmRZ1r80Le/zH9n97D/ncoiX/N+QgWXDMtiZ 8P+0JjqM061ZHcuHMUpNcKwuJS2E5EZKjPWEESFo6dcKfA9E9w4hvdnybpYPd8tKpd24 7n2FCjgQcSSxwvfD1rQn92mAUCv2k+kUBpE1qcy9GW261mE8peDrWz4eWN82rNKvBgLm 4fhA== X-Gm-Message-State: ACrzQf0UZquNageO0cjxFOr/KvS862UZuxbEiRHpJzNKaJJOZynjKZ2y 6UcHxVrPVu7B68wT/6cfmRgv4BF1LwU9 X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:a697:9013:186f:ed07]) (user=irogers job=sendgmr) by 2002:a5b:792:0:b0:6bd:2b3:a4de with SMTP id b18-20020a5b0792000000b006bd02b3a4demr879898ybq.123.1667892937391; Mon, 07 Nov 2022 23:35:37 -0800 (PST) Date: Mon, 7 Nov 2022 23:35:05 -0800 In-Reply-To: <20221108073518.1154450-1-irogers@google.com> Message-Id: <20221108073518.1154450-2-irogers@google.com> Mime-Version: 1.0 References: <20221108073518.1154450-1-irogers@google.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Subject: [PATCH v1 01/14] tools lib api: Add install target 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 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?1748912643827680057?= X-GMAIL-MSGID: =?utf-8?q?1748912643827680057?= This allows libapi to be installed as a dependency. Signed-off-by: Ian Rogers --- tools/lib/api/Makefile | 49 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/tools/lib/api/Makefile b/tools/lib/api/Makefile index e21e1b40b525..6629d0fd0130 100644 --- a/tools/lib/api/Makefile +++ b/tools/lib/api/Makefile @@ -15,6 +15,16 @@ LD ?= $(CROSS_COMPILE)ld MAKEFLAGS += --no-print-directory +INSTALL = install + + +# Use DESTDIR for installing into a different root directory. +# This is useful for building a package. The program will be +# installed in this directory as if it was the root directory. +# Then the build tool can move it later. +DESTDIR ?= +DESTDIR_SQ = '$(subst ','\'',$(DESTDIR))' + LIBFILE = $(OUTPUT)libapi.a CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) @@ -45,10 +55,23 @@ RM = rm -f API_IN := $(OUTPUT)libapi-in.o +ifeq ($(LP64), 1) + libdir_relative = lib64 +else + libdir_relative = lib +endif + +prefix ?= +libdir = $(prefix)/$(libdir_relative) + +# Shell quotes +libdir_SQ = $(subst ','\'',$(libdir)) + all: export srctree OUTPUT CC LD CFLAGS V include $(srctree)/tools/build/Makefile.include +include $(srctree)/tools/scripts/Makefile.include all: fixdep $(LIBFILE) @@ -58,6 +81,32 @@ $(API_IN): FORCE $(LIBFILE): $(API_IN) $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(API_IN) +define do_install_mkdir + if [ ! -d '$(DESTDIR_SQ)$1' ]; then \ + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$1'; \ + fi +endef + +define do_install + if [ ! -d '$(DESTDIR_SQ)$2' ]; then \ + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$2'; \ + fi; \ + $(INSTALL) $1 $(if $3,-m $3,) '$(DESTDIR_SQ)$2' +endef + +install_lib: $(LIBFILE) + $(call QUIET_INSTALL, $(LIBFILE)) \ + $(call do_install_mkdir,$(libdir_SQ)); \ + cp -fpR $(LIBFILE) $(DESTDIR)$(libdir_SQ) + +install_headers: + $(call QUIET_INSTALL, headers) \ + $(call do_install,cpu.h,$(prefix)/include/api,644); \ + $(call do_install,debug.h,$(prefix)/include/api,644); \ + $(call do_install,io.h,$(prefix)/include/api,644); + +install: install_lib install_headers + clean: $(call QUIET_CLEAN, libapi) $(RM) $(LIBFILE); \ find $(or $(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM) From patchwork Tue Nov 8 07:35:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 16906 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2544848wru; Mon, 7 Nov 2022 23:39:02 -0800 (PST) X-Google-Smtp-Source: AMsMyM791yLq6qjzX8Xg1iLM43Z/4sgHx3RsTDpY1L5lQqY6NdmLgjBuFBFIFAq2vMFqbEgzoQhQ X-Received: by 2002:a17:90a:9a8f:b0:212:ea8d:dc34 with SMTP id e15-20020a17090a9a8f00b00212ea8ddc34mr75654209pjp.30.1667893142662; Mon, 07 Nov 2022 23:39:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667893142; cv=none; d=google.com; s=arc-20160816; b=v58O/HI5hvmwoirUfuqF8dARqH4FlmnMPCBYOaKawsdp+QJwVa86huMXCtqJqF2EQh rZavKPSjxiIiQYWKdPeRjGZq4AqbKZ/gr/rqRJ8tGKpzuG3hdPB3yLmtXLz2ETeLMSww MhZLyXMJDsx6R5bxPdnvIBLYD2TFN8S3MTH/ibG81AwuJyV/xvi360q/Nme6D6SxWH0Q bvymm+PU4R5yR6vufXN53AnALRYyuCfjf4fnsioV3pKzH86UYTs6EH9vYIlz0rHcIzWR AzLHN8JXbgS2mxUCaDMWTegeshV4KmMKCh434/eZpmTHGmeOYxmnKo6Pr1MI/ygsT3+u p6hQ== 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=05tcS3sAQNNzElcGvhYcBZhblO5ft3NSeZEHHXzfROg=; b=jFjDcVqUCE1UFMx+L6THWjVCdgSsvVOZjX5QbjCuGCPOtW+rjbDhxHFUC6MrdOYOqC rAUhPSDkKyt6kC5TiPaGHRmDotsgXC16dVDZCADLyoRnJqcH/xWQXzDdaxQGYwvH8WQT BnhN98asw/VXcTGSNAubYhgZA32kwlgiUhdz0GOkYPoyeve9f8EsMBt0bCQSSM2KxLAl a1PPq2P8UptWVh1Y1EL+RlYkvHS5L4JELDMfEIgE21qhJS/t3nQYWsO9++2SbowYSFvw ddy3fJ8v2F9j8E/tsDRtD9bFt1HVkal6H5/auyWTarwlHNtYEpQMHs9Tsc6hWARoN23a F4iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Zg46QtP7; 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 i3-20020a6551c3000000b0046b2bef339csi12694219pgq.257.2022.11.07.23.38.49; Mon, 07 Nov 2022 23:39:02 -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=Zg46QtP7; 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 S229854AbiKHHfy (ORCPT + 99 others); Tue, 8 Nov 2022 02:35:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232641AbiKHHfs (ORCPT ); Tue, 8 Nov 2022 02:35:48 -0500 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF80D2EF52 for ; Mon, 7 Nov 2022 23:35:45 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id e8-20020a5b0cc8000000b006bca0fa3ab6so13379545ybr.0 for ; Mon, 07 Nov 2022 23:35:45 -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=05tcS3sAQNNzElcGvhYcBZhblO5ft3NSeZEHHXzfROg=; b=Zg46QtP7hcn+P4fbi7N9yBIbX3ahfdclkZHaF/TnGZCqShkEQAWMz8WJFH+opdhDDp eYIhkkaTDXJ7XiNR87v75N/uwhgnwsQhhuzlvIsgB4VIz3GF86py59diJgouGb/YSlfS YfbQp7r4rXYLgS+7qiPfSqqHfFybuVnf6olvHf6PZnXtg1K3QEgo7CQA6v/WKbCtEBqZ 40MvScHyvg2QbhmdyfY4eM8F/aZdXvP6H0kIukoTGEDuBtHr5UVpJX9F4IGVcV5YdfPn D/SIUvEuj/+wg+buoKXtv1MjWpe/ydZhBnKviqVonVtO+926/BJkhhbi8eORy7E5Nds3 1kog== 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=05tcS3sAQNNzElcGvhYcBZhblO5ft3NSeZEHHXzfROg=; b=qHji4n6Hzrzp+XDRPc2EwIwW7BBkZPLYrg5tj2O51XdMIbjOjcYnyPIdUwYCkQcfhb 16o9/vAR/ZZECn1PHe9Yga+Zj9Gt+eQLaQuEwR2mZtNq0nveyocityjX3KqDb29/XyCA suMgHH9ZiKELrNza+rgYgaM9jjEB1V58Aaj+UKIfrnRWbTJcKb14JvyXB+WmFbi+/ejW 4cp6WHCKH5DX+O71OVpiwlcUN154QKzbDEKf6sONX5s5kmmpA/Y92YQxkAg4qQrqbTkZ i71Lu1DzmjrybdTYXdZ69L+5wy3/pQ1Dbk2wDbLokyxvjYayT/X+xxKEDMqj3EaTn2LJ M1mw== X-Gm-Message-State: ACrzQf2N9UqSD1rr3/KydpekgmgsG76tvsGw2fsO0N/Kj5JBs/dPbCn2 YkYfhXjAm8Ogh43zIArUAEX6BqO8okbZ X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:a697:9013:186f:ed07]) (user=irogers job=sendgmr) by 2002:a5b:c92:0:b0:688:436c:b2b with SMTP id i18-20020a5b0c92000000b00688436c0b2bmr52487113ybq.436.1667892945099; Mon, 07 Nov 2022 23:35:45 -0800 (PST) Date: Mon, 7 Nov 2022 23:35:06 -0800 In-Reply-To: <20221108073518.1154450-1-irogers@google.com> Message-Id: <20221108073518.1154450-3-irogers@google.com> Mime-Version: 1.0 References: <20221108073518.1154450-1-irogers@google.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Subject: [PATCH v1 02/14] tools lib subcmd: Add install target 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 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=unavailable 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?1748912720305434828?= X-GMAIL-MSGID: =?utf-8?q?1748912720305434828?= This allows libsubcmd to be installed as a dependency. Signed-off-by: Ian Rogers --- tools/lib/subcmd/Makefile | 49 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/tools/lib/subcmd/Makefile b/tools/lib/subcmd/Makefile index 8f1a09cdfd17..e96566f8991c 100644 --- a/tools/lib/subcmd/Makefile +++ b/tools/lib/subcmd/Makefile @@ -17,6 +17,15 @@ RM = rm -f MAKEFLAGS += --no-print-directory +INSTALL = install + +# Use DESTDIR for installing into a different root directory. +# This is useful for building a package. The program will be +# installed in this directory as if it was the root directory. +# Then the build tool can move it later. +DESTDIR ?= +DESTDIR_SQ = '$(subst ','\'',$(DESTDIR))' + LIBFILE = $(OUTPUT)libsubcmd.a CFLAGS := -ggdb3 -Wall -Wextra -std=gnu99 -fPIC @@ -48,6 +57,18 @@ CFLAGS += $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) SUBCMD_IN := $(OUTPUT)libsubcmd-in.o +ifeq ($(LP64), 1) + libdir_relative = lib64 +else + libdir_relative = lib +endif + +prefix ?= +libdir = $(prefix)/$(libdir_relative) + +# Shell quotes +libdir_SQ = $(subst ','\'',$(libdir)) + all: export srctree OUTPUT CC LD CFLAGS V @@ -61,6 +82,34 @@ $(SUBCMD_IN): FORCE $(LIBFILE): $(SUBCMD_IN) $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(SUBCMD_IN) +define do_install_mkdir + if [ ! -d '$(DESTDIR_SQ)$1' ]; then \ + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$1'; \ + fi +endef + +define do_install + if [ ! -d '$(DESTDIR_SQ)$2' ]; then \ + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$2'; \ + fi; \ + $(INSTALL) $1 $(if $3,-m $3,) '$(DESTDIR_SQ)$2' +endef + +install_lib: $(LIBFILE) + $(call QUIET_INSTALL, $(LIBFILE)) \ + $(call do_install_mkdir,$(libdir_SQ)); \ + cp -fpR $(LIBFILE) $(DESTDIR)$(libdir_SQ) + +install_headers: + $(call QUIET_INSTALL, headers) \ + $(call do_install,exec-cmd.h,$(prefix)/include/subcmd,644); \ + $(call do_install,help.h,$(prefix)/include/subcmd,644); \ + $(call do_install,pager.h,$(prefix)/include/subcmd,644); \ + $(call do_install,parse-options.h,$(prefix)/include/subcmd,644); \ + $(call do_install,run-command.h,$(prefix)/include/subcmd,644); + +install: install_lib install_headers + clean: $(call QUIET_CLEAN, libsubcmd) $(RM) $(LIBFILE); \ find $(or $(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM) From patchwork Tue Nov 8 07:35:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 16897 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2544204wru; Mon, 7 Nov 2022 23:37:11 -0800 (PST) X-Google-Smtp-Source: AMsMyM4cdEL0/bPwBLQIkwOQHwIcmdu0lz3lfSljmQFb+2mEI7kJ+DzsixvgbZFmkj0KymEQYEl+ X-Received: by 2002:a17:90a:c201:b0:216:ab2c:25b with SMTP id e1-20020a17090ac20100b00216ab2c025bmr24973525pjt.45.1667893031661; Mon, 07 Nov 2022 23:37:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667893031; cv=none; d=google.com; s=arc-20160816; b=gDRXwdLeBTX8Mkqok8+36xIZPiVR1r/9MU2FUQxv/S2l05Vqn0Qs7Z+ugz4GQw8PxY K3xVpyGcn0psZTFgULtxiewvmVeW26pW9X8zJIM2hFpQL6qDZhhyeIpm8yQuYMxrNJyv If6HmRTd6jlB7lM9FzQHJY1ut25C2jgSv63FtlZsphW3wSrHW/GMDyF8i/8tzklpbScP /j0LUoaUEfQKUmVfexEw1XTvDsGAvoMCoBrdRwpzZPrXR296das4BcN3a0YO0Lp8c7PO J5nfaglwlzIyaAiYGQ8heYJLp/TpQKhftvt+Tmk8YKyDNHH0XVWxgxJW52uWxbvNqihe FTug== 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=57Nc0nVeI1H4spNvFUvS/ZHB5odm1OzqWBvubdS35Rg=; b=AOiZ9NkBm0XJMuy8IfqCgdGDu1F3WdWAp6NeMeClYhwCeFiDYpHj9osSoIbVGYltXa QGSdCun8iNY1TsynUfEFVPZaJnmjELjyh+qcyapWGp1uOJnYNYJcQd2maEZ2EmCo2wrD XI5skzLsqrbHo6yfczMIZ7+jmRZ149VKBNwG4mI8c/WWg5sRvaTxT89kXOFtpGtGV5ra K8CM6HuomW8zuSxmV9YCqAqH/DHIVPF9fWPXICQ3IJiEx6illq3IF8ZY63WE8njoi5sw UHdB93NGTkiKbmFzp3dCFnFGkqy/zs+SWX9OxVwJonN/MitLK4lF0NPebBw2sxUH7Kmy YyxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=q1y7M8F0; 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 z6-20020a170902708600b001868d5fc29bsi12532163plk.259.2022.11.07.23.36.58; Mon, 07 Nov 2022 23:37:11 -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=q1y7M8F0; 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 S233567AbiKHHf7 (ORCPT + 99 others); Tue, 8 Nov 2022 02:35:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233554AbiKHHfy (ORCPT ); Tue, 8 Nov 2022 02:35:54 -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 86E431A80F for ; Mon, 7 Nov 2022 23:35:53 -0800 (PST) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-373569200ceso129652997b3.4 for ; Mon, 07 Nov 2022 23:35:53 -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=57Nc0nVeI1H4spNvFUvS/ZHB5odm1OzqWBvubdS35Rg=; b=q1y7M8F08KFmisImxwXGLfMu9zHVFtWByAk6fY0quima6z576qB4XY5GWJeV1hqTTG K+Wpk+IPOEcV7vLl0oyzVpLLTTyVlXmrqGjWTd/YinO15aoSV++Fm6AUmS/E2KPfTLaP nQZ/6FKa4CdoUNyDdhqW/9HlxIie2JBKTCG6cFzmP5dHOWAtBHYFjD2yNXHK0zfQNTPa SA+p+NRz7Ht7CRS7vYvEaqF07TfM1Nn8HYOFyG14oxNpVobENZYu2ewlD1+/8LpJIFeB YEg1VFd9TEU7cO3ZWi0LMjGmwYIsXc1kLKA47qelaEKgiDdVnsheHSdC7kXtBXqa2C6Z EnqQ== 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=57Nc0nVeI1H4spNvFUvS/ZHB5odm1OzqWBvubdS35Rg=; b=ZaEwc+P/yBCYgojuCAezyxfMX5XNr7kvLAAfUZsUADkG2BVlf6EQRwvl25m0qb5Rvb ZpySbZ8Y9W4dyqOkEjmpwpWl9zoQrl4RH5zSHTAAM2B+KsbivQtZhT+C7VhLn4tqIGkX QLUrnf2wK1RL9OOnvgTHodj9AXM5VwDRRHM2ixIO83mobK538uUmUPe85xKlXeOeBgV8 zFpYsgLGwPyiRihzNYuhyvsr8fdeVYGPW8PN8Qax8pAheBpQKbDWNXoOTK5x1otbGjmM 348eAaSu0xEHyFIsA4+TyTZpd4TDgvmqXiBtlqPzn2Hq16oa3dPTNF2G7eMkkSadVleC hGvw== X-Gm-Message-State: ANoB5pkH9rB7THySWO4Ytx93qG+pawyqceO0WI0F68zozw8D410CbR5L bYu5MOSWRKVNIH/TwN7dmbGKXOSbjid2 X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:a697:9013:186f:ed07]) (user=irogers job=sendgmr) by 2002:a05:6902:1208:b0:6d4:a2f7:44e0 with SMTP id s8-20020a056902120800b006d4a2f744e0mr16782234ybu.633.1667892952783; Mon, 07 Nov 2022 23:35:52 -0800 (PST) Date: Mon, 7 Nov 2022 23:35:07 -0800 In-Reply-To: <20221108073518.1154450-1-irogers@google.com> Message-Id: <20221108073518.1154450-4-irogers@google.com> Mime-Version: 1.0 References: <20221108073518.1154450-1-irogers@google.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Subject: [PATCH v1 03/14] perf build: Install libsubcmd locally when building 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 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=unavailable 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?1748912603678386105?= X-GMAIL-MSGID: =?utf-8?q?1748912603678386105?= The perf build currently has a '-Itools/lib' on the CC command line. This causes issues as the libapi, libsubcmd, libtraceevent, libbpf headers are all found via this path, making it impossible to override include behavior. Change the libsubcmd build mirroring the libbpf build, so that it is installed in a directory along with its headers. A later change will modify the include behavior. Signed-off-by: Ian Rogers --- tools/perf/.gitignore | 1 + tools/perf/Makefile.perf | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/tools/perf/.gitignore b/tools/perf/.gitignore index a653311d9693..626f5dd9a037 100644 --- a/tools/perf/.gitignore +++ b/tools/perf/.gitignore @@ -39,6 +39,7 @@ pmu-events/pmu-events.c pmu-events/jevents feature/ libbpf/ +libsubcmd/ fixdep libtraceevent-dynamic-list Documentation/doc.dep diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index a432e59afc42..af62c6b9ed7a 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -244,7 +244,7 @@ else # force_fixdep LIB_DIR = $(srctree)/tools/lib/api/ TRACE_EVENT_DIR = $(srctree)/tools/lib/traceevent/ LIBBPF_DIR = $(srctree)/tools/lib/bpf/ -SUBCMD_DIR = $(srctree)/tools/lib/subcmd/ +LIBSUBCMD_DIR = $(srctree)/tools/lib/subcmd/ LIBPERF_DIR = $(srctree)/tools/lib/perf/ DOC_DIR = $(srctree)/tools/perf/Documentation/ @@ -294,7 +294,6 @@ strip-libs = $(filter-out -l%,$(1)) ifneq ($(OUTPUT),) TE_PATH=$(OUTPUT) PLUGINS_PATH=$(OUTPUT) - SUBCMD_PATH=$(OUTPUT) LIBPERF_PATH=$(OUTPUT) ifneq ($(subdir),) API_PATH=$(OUTPUT)/../lib/api/ @@ -305,7 +304,6 @@ else TE_PATH=$(TRACE_EVENT_DIR) PLUGINS_PATH=$(TRACE_EVENT_DIR)plugins/ API_PATH=$(LIB_DIR) - SUBCMD_PATH=$(SUBCMD_DIR) LIBPERF_PATH=$(LIBPERF_DIR) endif @@ -332,7 +330,14 @@ LIBBPF_DESTDIR = $(LIBBPF_OUTPUT) LIBBPF_INCLUDE = $(LIBBPF_DESTDIR)/include LIBBPF = $(LIBBPF_OUTPUT)/libbpf.a -LIBSUBCMD = $(SUBCMD_PATH)libsubcmd.a +ifneq ($(OUTPUT),) + LIBSUBCMD_OUTPUT = $(abspath $(OUTPUT))/libsubcmd +else + LIBSUBCMD_OUTPUT = $(CURDIR)/libsubcmd +endif +LIBSUBCMD_DESTDIR = $(LIBSUBCMD_OUTPUT) +LIBSUBCMD_INCLUDE = $(LIBSUBCMD_DESTDIR)/include +LIBSUBCMD = $(LIBSUBCMD_OUTPUT)/libsubcmd.a LIBPERF = $(LIBPERF_PATH)libperf.a export LIBPERF @@ -849,11 +854,14 @@ $(LIBPERF)-clean: $(call QUIET_CLEAN, libperf) $(Q)$(MAKE) -C $(LIBPERF_DIR) O=$(OUTPUT) clean >/dev/null -$(LIBSUBCMD): FORCE - $(Q)$(MAKE) -C $(SUBCMD_DIR) O=$(OUTPUT) $(OUTPUT)libsubcmd.a +$(LIBSUBCMD): FORCE | $(LIBSUBCMD_OUTPUT) + $(Q)$(MAKE) -C $(LIBSUBCMD_DIR) O=$(LIBSUBCMD_OUTPUT) \ + DESTDIR=$(LIBSUBCMD_DESTDIR) prefix= \ + $@ install_headers $(LIBSUBCMD)-clean: - $(Q)$(MAKE) -C $(SUBCMD_DIR) O=$(OUTPUT) clean + $(call QUIET_CLEAN, libsubcmd) + $(Q)$(RM) -r -- $(LIBSUBCMD_OUTPUT) help: @echo 'Perf make targets:' @@ -1044,7 +1052,7 @@ SKELETONS += $(SKEL_OUT)/bperf_cgroup.skel.h $(SKEL_OUT)/func_latency.skel.h SKELETONS += $(SKEL_OUT)/off_cpu.skel.h $(SKEL_OUT)/lock_contention.skel.h SKELETONS += $(SKEL_OUT)/kwork_trace.skel.h -$(SKEL_TMP_OUT) $(LIBBPF_OUTPUT): +$(SKEL_TMP_OUT) $(LIBBPF_OUTPUT) $(LIBSUBCMD_OUTPUT): $(Q)$(MKDIR) -p $@ ifdef BUILD_BPF_SKEL From patchwork Tue Nov 8 07:35:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 16898 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2544306wru; Mon, 7 Nov 2022 23:37:32 -0800 (PST) X-Google-Smtp-Source: AMsMyM7nHq/MOUnBVbOLr3KCzJxJm+7WNiRKbdBbDRt28jlMBV+LSlV5ZBRlUSNVo7cEctIyJFHH X-Received: by 2002:a05:6402:f8e:b0:461:8b1c:eb0c with SMTP id eh14-20020a0564020f8e00b004618b1ceb0cmr56273891edb.20.1667893051910; Mon, 07 Nov 2022 23:37:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667893051; cv=none; d=google.com; s=arc-20160816; b=VYL704M37RXMfA712x0mUQryBhEIto7Fz57cCRFGwss+PYqGzp5vOh/7Ul0hA/iFC7 TYRDpzSXLd7QkcDF1IZhEJgA5wDPocUF1e1UXrhkKopkdIgcv+C38M4n/VraMTLCS/LJ KveCz/IkkOWbcpbxwMjW/kmjRiH8Od/RNXtwk4yXeSuxm1CYxjzqFeKnImJEuE7yf/Pr P6h1hYX0vQSct9ImoArfOqx7UOEFWTBm5ZLy3fCZIZqkxHa+mMRs3E0LR1yc4VPd7PVq 6IrReQ8Cd9VNLmF0su3SdlkF6G20CjPz5jpsfpXeC2ibCXM9JiDFgqT90mD2DUUsI0o4 LCBw== 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=8XV8F7Y9b6lLTaqsCc66jRKiIqG8YARD76LN05/Nr/k=; b=jCxqP7YADct8D9xnqOXU0cF0/dCssDIvoTw2EtK0gzEqZScBJ9TFmev6M8KM1D4jOW jB3TYmmUHCq/JnOE2KPaWF/wfNZDoNn/MRjA90iyh2buOFF83j85O++ps509CfnmAEhr 18vTCrlpAv/BbiX67Tlz9LfcfVy4TICjreD6YhooE5Pi7JlildboxaBXzsbHnROLcsDx 0dIGG1YFIf/YFgh8ojPeZwxIEsvd8IgS0L2iJToBCoOY73jAe+ydm/s4B8U437Gl73Nm FhkCtERo+YPGp2NLIVmUW0snW1yJv2y3YI/2UCxQfdkNqS9pnJt8Ypo4Q5uLlB4GKINy WflQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=tIu+ae8R; 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 sg16-20020a170907a41000b0073c0169863dsi4962140ejc.465.2022.11.07.23.37.09; Mon, 07 Nov 2022 23:37:31 -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=tIu+ae8R; 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 S233358AbiKHHgP (ORCPT + 99 others); Tue, 8 Nov 2022 02:36:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233222AbiKHHgC (ORCPT ); Tue, 8 Nov 2022 02:36:02 -0500 Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D518631F97 for ; Mon, 7 Nov 2022 23:36:01 -0800 (PST) Received: by mail-pj1-x1049.google.com with SMTP id nl16-20020a17090b385000b002138288fd51so11971598pjb.6 for ; Mon, 07 Nov 2022 23:36:01 -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=8XV8F7Y9b6lLTaqsCc66jRKiIqG8YARD76LN05/Nr/k=; b=tIu+ae8RAaJV6DT6ho3AZcMSnxba+8gPBUz3vxCbEzMIUvJI6h7jZT1ljI6sdhfqHq dl04PKc9R1t8WtzG+mIc3Ra8vcsKiptz7/NH2D2SKLrPBZay+T1ygysr4GGbhu6re7Nf CF7ug8e1MQanPm6kirN9k/NUz9JQAzJH+eh4o2SmmGZMmuadREaqEE5+Xinl1P72wmfP EXD0mUA+j16ZMCDcpi0WO5JIh3W9CvOfjFHtr9rr5FmoSrdDweg+/zucQHuj3aFaSR6M YgtnDw16RUa9SFXt/ivoYv6vi+iYPgiA5NhL72Id3CodqjjnP28tLmlOA0itqjwR9fat 9UYw== 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=8XV8F7Y9b6lLTaqsCc66jRKiIqG8YARD76LN05/Nr/k=; b=PHwvElgU6E7cwlm7kshfPMvzpUrXtwpK+4dUH1fZuiArQWH6aPXKO6oVUtV3DAOXon wUaobybp02L2y9veOXnwXS8ECbuaCqRuDlBkh7Kq6sKpLLCn0oZs4LWZBUa0sjb1b5MV aPl6MFzt/G+BjABr/5Xrxntpr+UhQ0y2KqvRLDgy4VNTbTZeiQ4CvhsZSRjICNEM0Qld kVaTdd9rFKxgs4plIq9LOQE0Oi5hh3LJMjW200MAYb2bKL8ynhTY9o7h30RyhaXwV5P8 FlkxCOnTgU1VR9S6iD8VPAwiQ1P47i58Q2qiQUPEiFKL0MuSN15uq3xFCrvp9kpzIkJG el1g== X-Gm-Message-State: ACrzQf31IJ311UkBTUCGCZO7GzjY1KA0d3lID0xxXZ3y6xp9GOFtHh8g BgTtY/Zbt7l++cq/l/qZVv9NNDye0jRL X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:a697:9013:186f:ed07]) (user=irogers job=sendgmr) by 2002:a17:902:a5cc:b0:188:53c8:fddd with SMTP id t12-20020a170902a5cc00b0018853c8fdddmr758529plq.52.1667892961109; Mon, 07 Nov 2022 23:36:01 -0800 (PST) Date: Mon, 7 Nov 2022 23:35:08 -0800 In-Reply-To: <20221108073518.1154450-1-irogers@google.com> Message-Id: <20221108073518.1154450-5-irogers@google.com> Mime-Version: 1.0 References: <20221108073518.1154450-1-irogers@google.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Subject: [PATCH v1 04/14] perf build: Install libapi locally when building 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 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?1748912624479409715?= X-GMAIL-MSGID: =?utf-8?q?1748912624479409715?= The perf build currently has a '-Itools/lib' on the CC command line. This causes issues as the libapi, libsubcmd, libtraceevent, libbpf headers are all found via this path, making it impossible to override include behavior. Change the libapi build mirroring the libbpf and libsubcmd build, so that it is installed in a directory along with its headers. A later change will modify the include behavior. Signed-off-by: Ian Rogers --- tools/perf/.gitignore | 1 + tools/perf/Makefile.perf | 27 +++++++++++++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/tools/perf/.gitignore b/tools/perf/.gitignore index 626f5dd9a037..1932848343f3 100644 --- a/tools/perf/.gitignore +++ b/tools/perf/.gitignore @@ -38,6 +38,7 @@ trace/beauty/generated/ pmu-events/pmu-events.c pmu-events/jevents feature/ +libapi/ libbpf/ libsubcmd/ fixdep diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index af62c6b9ed7a..3874d88d72c9 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -241,7 +241,7 @@ sub-make: fixdep else # force_fixdep -LIB_DIR = $(srctree)/tools/lib/api/ +LIBAPI_DIR = $(srctree)/tools/lib/api/ TRACE_EVENT_DIR = $(srctree)/tools/lib/traceevent/ LIBBPF_DIR = $(srctree)/tools/lib/bpf/ LIBSUBCMD_DIR = $(srctree)/tools/lib/subcmd/ @@ -295,15 +295,9 @@ ifneq ($(OUTPUT),) TE_PATH=$(OUTPUT) PLUGINS_PATH=$(OUTPUT) LIBPERF_PATH=$(OUTPUT) -ifneq ($(subdir),) - API_PATH=$(OUTPUT)/../lib/api/ -else - API_PATH=$(OUTPUT) -endif else TE_PATH=$(TRACE_EVENT_DIR) PLUGINS_PATH=$(TRACE_EVENT_DIR)plugins/ - API_PATH=$(LIB_DIR) LIBPERF_PATH=$(LIBPERF_DIR) endif @@ -318,7 +312,14 @@ LIBTRACEEVENT_DYNAMIC_LIST = $(PLUGINS_PATH)libtraceevent-dynamic-list DYNAMIC_LIST_LDFLAGS = -Xlinker --dynamic-list=$(LIBTRACEEVENT_DYNAMIC_LIST) LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS = $(if $(findstring -static,$(LDFLAGS)),,$(DYNAMIC_LIST_LDFLAGS)) -LIBAPI = $(API_PATH)libapi.a +ifneq ($(OUTPUT),) + LIBAPI_OUTPUT = $(abspath $(OUTPUT))/libapi +else + LIBAPI_OUTPUT = $(CURDIR)/libapi +endif +LIBAPI_DESTDIR = $(LIBAPI_OUTPUT) +LIBAPI_INCLUDE = $(LIBAPI_DESTDIR)/include +LIBAPI = $(LIBAPI_OUTPUT)/libapi.a export LIBAPI ifneq ($(OUTPUT),) @@ -831,12 +832,14 @@ $(LIBTRACEEVENT)-clean: install-traceevent-plugins: libtraceevent_plugins $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) install_plugins -$(LIBAPI): FORCE - $(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) $(OUTPUT)libapi.a +$(LIBAPI): FORCE | $(LIBAPI_OUTPUT) + $(Q)$(MAKE) -C $(LIBAPI_DIR) O=$(LIBAPI_OUTPUT) \ + DESTDIR=$(LIBAPI_DESTDIR) prefix= \ + $@ install_headers $(LIBAPI)-clean: $(call QUIET_CLEAN, libapi) - $(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) clean >/dev/null + $(Q)$(RM) -r -- $(LIBAPI_OUTPUT) $(LIBBPF): FORCE | $(LIBBPF_OUTPUT) $(Q)$(MAKE) -C $(LIBBPF_DIR) FEATURES_DUMP=$(FEATURE_DUMP_EXPORT) \ @@ -1052,7 +1055,7 @@ SKELETONS += $(SKEL_OUT)/bperf_cgroup.skel.h $(SKEL_OUT)/func_latency.skel.h SKELETONS += $(SKEL_OUT)/off_cpu.skel.h $(SKEL_OUT)/lock_contention.skel.h SKELETONS += $(SKEL_OUT)/kwork_trace.skel.h -$(SKEL_TMP_OUT) $(LIBBPF_OUTPUT) $(LIBSUBCMD_OUTPUT): +$(SKEL_TMP_OUT) $(LIBAPI_OUTPUT) $(LIBBPF_OUTPUT) $(LIBSUBCMD_OUTPUT): $(Q)$(MKDIR) -p $@ ifdef BUILD_BPF_SKEL From patchwork Tue Nov 8 07:35:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 16907 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2544904wru; Mon, 7 Nov 2022 23:39:12 -0800 (PST) X-Google-Smtp-Source: AMsMyM4qbzASRICE8GzeDN3jGCdPPtYPlYmMewkhpW9dnIREYDkgfFI3MRZ+pQjKWe0uIj5caI1U X-Received: by 2002:a17:903:2285:b0:188:505b:25f with SMTP id b5-20020a170903228500b00188505b025fmr29016800plh.71.1667893152261; Mon, 07 Nov 2022 23:39:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667893152; cv=none; d=google.com; s=arc-20160816; b=k9o2mFeloEhCDoBBTFBfjCK510a39cQLHmDxrnoJYJV4EqvZSBh9yFGxHO31/nlzTS LIf3U9z4Cjxy2Bf1WG7gmpuV/5Z791kStFXnRU+T9nGDovF9QEl/AGk3t1Eu2JSlw0De xy2qlBhpQn7gaNwYAIKY0Z9oykaI1oJEiJeHXjsd/Xx3EorAIQNVIbbGRny4n1PWv0hj xWw3te8+p1gl46OR21Aj5EotQhG3Vemv73L72ZAnOskPAU/OwojWEblseN27ADkIiyiy aK0ZJHDhvPFAD4ogEFSt0g3qv7FESc30gutem9Nvkg99hySgaclDWqYbtkZaAh/HiUGV Dyew== 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=NZA/f3MSpP9/H1Abii1NpKRbnV3jMWj2nBqG7xqYGg0=; b=th0HjRR9l5gvVV1hchZaRpu+xltwYrjBGbDwOM4pPDgHcL/2llAjJNsgYe8nuSshhh jqgyk0VABJf06kHvipVdo8z38EaHO2RhrvG3+X7ZhgpsbrKoe15ORprYsynSPlOXC0xd HOkFhM+ElCY/FVfVfMZtUjzneanMopxm60RCgaLVNtutXsKBeM8GXeQ3voAePpFqX0n5 vrEIldWVJnF3TN7B+SPQJMAtYhMy4RUCpH7h4RMbFBBgtPBwS0jbHbsEQK/SjnEaNPUt O5WDXcFHMf1mFADBZ9JBqpHKYlspKLfxWo9ltNAetNNo2idH7CO7AGHm78q899C171Jf etRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=LQcU5xO2; 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 lb8-20020a17090b4a4800b0021391d90dadsi22187252pjb.107.2022.11.07.23.38.59; Mon, 07 Nov 2022 23:39:12 -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=LQcU5xO2; 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 S233568AbiKHHg0 (ORCPT + 99 others); Tue, 8 Nov 2022 02:36:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233571AbiKHHgN (ORCPT ); Tue, 8 Nov 2022 02:36:13 -0500 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00BBE1FCE0 for ; Mon, 7 Nov 2022 23:36:10 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id y65-20020a25c844000000b006bb773548d5so13319292ybf.5 for ; Mon, 07 Nov 2022 23:36:10 -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=NZA/f3MSpP9/H1Abii1NpKRbnV3jMWj2nBqG7xqYGg0=; b=LQcU5xO28wTELZbTpiimJoSAHs5p0tszI+5HwFrlnpiUaeEHjHrdaE9rKiRUhfHO6w 9PL+5vLXFk5S7DbYJU3SAjEMQ6wq+HxR/Ozv+7E9mfJHhnhuiHq8PIbk2y4bYL9d7Sbh S/IL8XS16Pxf9QYT9ZwgeKeKq2w82oYnMY+Ds63OY0QI1Rp/p0vvbaPUdvCwL+gPK1Xf S81XjE7Latp9wHdFsOg8RQd934t7rCapKde1uvUXdcS80E91Z1h96r8wuAkO+MjNuDeK mt3mkij/VFJitiMNMSVqX0KNgQemV5rGzDG/gYnSfy07ut1RN5KfrMvJHGhwcMo+mg6B XinA== 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=NZA/f3MSpP9/H1Abii1NpKRbnV3jMWj2nBqG7xqYGg0=; b=2fsqQGGY4A58usE899ZgxdMwgl0evs6QASJfn3L1sP+4bVHYT52aK0zJldfNYQ6e/e 23/VHypNjXYSbw/UtGnzoquXHgUdydBv7/GHHYs1kAlF94Js1LIz6i6o+5bEFnaDTBWG 5g9cxKjincaTmbnDPUv2v14Sl2on+qEHt9EXJRWd32e2ZqfCKa6XlvR3S3HSEJ00ti2K OYOPnrjcMPjIjxYdehPowmoSfETKALz3dsXQkhuuItBkzU3Cd8gmLDtK229RAUuFMGIH 7k3/T+xXK4xP+3TD/VILkMUf/8BeLvxd75Q4gsffoKmjjGMKQ7h2KLvb4dCwwQdM30xa OwGA== X-Gm-Message-State: ACrzQf313lRHrs5oyW+YXLeroDp7JWN5dXxRMH9hb+0GuMc+5FX00uw+ 9+X3mbNxxntzKFfzcM4dNAKqZ9FQl77J X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:a697:9013:186f:ed07]) (user=irogers job=sendgmr) by 2002:a05:690c:683:b0:368:43f3:aa60 with SMTP id bp3-20020a05690c068300b0036843f3aa60mr898663ywb.50.1667892970237; Mon, 07 Nov 2022 23:36:10 -0800 (PST) Date: Mon, 7 Nov 2022 23:35:09 -0800 In-Reply-To: <20221108073518.1154450-1-irogers@google.com> Message-Id: <20221108073518.1154450-6-irogers@google.com> Mime-Version: 1.0 References: <20221108073518.1154450-1-irogers@google.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Subject: [PATCH v1 05/14] perf build: Install libperf locally when building 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 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=unavailable 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?1748912729967374640?= X-GMAIL-MSGID: =?utf-8?q?1748912729967374640?= The perf build currently has a '-Itools/lib' on the CC command line. This causes issues as the libapi, libsubcmd, libtraceevent, libbpf headers are all found via this path, making it impossible to override include behavior. Change the libperf build mirroring the libbpf, libsubcmd and libapi build, so that it is installed in a directory along with its headers. A later change will modify the include behavior. Signed-off-by: Ian Rogers --- tools/perf/.gitignore | 1 + tools/perf/Makefile.perf | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/tools/perf/.gitignore b/tools/perf/.gitignore index 1932848343f3..43f6621ef05e 100644 --- a/tools/perf/.gitignore +++ b/tools/perf/.gitignore @@ -40,6 +40,7 @@ pmu-events/jevents feature/ libapi/ libbpf/ +libperf/ libsubcmd/ fixdep libtraceevent-dynamic-list diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 3874d88d72c9..5a2a3c4f045d 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -294,11 +294,9 @@ strip-libs = $(filter-out -l%,$(1)) ifneq ($(OUTPUT),) TE_PATH=$(OUTPUT) PLUGINS_PATH=$(OUTPUT) - LIBPERF_PATH=$(OUTPUT) else TE_PATH=$(TRACE_EVENT_DIR) PLUGINS_PATH=$(TRACE_EVENT_DIR)plugins/ - LIBPERF_PATH=$(LIBPERF_DIR) endif LIBTRACEEVENT = $(TE_PATH)libtraceevent.a @@ -340,7 +338,14 @@ LIBSUBCMD_DESTDIR = $(LIBSUBCMD_OUTPUT) LIBSUBCMD_INCLUDE = $(LIBSUBCMD_DESTDIR)/include LIBSUBCMD = $(LIBSUBCMD_OUTPUT)/libsubcmd.a -LIBPERF = $(LIBPERF_PATH)libperf.a +ifneq ($(OUTPUT),) + LIBPERF_OUTPUT = $(abspath $(OUTPUT))/libperf +else + LIBPERF_OUTPUT = $(CURDIR)/libperf +endif +LIBPERF_DESTDIR = $(LIBPERF_OUTPUT) +LIBPERF_INCLUDE = $(LIBPERF_DESTDIR)/include +LIBPERF = $(LIBPERF_OUTPUT)/libperf.a export LIBPERF # python extension build directories @@ -850,12 +855,14 @@ $(LIBBPF)-clean: $(call QUIET_CLEAN, libbpf) $(Q)$(RM) -r -- $(LIBBPF_OUTPUT) -$(LIBPERF): FORCE - $(Q)$(MAKE) -C $(LIBPERF_DIR) EXTRA_CFLAGS="$(LIBPERF_CFLAGS)" O=$(OUTPUT) $(OUTPUT)libperf.a +$(LIBPERF): FORCE | $(LIBPERF_OUTPUT) + $(Q)$(MAKE) -C $(LIBPERF_DIR) O=$(LIBPERF_OUTPUT) \ + DESTDIR=$(LIBPERF_DESTDIR) prefix= \ + $@ install_headers $(LIBPERF)-clean: $(call QUIET_CLEAN, libperf) - $(Q)$(MAKE) -C $(LIBPERF_DIR) O=$(OUTPUT) clean >/dev/null + $(Q)$(RM) -r -- $(LIBPERF_OUTPUT) $(LIBSUBCMD): FORCE | $(LIBSUBCMD_OUTPUT) $(Q)$(MAKE) -C $(LIBSUBCMD_DIR) O=$(LIBSUBCMD_OUTPUT) \ @@ -1055,7 +1062,7 @@ SKELETONS += $(SKEL_OUT)/bperf_cgroup.skel.h $(SKEL_OUT)/func_latency.skel.h SKELETONS += $(SKEL_OUT)/off_cpu.skel.h $(SKEL_OUT)/lock_contention.skel.h SKELETONS += $(SKEL_OUT)/kwork_trace.skel.h -$(SKEL_TMP_OUT) $(LIBAPI_OUTPUT) $(LIBBPF_OUTPUT) $(LIBSUBCMD_OUTPUT): +$(SKEL_TMP_OUT) $(LIBAPI_OUTPUT) $(LIBBPF_OUTPUT) $(LIBPERF_OUTPUT) $(LIBSUBCMD_OUTPUT): $(Q)$(MKDIR) -p $@ ifdef BUILD_BPF_SKEL From patchwork Tue Nov 8 07:35:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 16899 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2544340wru; Mon, 7 Nov 2022 23:37:37 -0800 (PST) X-Google-Smtp-Source: AMsMyM5Ex/3Igb5w48ZjnyY9U5c+YI4Tc1LfKuZye9/johRXSeDLq7z87h7/mmUZ+XUiek3IyR4a X-Received: by 2002:a17:90b:3446:b0:213:4990:fa2 with SMTP id lj6-20020a17090b344600b0021349900fa2mr75366272pjb.73.1667893057146; Mon, 07 Nov 2022 23:37:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667893057; cv=none; d=google.com; s=arc-20160816; b=NzSbE9VzA8vu1qfxxzOiuAWl3fOhZVVzmiTWIgr3v1Cg0rdp9YrJzv711IIooiGAFB HcxuZs4z1OlNuBSlimE5PpG+AJnF732PjDmOEsgzuRKaRPOg5IewDIToSp8TNRWXC8L6 LndhxlwfmgAIUcfXSRbuV5IieBA7+qwhu/UIHrWP5QUAxHcPv8B+ediaajTmlAfUToaJ EW4C3JNymB7+6uR+vdEhJB8rBWOhZhueUWjrxe1PwSXQk4EOyI0Zncwa5yfaxdSreWr8 TXynzVN0j0XVyXi4UtZRX3/9RXdvPhgfqgTheO0Lii/0t7wQIgWio7hGINPxMQi482lJ 1QfA== 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=Dt5L+rcJ0Z3Ar+COVpIl3YNXFFBBoIXGGhEqR9zS/0U=; b=jOk53un5PfEe7MBrvVVoMG0Ln/bi8v6pfJS0OeShLL7ebVhVhnhfcYZwC0PMBQKERK LLGe0wrQ7XjPFiSFQ4UXM1Ox8wtonBkJMWbsV3ZDe8XdgpqeNd0CYS1lCkhTsOabeSbL QI3BwXDL2qLnHSqVB1L4HgDwJmQPkpEATWRZSzmq9FftVDJngLpTBs76VGRiWoqP+NGZ XQI07Ft12Pf4S5biGHs+OGvJXqd4d5l96khTl0/Wr+gg6qgsdrt7EPghNOqex89m4x3X bVduBFglJg9NrtITRyzFBFA+oHTH2ls6mf6qKCsKJ75UkjsAnpkqI+bfJ9d4vNkXbao4 NoOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=chNIMMdi; 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 x14-20020a63170e000000b0046fb2a576d8si13202881pgl.519.2022.11.07.23.37.24; Mon, 07 Nov 2022 23:37:37 -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=chNIMMdi; 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 S233612AbiKHHgc (ORCPT + 99 others); Tue, 8 Nov 2022 02:36:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233544AbiKHHgT (ORCPT ); Tue, 8 Nov 2022 02:36:19 -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 B9859186EB for ; Mon, 7 Nov 2022 23:36:18 -0800 (PST) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-36bf9c132f9so129320017b3.8 for ; Mon, 07 Nov 2022 23:36: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=Dt5L+rcJ0Z3Ar+COVpIl3YNXFFBBoIXGGhEqR9zS/0U=; b=chNIMMdiDfMy5AFaiiwEmi96C6LP4lDlTQ0vLia+gfqQJa8XcilCoy7OAAxAr73IyS 92fbIJgdfUtPDqbqVNRnC++Qg93iYiUiwWNDc9Lkon3KU57Rl9oTJcinnyHtWmkGSlHZ OGFHFMY4/SpoHv0CYVaIk1rB6mV7cFNuM11HmIcVzqPGNHPZppiMTxkPqNXmmbqd9GZ6 mye1GKOqEv2+kESltdGarNVEabgNhp8wy/eOPCrlJqjt8e6SdhywZ3FFM4h/nPs3yjuT WtkoQ2bGINEoWNEYHsQ/R9XMBNKDwoiEHLFnajWOXcdvic4S+n/Sk3ZB9IP0uCLjEDD/ cjVg== 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=Dt5L+rcJ0Z3Ar+COVpIl3YNXFFBBoIXGGhEqR9zS/0U=; b=ZCqO7eWgDK97jovLqyxi35Wb4rp+Cd/FEGq0TIfituA4eJr66178mBOVXNicpxUjo/ dhNdg4INOsoAeETSG4YiqcZc9QgZFRG1dRe0rUD/APHWnwUNa76y+DEuW81uBc7bagQH fuODSQ/VEDvlsWhiyDQvc0qwkMzIw+bgmlVkFQSDJhxKDmrfJjxbhh5aBxNBAa2zS+2o OXlAETAS8adcE+Klw838OcqW57SJ2kCiCfxwIk5XMrDWOa5ZekjtksFn0kCuzFk2oNuS CE8/e+PfW1B+hTwAP8ZmmXcbD8NG0Zwb/xWe3KsKhzpXHrZdpU65UAQdpyPVzOo23f0y jxYQ== X-Gm-Message-State: ACrzQf1ZztbjNImH85OxHcR6rlHVaMrHfSn1eIWUdMKGlXtaWpKCzS5V 5TjELfH3/Dddzpevt87dIsIvQeNqRqnT X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:a697:9013:186f:ed07]) (user=irogers job=sendgmr) by 2002:a25:bd47:0:b0:6cc:c5e:f831 with SMTP id p7-20020a25bd47000000b006cc0c5ef831mr53947958ybm.432.1667892978082; Mon, 07 Nov 2022 23:36:18 -0800 (PST) Date: Mon, 7 Nov 2022 23:35:10 -0800 In-Reply-To: <20221108073518.1154450-1-irogers@google.com> Message-Id: <20221108073518.1154450-7-irogers@google.com> Mime-Version: 1.0 References: <20221108073518.1154450-1-irogers@google.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Subject: [PATCH v1 06/14] perf build: Install libtraceevent locally when building 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 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?1748912630253804040?= X-GMAIL-MSGID: =?utf-8?q?1748912630253804040?= The perf build currently has a '-Itools/lib' on the CC command line. This causes issues as the libapi, libsubcmd, libtraceevent, libbpf headers are all found via this path, making it impossible to override include behavior. Change the libtraceevent build mirroring the libbpf, libsubcmd, libapi and libperf build, so that it is installed in a directory along with its headers. A later change will modify the include behavior. Similarly, the plugins are now installed into libtraceevent_plugins except they have no header files. Signed-off-by: Ian Rogers --- tools/perf/.gitignore | 3 ++- tools/perf/Makefile.perf | 57 ++++++++++++++++++++++++++-------------- 2 files changed, 40 insertions(+), 20 deletions(-) diff --git a/tools/perf/.gitignore b/tools/perf/.gitignore index 43f6621ef05e..65b995159cf1 100644 --- a/tools/perf/.gitignore +++ b/tools/perf/.gitignore @@ -42,6 +42,7 @@ libapi/ libbpf/ libperf/ libsubcmd/ +libtraceevent/ +libtraceevent_plugins/ fixdep -libtraceevent-dynamic-list Documentation/doc.dep diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 5a2a3c4f045d..537ac7055a35 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -242,7 +242,8 @@ sub-make: fixdep else # force_fixdep LIBAPI_DIR = $(srctree)/tools/lib/api/ -TRACE_EVENT_DIR = $(srctree)/tools/lib/traceevent/ +LIBTRACEEVENT_DIR = $(srctree)/tools/lib/traceevent/ +LIBTRACEEVENT_PLUGINS_DIR = $(LIBTRACEEVENT_DIR)/plugins LIBBPF_DIR = $(srctree)/tools/lib/bpf/ LIBSUBCMD_DIR = $(srctree)/tools/lib/subcmd/ LIBPERF_DIR = $(srctree)/tools/lib/perf/ @@ -292,16 +293,17 @@ grep-libs = $(filter -l%,$(1)) strip-libs = $(filter-out -l%,$(1)) ifneq ($(OUTPUT),) - TE_PATH=$(OUTPUT) - PLUGINS_PATH=$(OUTPUT) + LIBTRACEEVENT_OUTPUT = $(abspath $(OUTPUT))/libtraceevent else - TE_PATH=$(TRACE_EVENT_DIR) - PLUGINS_PATH=$(TRACE_EVENT_DIR)plugins/ + LIBTRACEEVENT_OUTPUT = $(CURDIR)/libtraceevent endif - -LIBTRACEEVENT = $(TE_PATH)libtraceevent.a +LIBTRACEEVENT_PLUGINS_OUTPUT = $(LIBTRACEEVENT_OUTPUT)_plugins +LIBTRACEEVENT_DESTDIR = $(LIBTRACEEVENT_OUTPUT) +LIBTRACEEVENT_PLUGINS_DESTDIR = $(LIBTRACEEVENT_PLUGINS_OUTPUT) +LIBTRACEEVENT_INCLUDE = $(LIBTRACEEVENT_DESTDIR)/include +LIBTRACEEVENT = $(LIBTRACEEVENT_OUTPUT)/libtraceevent.a export LIBTRACEEVENT -LIBTRACEEVENT_DYNAMIC_LIST = $(PLUGINS_PATH)libtraceevent-dynamic-list +LIBTRACEEVENT_DYNAMIC_LIST = $(LIBTRACEEVENT_PLUGINS_OUTPUT)/libtraceevent-dynamic-list # # The static build has no dynsym table, so this does not work for @@ -821,21 +823,33 @@ $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h) LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' 'LDFLAGS=$(filter-out -static,$(LDFLAGS))' -$(LIBTRACEEVENT): FORCE - $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent.a - -libtraceevent_plugins: FORCE - $(Q)$(MAKE) -C $(TRACE_EVENT_DIR)plugins $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) plugins - -$(LIBTRACEEVENT_DYNAMIC_LIST): libtraceevent_plugins - $(Q)$(MAKE) -C $(TRACE_EVENT_DIR)plugins $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent-dynamic-list +$(LIBTRACEEVENT): FORCE | $(LIBTRACEEVENT_OUTPUT) + $(Q)$(MAKE) -C $(LIBTRACEEVENT_DIR) O=$(LIBTRACEEVENT_OUTPUT) \ + DESTDIR=$(LIBTRACEEVENT_DESTDIR) prefix= \ + $@ install_headers $(LIBTRACEEVENT)-clean: $(call QUIET_CLEAN, libtraceevent) - $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) O=$(OUTPUT) clean >/dev/null + $(Q)$(RM) -r -- $(LIBTRACEEVENT_OUTPUT) + +libtraceevent_plugins: FORCE | $(LIBTRACEEVENT_PLUGINS_OUTPUT) + $(Q)$(MAKE) -C $(LIBTRACEEVENT_PLUGINS_DIR) O=$(LIBTRACEEVENT_PLUGINS_OUTPUT) \ + DESTDIR=$(LIBTRACEEVENT_PLUGINS_DESTDIR) prefix= \ + plugins + +libtraceevent_plugins-clean: + $(call QUIET_CLEAN, libtraceevent_plugins) + $(Q)$(RM) -r -- $(LIBTRACEEVENT_PLUGINS_OUTPUT) + +$(LIBTRACEEVENT_DYNAMIC_LIST): libtraceevent_plugins + $(Q)$(MAKE) -C $(LIBTRACEEVENT_PLUGINS_DIR) O=$(LIBTRACEEVENT_PLUGINS_OUTPUT) \ + DESTDIR=$(LIBTRACEEVENT_PLUGINS_DESTDIR) prefix= \ + $(LIBTRACEEVENT_FLAGS) $@ install-traceevent-plugins: libtraceevent_plugins - $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) install_plugins + $(Q)$(MAKE) -C $(LIBTRACEEVENT_PLUGINS_DIR) O=$(LIBTRACEEVENT_PLUGINS_OUTPUT) \ + DESTDIR=$(LIBTRACEEVENT_PLUGINS_DESTDIR) prefix= \ + $(LIBTRACEEVENT_FLAGS) install $(LIBAPI): FORCE | $(LIBAPI_OUTPUT) $(Q)$(MAKE) -C $(LIBAPI_DIR) O=$(LIBAPI_OUTPUT) \ @@ -1065,6 +1079,11 @@ SKELETONS += $(SKEL_OUT)/kwork_trace.skel.h $(SKEL_TMP_OUT) $(LIBAPI_OUTPUT) $(LIBBPF_OUTPUT) $(LIBPERF_OUTPUT) $(LIBSUBCMD_OUTPUT): $(Q)$(MKDIR) -p $@ +ifndef LIBTRACEEVENT_DYNAMIC +$(LIBTRACEEVENT_OUTPUT) $(LIBTRACEEVENT_PLUGINS_OUTPUT): + $(Q)$(MKDIR) -p $@ +endif + ifdef BUILD_BPF_SKEL BPFTOOL := $(SKEL_TMP_OUT)/bootstrap/bpftool BPF_INCLUDE := -I$(SKEL_TMP_OUT)/.. -I$(LIBBPF_INCLUDE) @@ -1107,7 +1126,7 @@ endif # BUILD_BPF_SKEL bpf-skel-clean: $(call QUIET_CLEAN, bpf-skel) $(RM) -r $(SKEL_TMP_OUT) $(SKELETONS) -clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean $(LIBPERF)-clean fixdep-clean python-clean bpf-skel-clean tests-coresight-targets-clean +clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean $(LIBPERF)-clean fixdep-clean python-clean bpf-skel-clean tests-coresight-targets-clean libtraceevent_plugins-clean $(call QUIET_CLEAN, core-objs) $(RM) $(LIBPERF_A) $(OUTPUT)perf-archive $(OUTPUT)perf-iostat $(LANG_BINDINGS) $(Q)find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete $(Q)$(RM) $(OUTPUT).config-detected From patchwork Tue Nov 8 07:35: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: 16900 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2544368wru; Mon, 7 Nov 2022 23:37:42 -0800 (PST) X-Google-Smtp-Source: AMsMyM7y9QD+oarxcGGgtVF/q9glHzwvUNsuX3SAQtqwj/T/JOgp/Pj47hpEGXexbDmxPjaDBVJT X-Received: by 2002:a63:185c:0:b0:46f:4a36:9a6f with SMTP id 28-20020a63185c000000b0046f4a369a6fmr45693651pgy.22.1667893061870; Mon, 07 Nov 2022 23:37:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667893061; cv=none; d=google.com; s=arc-20160816; b=qynSnps0qIoyDrk3cOicSrPfozx4nfkI2c4tHq7vKlklQGA9pJYD9d0bg1Fqnc5Ou1 VaKuu7MSzsfNcF9+YxFDcojt2EY7w+s6+wGumX28GoIULbW5AF/EFySHcxcQX6sgJTt7 sdxUHdJ9IkYj5En4650LSa4hNtT2nkMdg5E/ZncD20wo9WXXPfSzEiU54jHm8lhLJo36 qWoLWndyBO6982Yvt9EAHQMX+fwAguh3On4Dzun9PgBKIIVQ5BtEZ4bqCS2wjOKy++Gv oAer+KoHVwR/tJMP3Fiagd6MYFpwN0R3tDMNgbuGUE6Fus0dm2Xipla6wbaJq8NyIpeK 5Cqw== 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=fypXC5s+GJmcY7CDMLyT+XFtNB7Xjp9TotzTIy3WOeg=; b=QjEgKzkNOYkUoKXo/0anJfwk0sXgGmAk2l3Crr6eAkI62rqbRq693TLD+oHjtGczA8 E/5vHmezcRWRdrm7uPvjwYreqMc8y7jIaDzhX+0Utf2o1iAF/8nAUrXjL2O49R5tYYrO 8MhZLl3IdqLyhxyd6IUwpjTTXM0weTm8aU9GVCkelS3KrOda4sub0WpV+yFzTvrB7FmC sJfUqiyzqfBiEmg7SGrlTTCqYmCfLRdzZ6DqRIIjDLvNaxTS/HgXRPawrB6Zv2fOoA10 RcZCj89KO/Jcaas2dQ4u53NbXtC3X3S/MoCPigAyKiPLMmDrPV7MHln/ZvjSO42EZV3z TB/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=RFQfsHnI; 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 c21-20020a170902f31500b00186f035eda3si10724087ple.579.2022.11.07.23.37.28; Mon, 07 Nov 2022 23:37:41 -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=RFQfsHnI; 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 S233513AbiKHHgo (ORCPT + 99 others); Tue, 8 Nov 2022 02:36:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233570AbiKHHg1 (ORCPT ); Tue, 8 Nov 2022 02:36:27 -0500 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DD77186EC for ; Mon, 7 Nov 2022 23:36:26 -0800 (PST) Received: by mail-yb1-xb4a.google.com with SMTP id f126-20020a255184000000b006cb2aebd124so13395442ybb.11 for ; Mon, 07 Nov 2022 23:36:26 -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=fypXC5s+GJmcY7CDMLyT+XFtNB7Xjp9TotzTIy3WOeg=; b=RFQfsHnIDHpWmCnVp7oWB/dlG/LSle5NsakxQiW831EphqfLIO67hShWTaPkaY7wfR STd+zApFgJEbyUvLuxvD4EXb/kL+iGirFD8ucU9AMzwV4ihlBrZXlnz5cjvAfw+a3nBA Je3YTYoxRrQYmHiUxjvPkx3oUXC6f2wirLFG1hMM5LPMlqV0lMe2/Bo2VW8WzpbU2l6W RMBKIMPMQt1CfBX/oBOFE38EBMoD7mJlw9kyQxNBo2Ll91Ie7BQ2Qc5x4XzeVHdtPK2k SG/m69f1Fm3xjgJavEJ3OUSWeVo2eiybuK/Nem1AyhZNQ7xScIqszLV6xxZEs+U4o4Cx kEDQ== 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=fypXC5s+GJmcY7CDMLyT+XFtNB7Xjp9TotzTIy3WOeg=; b=i/hRfgIWokMAzbwaBPtEU/sBs1UoQtjtVpT6cNPhfcNuhbl77mfQBTxqGtDAqcFESt ZFqJE2yh9ZtjTvFW+jDwdVglhQEdd+ROFPgpRAurmDGa5CHe7CiDwd2ch4ZFPFzmCq/g NP0wlqdTQj5YWRssiP8dCnQEvjrakqxlT5W4E0I0DZZ99CotLSeDefFTFe4u7FB+rVZX KcSqbLlBd3AEJmzecad6kECXsFqE7q4evTf7u9iYMntR7VvSGFjor2lUCUnV3SA8JJWr 0aFfmGZ9Gprshyy1p1W2+FBoktIuTv6NXUmxbE/Q8sMH9J8eueNQA+WOUnAwvTH+AqWP 3zng== X-Gm-Message-State: ANoB5plgmZKt92EGDDoUKM9b+VK4q4ErTE5GzuGxs8DE8mF91oqMNGxC YjiQw43LnUUY9psAtmDmnEzGmN12GGBA X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:a697:9013:186f:ed07]) (user=irogers job=sendgmr) by 2002:a25:c011:0:b0:6d0:ee14:6287 with SMTP id c17-20020a25c011000000b006d0ee146287mr15020385ybf.622.1667892985905; Mon, 07 Nov 2022 23:36:25 -0800 (PST) Date: Mon, 7 Nov 2022 23:35:11 -0800 In-Reply-To: <20221108073518.1154450-1-irogers@google.com> Message-Id: <20221108073518.1154450-8-irogers@google.com> Mime-Version: 1.0 References: <20221108073518.1154450-1-irogers@google.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Subject: [PATCH v1 07/14] tools lib api: Add missing install headers 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 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?1748912635072086744?= X-GMAIL-MSGID: =?utf-8?q?1748912635072086744?= Headers necessary for the perf build. Signed-off-by: Ian Rogers --- tools/lib/api/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/lib/api/Makefile b/tools/lib/api/Makefile index 6629d0fd0130..3e5ef1e0e890 100644 --- a/tools/lib/api/Makefile +++ b/tools/lib/api/Makefile @@ -103,7 +103,10 @@ install_headers: $(call QUIET_INSTALL, headers) \ $(call do_install,cpu.h,$(prefix)/include/api,644); \ $(call do_install,debug.h,$(prefix)/include/api,644); \ - $(call do_install,io.h,$(prefix)/include/api,644); + $(call do_install,io.h,$(prefix)/include/api,644); \ + $(call do_install,fd/array.h,$(prefix)/include/api/fd,644); \ + $(call do_install,fs/fs.h,$(prefix)/include/api/fs,644); + $(call do_install,fs/tracing_path.h,$(prefix)/include/api/fs,644); install: install_lib install_headers From patchwork Tue Nov 8 07:35:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 16902 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2544429wru; Mon, 7 Nov 2022 23:37:55 -0800 (PST) X-Google-Smtp-Source: AMsMyM6/wUzNtN0vVav5Sg1cfgLdU07ym2TW4YMKpi1Hr0nTNvmiMP6QTlJjvvIL/C+gqIRCYib7 X-Received: by 2002:a17:902:da8e:b0:186:9869:adfa with SMTP id j14-20020a170902da8e00b001869869adfamr55877431plx.57.1667893074937; Mon, 07 Nov 2022 23:37:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667893074; cv=none; d=google.com; s=arc-20160816; b=H6rfflWffJNowRAM5j2melh+d/LUPjGyBfTLRfLGVRof+w7XW0LIK+eqvT8I7YUegB nNS0PacXVWfVdX1Zg86FV1o9BPwsnJ5ovo28eWvnQiiCYRt0ZwJm96bQD9VCXfkpuwRP herldiPbQbbjof1HKNoVF+6Na6ZxP/pKIqqBd+6njSqaUO/AYoxRX+ImDhuQx9s5m+WZ EJOH/jdeGovRHcJqdYPffziRHYLA8OIzmRFPxg+3CjuWrRsJFhW2apcd5XIHukl/qmYQ 4mzAZcOFb0FAe77ddKF6ke/psmePY0KilHYUqMgB+amb+x28mdmxSeKA5vN0OND39l/I ECJA== 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=lT5QMmKiixUc4hOkx2B5agh6ifSSv8GoT3OYojEFayc=; b=uUqCVRD70XQucFC/rUCxg17oXGGtEntxHhM1+zIQ7HtE3ZEDgOwHKLYX4dgX7EanoN XvD+ReH5+AFKOAL0CPXAZU99DYdtsJ+S/Px1sBT7hKbarLW0ZYB7T22GOPQeRnCW7w8S vm6x1qKt8O93+KdZPZcmktnf4fcD0YrqCGc2uVTv9cUoFb6ejlrUoUgzhn8lcc6btssI 8BK//t6wFuA4MuUn+5WqjseEDSDwSGG6ot0uPxDrfMfbRAxokoJdkqul0OhVzzZw0ccm bEuAZcCgqIi2fJa68FLF8vAYYic5b4ds2roJ314vOmGH0dTqVLh70nPgrx08v0GaGjmC tqYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=D5rnSL7f; 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 j191-20020a6380c8000000b0046fed90eb2esi12703240pgd.429.2022.11.07.23.37.42; Mon, 07 Nov 2022 23:37:54 -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=D5rnSL7f; 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 S233633AbiKHHgz (ORCPT + 99 others); Tue, 8 Nov 2022 02:36:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233590AbiKHHgk (ORCPT ); Tue, 8 Nov 2022 02:36:40 -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 7EE382F00E for ; Mon, 7 Nov 2022 23:36:34 -0800 (PST) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-37010fefe48so129832787b3.19 for ; Mon, 07 Nov 2022 23:36:34 -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=lT5QMmKiixUc4hOkx2B5agh6ifSSv8GoT3OYojEFayc=; b=D5rnSL7fwnZjkagsZnhZ1GdO69qsrJGRorN4KrU99em/5NRO9j579+EPkMVFKodeyS sm1wLT1PqrTnTtXCHVlBvAZdKjpM8wS/5EyH8nA1Z9zzB6L/dNV0fQQ9pJVyixq1vza3 s9acRiPe03RM2hsKVayAbi7thy7z89CNKDaHX4XZMjUKiKCeX3caYI/LABcb1M3lF31O LLTkVxZZfTYGA9YwJlepJGkApQ0KcffUe+kJ5gLez8VPPy//BO4y2qls0JQi2Li7bxDJ 8qsfDfoXAH8KeweDpmrAVAPqL+z1B08rDsi711HzPQ2l8w2wgAn9T5llDyqNxaz2oycl VoWg== 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=lT5QMmKiixUc4hOkx2B5agh6ifSSv8GoT3OYojEFayc=; b=ZILE5e8Gf2bRKLi/duFeI+2ePrEkWbZB/9vetN21tDGyCZ6NzXTNTzoFO5fcqYjhfZ SaB2n79HCfqyJkGet/sAYANajGwo30GwK0SJf+xPxbTzfZAY0QLEgvYOUe4yjVlHUwJq n7PnJCPG+py2zlJBPB7gz+abSQc8diPfgUzhIXrFd5ZY0sn+1rYUDSJDYqyI6uvIFpm8 rw9hewm0O79MiFQNauATVXM8g7fYUgCYznMBsVO9Rb11MK0Ze7H6BUcLOl9uIeDeWdWM 8iY+5fD2+h6EsnawnPgpNot3fy1599cRyqOtA30+Ff/om7zQS6bbVwwHhClJ0RzJGcAj 50yg== X-Gm-Message-State: ACrzQf1UkO3iZohWojQsKyDIpsvHis7mG2xuhcpC0/bZaBYt/m7TeRFY dC686fvTi4Xj5tctoBBuNwRmTIS2kfGv X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:a697:9013:186f:ed07]) (user=irogers job=sendgmr) by 2002:a81:ae1a:0:b0:373:5466:d6f1 with SMTP id m26-20020a81ae1a000000b003735466d6f1mr32891682ywh.298.1667892993842; Mon, 07 Nov 2022 23:36:33 -0800 (PST) Date: Mon, 7 Nov 2022 23:35:12 -0800 In-Reply-To: <20221108073518.1154450-1-irogers@google.com> Message-Id: <20221108073518.1154450-9-irogers@google.com> Mime-Version: 1.0 References: <20221108073518.1154450-1-irogers@google.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Subject: [PATCH v1 08/14] tools lib perf: Add missing install headers 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 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?1748912648909524140?= X-GMAIL-MSGID: =?utf-8?q?1748912648909524140?= Headers necessary for the perf build. Note, internal headers are also installed as these are necessary for the build. Signed-off-by: Ian Rogers --- tools/lib/perf/Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/lib/perf/Makefile b/tools/lib/perf/Makefile index 21df023a2103..1badc0a04676 100644 --- a/tools/lib/perf/Makefile +++ b/tools/lib/perf/Makefile @@ -189,13 +189,21 @@ install_lib: libs install_headers: $(call QUIET_INSTALL, headers) \ + $(call do_install,include/perf/bpf_perf.h,$(prefix)/include/perf,644); \ $(call do_install,include/perf/core.h,$(prefix)/include/perf,644); \ $(call do_install,include/perf/cpumap.h,$(prefix)/include/perf,644); \ $(call do_install,include/perf/threadmap.h,$(prefix)/include/perf,644); \ $(call do_install,include/perf/evlist.h,$(prefix)/include/perf,644); \ $(call do_install,include/perf/evsel.h,$(prefix)/include/perf,644); \ $(call do_install,include/perf/event.h,$(prefix)/include/perf,644); \ - $(call do_install,include/perf/mmap.h,$(prefix)/include/perf,644); + $(call do_install,include/perf/mmap.h,$(prefix)/include/perf,644); \ + $(call do_install,include/internal/cpumap.h,$(prefix)/include/internal,644); \ + $(call do_install,include/internal/evlist.h,$(prefix)/include/internal,644); \ + $(call do_install,include/internal/evsel.h,$(prefix)/include/internal,644); \ + $(call do_install,include/internal/lib.h,$(prefix)/include/internal,644); \ + $(call do_install,include/internal/mmap.h,$(prefix)/include/internal,644); \ + $(call do_install,include/internal/threadmap.h,$(prefix)/include/internal,644); \ + $(call do_install,include/internal/xyarray.h,$(prefix)/include/internal,644); install_pkgconfig: $(LIBPERF_PC) $(call QUIET_INSTALL, $(LIBPERF_PC)) \ From patchwork Tue Nov 8 07:35:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 16903 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2544493wru; Mon, 7 Nov 2022 23:38:05 -0800 (PST) X-Google-Smtp-Source: AMsMyM54hfR5Q6ycraXPZCi/msATO94IqO6+89t+8oNO22Ak5Iq4Oc1jF/0ClslZY/pN84SRBSRZ X-Received: by 2002:a17:903:11c7:b0:178:afa2:43fd with SMTP id q7-20020a17090311c700b00178afa243fdmr54765811plh.126.1667893085674; Mon, 07 Nov 2022 23:38:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667893085; cv=none; d=google.com; s=arc-20160816; b=Ft1BobITQYCer3+Te5wcewtVXVG26+PJG8FZlj68wfwM5+B3QHJG2w2GY4eFjhb6jM VocyqzE5OCwqaaVZCxwWcj1mhzNz0YJxPzdR4IqlOuMrNa8KFLx5yIFyGbv44mSR70rh dLIvqgmo0qOHrXhwh3Nv5nj+Ylr451y/9LYeoKMsJujO+1Z7IzPm92+mZRpf9YaihcS+ sr+xY8qN5WsD/JSrIWkDWtGiuf7ZD2JdiFUpIUvCk+uYYl2M4Sk7hehEsLSgkyvXESVJ muw1ArSqdQvRdcAxDOa3liC3WH4dhyTrpeaxmrHERJAY5AluUMgxOIW1K+jyvqQx95/n bhZg== 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=muU+zEa3MJNYALn8xXqWOElORRD713Llcp74WiFN9WY=; b=moEOHI3ja+6cgkIt7INK/Jiyuf5+9rIcB7ApRDjpPQsSUxyJ45Ob+PAMuC/WmbEqaM EeMBtpA9gkDZCKknBnKFe0AXvqlaMSk6XUJQfL3xzdV1KSMufRqsELZ8VAKfJLkGtjXn qBE411CxBots0UE9VZjX5wEsBouKXwGlyZ1SnLRCtBfnPJA2Cx2QRk0QTpXs0RtCPpIe qqfmwrK/mzHyuKXkOe+x19tHFyNQ2XDmKLwrh1ke7S3GJOd4hW3oZioHjYcI9Sey3GRV qnRb0Ev3otN+jTk8TiQjdTUcJM47SZk05GuxPKAUWthYPOjkK4av0z9w/j7tsurUk3Yf ddIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="s92/M/iZ"; 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 g14-20020a63f40e000000b0045b22d763a3si13495825pgi.483.2022.11.07.23.37.51; Mon, 07 Nov 2022 23:38:05 -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="s92/M/iZ"; 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 S233651AbiKHHhK (ORCPT + 99 others); Tue, 8 Nov 2022 02:37:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233616AbiKHHgv (ORCPT ); Tue, 8 Nov 2022 02:36:51 -0500 Received: from mail-pj1-x104a.google.com (mail-pj1-x104a.google.com [IPv6:2607:f8b0:4864:20::104a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9BC726AC6 for ; Mon, 7 Nov 2022 23:36:42 -0800 (PST) Received: by mail-pj1-x104a.google.com with SMTP id p1-20020a17090a2c4100b00212733d7aaaso6572139pjm.4 for ; Mon, 07 Nov 2022 23:36:42 -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=muU+zEa3MJNYALn8xXqWOElORRD713Llcp74WiFN9WY=; b=s92/M/iZnB81De9qQ/B8+ANBxDA6WVzJALt2qoWR4RIT83TBf13yHEF85BYlgiusVz G4NmPsuDzNQh9XYIIZgz6RwzJyhghjdBDLl/ftSV+vdDNqvbBquyRzkve5rg1YDT4WYp z/4+zAXpC1i9uGUP2mDcZfWxNvYvVLE8HGlRgSwFLNwKQEP/INDhHeHEf/lL+knSj/4R +94JahGlY3OYRawNbAAi/b1k6PihXr/Ro0PXMRXRfOBQtJzOJnQnNl7pYwd8iDqLnxP0 xnp7z9gU1eq2u7UQqlfe51MNNnfG9juYdZkvC+YQIKvDpOJSGeadD70SoNAzDKRo9QoS uBvQ== 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=muU+zEa3MJNYALn8xXqWOElORRD713Llcp74WiFN9WY=; b=Dzk3SLgJYzrPmyg2VkQpQsSFzNdMAvCZgi/a3upkYzdY93WusVpg1kpQSW3FiOYkIm tTTa/V7v3mj1hgcoH9YGiUB+vWkmLWySqk/XqVmuGAvRiIsidIkeS5oetbADOJizBCsP EPdC+OLdqXkPi7x7fxBBPcAZLc/0NOyXF0UbZOtL5LN1qm/Bz4NwOJzpIqlN3XGQ5BEv 5lopDZXyMNHxG4URtDQ06QVa6dj0kPFme+YktiMu754JEHYCfnOdifEDSzz1tg9nQDko 8TqpqMqRS3pHLFzHSVJJt57pLwKL91k0r3QCq8wQC9/DRlrhcnX5bjFrhUozeampODDT YikA== X-Gm-Message-State: ACrzQf0peEszUyKrupfaEWqxqnoAkj/a6lbnhJOXewR2QGSkHPjF5NEp OBxVD0BPgvH4jkBIGHT+EunWHjd7ouzf X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:a697:9013:186f:ed07]) (user=irogers job=sendgmr) by 2002:a17:902:e40c:b0:186:5bbc:2ad9 with SMTP id m12-20020a170902e40c00b001865bbc2ad9mr952636ple.157.1667893002263; Mon, 07 Nov 2022 23:36:42 -0800 (PST) Date: Mon, 7 Nov 2022 23:35:13 -0800 In-Reply-To: <20221108073518.1154450-1-irogers@google.com> Message-Id: <20221108073518.1154450-10-irogers@google.com> Mime-Version: 1.0 References: <20221108073518.1154450-1-irogers@google.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Subject: [PATCH v1 09/14] tool lib symbol: Add Makefile/Build 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 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=unavailable 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?1748912659988044323?= X-GMAIL-MSGID: =?utf-8?q?1748912659988044323?= Add sufficient Makefile for libsymbol to be built as a dependency and header files installed. Signed-off-by: Ian Rogers --- tools/lib/symbol/Build | 1 + tools/lib/symbol/Makefile | 115 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 tools/lib/symbol/Build create mode 100644 tools/lib/symbol/Makefile diff --git a/tools/lib/symbol/Build b/tools/lib/symbol/Build new file mode 100644 index 000000000000..9b9a9c78d3c9 --- /dev/null +++ b/tools/lib/symbol/Build @@ -0,0 +1 @@ +libsymbol-y += kallsyms.o diff --git a/tools/lib/symbol/Makefile b/tools/lib/symbol/Makefile new file mode 100644 index 000000000000..4c1d6b53032d --- /dev/null +++ b/tools/lib/symbol/Makefile @@ -0,0 +1,115 @@ +# SPDX-License-Identifier: GPL-2.0 +include ../../scripts/Makefile.include +include ../../scripts/utilities.mak # QUIET_CLEAN + +ifeq ($(srctree),) +srctree := $(patsubst %/,%,$(dir $(CURDIR))) +srctree := $(patsubst %/,%,$(dir $(srctree))) +srctree := $(patsubst %/,%,$(dir $(srctree))) +#$(info Determined 'srctree' to be $(srctree)) +endif + +CC ?= $(CROSS_COMPILE)gcc +AR ?= $(CROSS_COMPILE)ar +LD ?= $(CROSS_COMPILE)ld + +MAKEFLAGS += --no-print-directory + +INSTALL = install + + +# Use DESTDIR for installing into a different root directory. +# This is useful for building a package. The program will be +# installed in this directory as if it was the root directory. +# Then the build tool can move it later. +DESTDIR ?= +DESTDIR_SQ = '$(subst ','\'',$(DESTDIR))' + +LIBFILE = $(OUTPUT)libsymbol.a + +CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) +CFLAGS += -ggdb3 -Wall -Wextra -std=gnu11 -U_FORTIFY_SOURCE -fPIC + +ifeq ($(DEBUG),0) +ifeq ($(CC_NO_CLANG), 0) + CFLAGS += -O3 +else + CFLAGS += -O6 +endif +endif + +ifeq ($(DEBUG),0) + CFLAGS += -D_FORTIFY_SOURCE +endif + +# Treat warnings as errors unless directed not to +ifneq ($(WERROR),0) + CFLAGS += -Werror +endif + +CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 + +CFLAGS += -I$(srctree)/tools/lib +CFLAGS += -I$(srctree)/tools/include + +RM = rm -f + +SYMBOL_IN := $(OUTPUT)libsymbol-in.o + +ifeq ($(LP64), 1) + libdir_relative = lib64 +else + libdir_relative = lib +endif + +prefix ?= +libdir = $(prefix)/$(libdir_relative) + +# Shell quotes +libdir_SQ = $(subst ','\'',$(libdir)) + +all: + +export srctree OUTPUT CC LD CFLAGS V +include $(srctree)/tools/build/Makefile.include +include $(srctree)/tools/scripts/Makefile.include + +all: fixdep $(LIBFILE) + +$(SYMBOL_IN): FORCE + $(MAKE) $(build)=libsymbol V=1 + +$(LIBFILE): $(SYMBOL_IN) + $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(SYMBOL_IN) + +define do_install_mkdir + if [ ! -d '$(DESTDIR_SQ)$1' ]; then \ + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$1'; \ + fi +endef + +define do_install + if [ ! -d '$(DESTDIR_SQ)$2' ]; then \ + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$2'; \ + fi; \ + $(INSTALL) $1 $(if $3,-m $3,) '$(DESTDIR_SQ)$2' +endef + +install_lib: $(LIBFILE) + $(call QUIET_INSTALL, $(LIBFILE)) \ + $(call do_install_mkdir,$(libdir_SQ)); \ + cp -fpR $(LIBFILE) $(DESTDIR)$(libdir_SQ) + +install_headers: + $(call QUIET_INSTALL, headers) \ + $(call do_install,kallsyms.h,$(prefix)/include/symbol,644); + +install: install_lib install_headers + +clean: + $(call QUIET_CLEAN, libsymbol) $(RM) $(LIBFILE); \ + find $(or $(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM) + +FORCE: + +.PHONY: clean FORCE From patchwork Tue Nov 8 07:35:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 16904 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2544592wru; Mon, 7 Nov 2022 23:38:19 -0800 (PST) X-Google-Smtp-Source: AMsMyM4rFmhI0sNI1873CJS/A86JvmbVSEduZW3mZISETsCbNZwlbGx1s0Pb39w6bW5lajPlHfTc X-Received: by 2002:a17:90b:3ecd:b0:213:faa9:4b13 with SMTP id rm13-20020a17090b3ecd00b00213faa94b13mr41879387pjb.124.1667893099230; Mon, 07 Nov 2022 23:38:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667893099; cv=none; d=google.com; s=arc-20160816; b=IkscaaBzq0zyfcXZIrfoHR/gd+S/c7jof27owU10pJ/GkUiRICss9kfLgIE4cVnMA5 3aCszDpItyfUK98/9xyhRfeJCCrQ4zi97DRIzvblDlZ2xM8FoR3LoG5h5U1fn484dSK2 sP9Z62tLw6shZpRgvHB97t925Vv3rsDRVtFrn32DK4CoN3bom1hliMrgQndF+YOLoNIs XOEp8FHjNVi/NySNxYS1IvvIS/K8tC7VsdPgmdq2H6/PZ1KBIZctlToWw0NZjpKP5uS0 jCQEEyC+XuJIzrQx8VeCKehVqayK5fbydCo+6h7oiUzrLugyQwXFRqmyrfdz+Tw8B3mh Axyg== 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=BWHBnleM/U+ALy+KZuJ6Xy7hOJ7pkM7npKBk7OqW5V4=; b=bBgnkdQjsCXuwi3Bz9ppXKoR4IGj3y4oAhB4Wi2Mea/8qpwHWLpznSIs+d8XMa8h44 GlOTm7F8rPuTpEto03EalE/ZaW5L9PB9YmlLty4xVMv2osWggMMZ5JSVd+KFv1O4iTn4 UkHeYCc+eQF8p/U87NDEcvaq7nDjF2sCuKIW8scUEugeKtHkvkQIrlf6T3WvkCpgbfsJ cE8ypZ6XRFrk0ztDtieN6xe2tZlHK6972ds+0DBkwW73cQFZc91eTgxBAZhBGsfyovPo jmfBzyDotFfYUDEaKHmiXjRpORlbOY0V49ILnVZn7EswfYBzqOE8+iTuVG/pvqSn1qWY 91fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="D8qndW/c"; 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 p35-20020a634f63000000b00442e77a852bsi14101946pgl.457.2022.11.07.23.38.01; Mon, 07 Nov 2022 23:38:19 -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="D8qndW/c"; 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 S232548AbiKHHhW (ORCPT + 99 others); Tue, 8 Nov 2022 02:37:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233631AbiKHHgy (ORCPT ); Tue, 8 Nov 2022 02:36:54 -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 71E832A416 for ; Mon, 7 Nov 2022 23:36:52 -0800 (PST) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-36bf9c132f9so129328567b3.8 for ; Mon, 07 Nov 2022 23:36:52 -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=BWHBnleM/U+ALy+KZuJ6Xy7hOJ7pkM7npKBk7OqW5V4=; b=D8qndW/cQLD55TMxBie/sblq1Jb5A2qhrqh1hSKQ5uTr300QOnou6RNSlnNfDdVkaK om6LuWKDEgv0Wp9dRiI3Q5+QLcKIUfFjJeODPcWvs+tKJcci/xJewQrY0vUSKG40fLHg 8R/19PebzLeYbknSDk4WeFEJt/0Blrl0LUcIvrOJgvLyQr7sFFhUsOfF3zNVGTtl5wId L6d61KnxC0StQ+18muwJ7H9aPnTHXUNR0kLRwo1wK1LmsY2HUsb9VdcAD/kxEb/7Id64 zLes4pTIRE05zL4cfzMIRAGo5iHQpEihSq7hYYiHi8P95gRyidxkNfXuqQhuRge91c+T MSrw== 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=BWHBnleM/U+ALy+KZuJ6Xy7hOJ7pkM7npKBk7OqW5V4=; b=mEQLpM96bFOfho3v8qZNMSj73QJicScxsFBjkhzPLFnJiWar6VnwX/jMVV+87BHPE+ cZTeP+bV0HGNupSd3HjsRhjBdGRUbpkSKMVPOHYhOpXXqxZZVov7l9X38v7lU58feAyo 75eu+3JuFhD8VzAy45ma+1slNhCfNL1/t2/AQpHCKW77Gtt1gqhMUf3ge2cKObY054xK Yhxg2kSqka75Kh8Ve7J1hcBqOFQvGRdJQE69/VEZ8Cpn8O19+SEDBseHx+kUtGdGolMQ NA4OVfUo0KSCa4nQg5Plfh/Rs8YWnQiJ2xuqQ1p69J2RS8mHggLHYqrngROHHzm+n8U1 HwrA== X-Gm-Message-State: ACrzQf3OdPznGQdXZHPFK42beTwLIkJQadvyNz9yF28HDGYMbSL/ib77 OFdCvzGABDGDBivH3bYzcMP3dGKD0nfl X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:a697:9013:186f:ed07]) (user=irogers job=sendgmr) by 2002:a5b:110:0:b0:6be:3546:b761 with SMTP id 16-20020a5b0110000000b006be3546b761mr53163291ybx.203.1667893011731; Mon, 07 Nov 2022 23:36:51 -0800 (PST) Date: Mon, 7 Nov 2022 23:35:14 -0800 In-Reply-To: <20221108073518.1154450-1-irogers@google.com> Message-Id: <20221108073518.1154450-11-irogers@google.com> Mime-Version: 1.0 References: <20221108073518.1154450-1-irogers@google.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Subject: [PATCH v1 10/14] perf build: Install libsymbol locally when building 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 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=unavailable 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?1748912674697016718?= X-GMAIL-MSGID: =?utf-8?q?1748912674697016718?= The perf build currently has a '-Itools/lib' on the CC command line. This causes issues as the libapi, libsubcmd, libtraceevent, libbpf and libsymbol headers are all found via this path, making it impossible to override include behavior. Change the libsymbol build mirroring the libbpf, libsubcmd, libapi, libperf and libtraceevent build, so that it is installed in a directory along with its headers. A later change will modify the include behavior. Don't build kallsyms.o as part of util as this will lead to duplicate definitions. Signed-off-by: Ian Rogers --- tools/perf/.gitignore | 1 + tools/perf/Makefile.perf | 25 ++++++++++++++++++++++--- tools/perf/util/Build | 5 ----- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/tools/perf/.gitignore b/tools/perf/.gitignore index 65b995159cf1..675c03ec1f1c 100644 --- a/tools/perf/.gitignore +++ b/tools/perf/.gitignore @@ -42,6 +42,7 @@ libapi/ libbpf/ libperf/ libsubcmd/ +libsymbol/ libtraceevent/ libtraceevent_plugins/ fixdep diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 537ac7055a35..1d90d78303b4 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -246,6 +246,7 @@ LIBTRACEEVENT_DIR = $(srctree)/tools/lib/traceevent/ LIBTRACEEVENT_PLUGINS_DIR = $(LIBTRACEEVENT_DIR)/plugins LIBBPF_DIR = $(srctree)/tools/lib/bpf/ LIBSUBCMD_DIR = $(srctree)/tools/lib/subcmd/ +LIBSYMBOL_DIR = $(srctree)/tools/lib/symbol/ LIBPERF_DIR = $(srctree)/tools/lib/perf/ DOC_DIR = $(srctree)/tools/perf/Documentation/ @@ -340,6 +341,15 @@ LIBSUBCMD_DESTDIR = $(LIBSUBCMD_OUTPUT) LIBSUBCMD_INCLUDE = $(LIBSUBCMD_DESTDIR)/include LIBSUBCMD = $(LIBSUBCMD_OUTPUT)/libsubcmd.a +ifneq ($(OUTPUT),) + LIBSYMBOL_OUTPUT = $(abspath $(OUTPUT))/libsymbol +else + LIBSYMBOL_OUTPUT = $(CURDIR)/libsymbol +endif +LIBSYMBOL_DESTDIR = $(LIBSYMBOL_OUTPUT) +LIBSYMBOL_INCLUDE = $(LIBSYMBOL_DESTDIR)/include +LIBSYMBOL = $(LIBSYMBOL_OUTPUT)/libsymbol.a + ifneq ($(OUTPUT),) LIBPERF_OUTPUT = $(abspath $(OUTPUT))/libperf else @@ -398,7 +408,7 @@ endif export PERL_PATH -PERFLIBS = $(LIBAPI) $(LIBSUBCMD) $(LIBPERF) +PERFLIBS = $(LIBAPI) $(LIBPERF) $(LIBSUBCMD) $(LIBSYMBOL) ifndef NO_LIBBPF ifndef LIBBPF_DYNAMIC PERFLIBS += $(LIBBPF) @@ -887,6 +897,15 @@ $(LIBSUBCMD)-clean: $(call QUIET_CLEAN, libsubcmd) $(Q)$(RM) -r -- $(LIBSUBCMD_OUTPUT) +$(LIBSYMBOL): FORCE | $(LIBSYMBOL_OUTPUT) + $(Q)$(MAKE) -C $(LIBSYMBOL_DIR) O=$(LIBSYMBOL_OUTPUT) \ + DESTDIR=$(LIBSYMBOL_DESTDIR) prefix= \ + $@ install_headers + +$(LIBSYMBOL)-clean: + $(call QUIET_CLEAN, libsymbol) + $(Q)$(RM) -r -- $(LIBSYMBOL_OUTPUT) + help: @echo 'Perf make targets:' @echo ' doc - make *all* documentation (see below)' @@ -1076,7 +1095,7 @@ SKELETONS += $(SKEL_OUT)/bperf_cgroup.skel.h $(SKEL_OUT)/func_latency.skel.h SKELETONS += $(SKEL_OUT)/off_cpu.skel.h $(SKEL_OUT)/lock_contention.skel.h SKELETONS += $(SKEL_OUT)/kwork_trace.skel.h -$(SKEL_TMP_OUT) $(LIBAPI_OUTPUT) $(LIBBPF_OUTPUT) $(LIBPERF_OUTPUT) $(LIBSUBCMD_OUTPUT): +$(SKEL_TMP_OUT) $(LIBAPI_OUTPUT) $(LIBBPF_OUTPUT) $(LIBPERF_OUTPUT) $(LIBSUBCMD_OUTPUT) $(LIBSYMBOL_OUTPUT): $(Q)$(MKDIR) -p $@ ifndef LIBTRACEEVENT_DYNAMIC @@ -1126,7 +1145,7 @@ endif # BUILD_BPF_SKEL bpf-skel-clean: $(call QUIET_CLEAN, bpf-skel) $(RM) -r $(SKEL_TMP_OUT) $(SKELETONS) -clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean $(LIBPERF)-clean fixdep-clean python-clean bpf-skel-clean tests-coresight-targets-clean libtraceevent_plugins-clean +clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean $(LIBSYMBOL)-clean $(LIBPERF)-clean fixdep-clean python-clean bpf-skel-clean tests-coresight-targets-clean libtraceevent_plugins-clean $(call QUIET_CLEAN, core-objs) $(RM) $(LIBPERF_A) $(OUTPUT)perf-archive $(OUTPUT)perf-iostat $(LANG_BINDINGS) $(Q)find $(or $(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete $(Q)$(RM) $(OUTPUT).config-detected diff --git a/tools/perf/util/Build b/tools/perf/util/Build index e315ecaec323..45f3d2723725 100644 --- a/tools/perf/util/Build +++ b/tools/perf/util/Build @@ -19,7 +19,6 @@ perf-y += perf_event_attr_fprintf.o perf-y += evswitch.o perf-y += find_bit.o perf-y += get_current_dir_name.o -perf-y += kallsyms.o perf-y += levenshtein.o perf-y += llvm-utils.o perf-y += mmap.o @@ -294,10 +293,6 @@ CFLAGS_expr.o += -Wno-redundant-decls CFLAGS_header.o += -include $(OUTPUT)PERF-VERSION-FILE CFLAGS_arm-spe.o += -I$(srctree)/tools/arch/arm64/include/ -$(OUTPUT)util/kallsyms.o: ../lib/symbol/kallsyms.c FORCE - $(call rule_mkdir) - $(call if_changed_dep,cc_o_c) - $(OUTPUT)util/argv_split.o: ../lib/argv_split.c FORCE $(call rule_mkdir) $(call if_changed_dep,cc_o_c) From patchwork Tue Nov 8 07:35:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 16905 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2544731wru; Mon, 7 Nov 2022 23:38:39 -0800 (PST) X-Google-Smtp-Source: AMsMyM7gq9uVtPIJBKYtZX/gefjCyTj0zNLTjm564uyONSV2XnBFv853I91SQFJu0WY9NF5jkVFN X-Received: by 2002:a17:902:ced1:b0:186:b18a:d0d5 with SMTP id d17-20020a170902ced100b00186b18ad0d5mr55436470plg.60.1667893119129; Mon, 07 Nov 2022 23:38:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667893119; cv=none; d=google.com; s=arc-20160816; b=CNiTkQUSqbk2dLroSvv8gzPAcjx1oioO8pNY1TpDSe8lWjUoxn39C2lsa3OUsQKMow GalVsLfJdPlYMPYE59lyWOipG9YVt+48zVhqU95QPoBj8TMnz30Qycy8nc8p2iJtqRT9 EOGkzLWMC/wRAEfttJ5o4Ds5GJZyTONSGydCVqRRslbVVix7vd5ymuJ0sMhGntPSQUg3 LYICNxwqvFqqr+QC/FNKxVj7dZyhGOW/A3FJI/fGD1zvEW8yCcfGL06UHmFEkW05qZv4 S6gbnwMivhx6R7cNHGUJl/s0fkFdu4waOWHqmBxLLInUwP+pXFfk+2mBiITz1pdx7QGH W2Ng== 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=0ig4l2ipqQRcuxZUCV8QGPuQA2SRfsl5B/KVZE9nXHU=; b=vZONyuv1Srq2Wt045o3y+vTheYWUojk081Ud+khsSobzkAsm5S8HJtDv0sLtHfIpnb e4Jf+5C38MwZ2fU86bZ6WDhn5NeQfX2vM/PLHbgb4e3V8n4idAXfsWiNKEDmDWEyXQbG fxZycbiRN/Dj2/yfm+CaSzD/Rg5zva6xcRL7M02R062XSwkJbubUqCJEr83M/O/kw6tH n8q6ts0fxUUO9UGe30ykr4tiG1sQDUJeIKMDk7GMqMi3aOj0IDqxWozNiIgqQvQyXMAr +RczIfvsUntFCVcX508A7O4ATBK4tNU3Lq3rJi2V2Qm7vPWrJja5o8jC+qMfRflqsVYK QPeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=f5+cgbH+; 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 p28-20020a056a000a1c00b00536ee478380si15168674pfh.7.2022.11.07.23.38.26; Mon, 07 Nov 2022 23:38:39 -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=f5+cgbH+; 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 S233691AbiKHHh2 (ORCPT + 99 others); Tue, 8 Nov 2022 02:37:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233527AbiKHHhB (ORCPT ); Tue, 8 Nov 2022 02:37:01 -0500 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88DEC326DE for ; Mon, 7 Nov 2022 23:37:00 -0800 (PST) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-349423f04dbso130639217b3.13 for ; Mon, 07 Nov 2022 23:37:00 -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=0ig4l2ipqQRcuxZUCV8QGPuQA2SRfsl5B/KVZE9nXHU=; b=f5+cgbH+7Iy/kQMhz2Ss4kNkLwzOc61RPvlR7cP3Vuczg9OwBZ7Ho9ipmpcesN9ydb xXABppTLCLTp7pgW1nav/llJ7UtXv8+C4FdOhRB7MR0heNmwcDcjdYLVL3iMKZMN97zI 0xs/fJRZauIpxcwYX3K4sxfLG+wF5nr4GzUfphybcMCsCnUtgORnAuvgkKJzyuC+qUA0 gFGEb+Vc+ZekhsAMvkM08VN7s8A2YFdDM+QivmxqPcTjqImPA4GHRfYdvJzbk+wOn7/K 9uHiioNCea7AEqob1KJ6Gup91SFhEEnRtutyEJvVfsdnuwEtVIIzaaiJaNln1aMHTDyq cBgA== 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=0ig4l2ipqQRcuxZUCV8QGPuQA2SRfsl5B/KVZE9nXHU=; b=oE9yW5+gCWwAu+jPMpuK+4tL0+YUQaVISSsf+YDUABHfeGLzI0m45YTM0RzUujspoY Pi0T0CV778+TN7UiV22PL25kSOQsLEohSnfgaRBbJRakW4Woazj6MU92ipDK7InpSj84 Wg3ZML+u7SZmY7Pmn5TsqgdylSAJ/SppN6JM8DYbJAe3pQaZ6CMYVygNoUTu500T8hCZ jAdS7GYvJ+VqVgItrSah3A+SnKlJHD5MgR9MQHr+zmOGyUsSUg0isiIskH9qRAn5wez5 MSeF1eYNOlu0HtiY4DSUKcIsBFODr47QaBhWeNGVkbr0UpS/MM+WbFCSkzw/+51eNERL MpqQ== X-Gm-Message-State: ACrzQf2OAQ4/jxV8z2XFar3vrqjCBKBj4QnzTFNQ4qNhTHdEp9HaOhTF co2F9vIRNWCCgXRVPiiifaMeclZhnQMX X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:a697:9013:186f:ed07]) (user=irogers job=sendgmr) by 2002:a05:6902:128d:b0:695:818e:3996 with SMTP id i13-20020a056902128d00b00695818e3996mr52680112ybu.499.1667893019871; Mon, 07 Nov 2022 23:36:59 -0800 (PST) Date: Mon, 7 Nov 2022 23:35:15 -0800 In-Reply-To: <20221108073518.1154450-1-irogers@google.com> Message-Id: <20221108073518.1154450-12-irogers@google.com> Mime-Version: 1.0 References: <20221108073518.1154450-1-irogers@google.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Subject: [PATCH v1 11/14] perf expr: Tidy hashmap dependency 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 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=unavailable 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?1748912695150436535?= X-GMAIL-MSGID: =?utf-8?q?1748912695150436535?= hashmap.h comes from libbpf but isn't installed with its headers. Always use the header file of the code in util. Change the hashmap.h dependency in expr.h to a forward declaration, add the necessary header file includes in the C files. Signed-off-by: Ian Rogers --- tools/perf/tests/expr.c | 1 + tools/perf/tests/pmu-events.c | 1 + tools/perf/util/bpf-loader.c | 4 ---- tools/perf/util/evsel.c | 4 ---- tools/perf/util/expr.c | 1 + tools/perf/util/expr.h | 7 +------ tools/perf/util/metricgroup.c | 1 + tools/perf/util/stat-shadow.c | 1 + tools/perf/util/stat.c | 4 ---- 9 files changed, 6 insertions(+), 18 deletions(-) diff --git a/tools/perf/tests/expr.c b/tools/perf/tests/expr.c index 6512f5e22045..b6667501ebb4 100644 --- a/tools/perf/tests/expr.c +++ b/tools/perf/tests/expr.c @@ -2,6 +2,7 @@ #include "util/cputopo.h" #include "util/debug.h" #include "util/expr.h" +#include "util/hashmap.h" #include "util/header.h" #include "util/smt.h" #include "tests.h" diff --git a/tools/perf/tests/pmu-events.c b/tools/perf/tests/pmu-events.c index 5d0d3b239a68..f7b9dbbad97f 100644 --- a/tools/perf/tests/pmu-events.c +++ b/tools/perf/tests/pmu-events.c @@ -12,6 +12,7 @@ #include #include "util/evlist.h" #include "util/expr.h" +#include "util/hashmap.h" #include "util/parse-events.h" #include "metricgroup.h" #include "stat.h" diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c index f4adeccdbbcb..b3c8174360bf 100644 --- a/tools/perf/util/bpf-loader.c +++ b/tools/perf/util/bpf-loader.c @@ -27,11 +27,7 @@ #include "util.h" #include "llvm-utils.h" #include "c++/clang-c.h" -#ifdef HAVE_LIBBPF_SUPPORT -#include -#else #include "util/hashmap.h" -#endif #include "asm/bug.h" #include diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index cdde5b5f8ad2..2139e8b0e401 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -46,11 +46,7 @@ #include "string2.h" #include "memswap.h" #include "util.h" -#ifdef HAVE_LIBBPF_SUPPORT -#include -#else #include "util/hashmap.h" -#endif #include "pmu-hybrid.h" #include "off_cpu.h" #include "../perf-sys.h" diff --git a/tools/perf/util/expr.c b/tools/perf/util/expr.c index aaacf514dc09..140f2acdb325 100644 --- a/tools/perf/util/expr.c +++ b/tools/perf/util/expr.c @@ -11,6 +11,7 @@ #include "expr.h" #include "expr-bison.h" #include "expr-flex.h" +#include "util/hashmap.h" #include "smt.h" #include "tsc.h" #include diff --git a/tools/perf/util/expr.h b/tools/perf/util/expr.h index d6c1668dc1a0..029271540fb0 100644 --- a/tools/perf/util/expr.h +++ b/tools/perf/util/expr.h @@ -2,12 +2,7 @@ #ifndef PARSE_CTX_H #define PARSE_CTX_H 1 -#ifdef HAVE_LIBBPF_SUPPORT -#include -#else -#include "util/hashmap.h" -#endif - +struct hashmap; struct metric_ref; struct expr_scanner_ctx { diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c index 4c98ac29ee13..15441e9bfb73 100644 --- a/tools/perf/util/metricgroup.c +++ b/tools/perf/util/metricgroup.c @@ -28,6 +28,7 @@ #include "util.h" #include #include "cgroup.h" +#include "util/hashmap.h" struct metric_event *metricgroup__lookup(struct rblist *metric_events, struct evsel *evsel, diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c index 07b29fe272c7..9bde9224a97c 100644 --- a/tools/perf/util/stat-shadow.c +++ b/tools/perf/util/stat-shadow.c @@ -14,6 +14,7 @@ #include "units.h" #include #include "iostat.h" +#include "util/hashmap.h" /* * AGGR_GLOBAL: Use CPU 0 diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index 3a432a949d46..273a5b32e815 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c @@ -14,11 +14,7 @@ #include "evlist.h" #include "evsel.h" #include "thread_map.h" -#ifdef HAVE_LIBBPF_SUPPORT -#include -#else #include "util/hashmap.h" -#endif #include void update_stats(struct stats *stats, u64 val) From patchwork Tue Nov 8 07:35:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 16910 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2545454wru; Mon, 7 Nov 2022 23:40:54 -0800 (PST) X-Google-Smtp-Source: AMsMyM7GHiqijCzE/7j5EExBTfTWpjaVLyt96d4cf2+usYo95l2ycPU7DdsoMgmYRgPi/HU5bw2D X-Received: by 2002:a63:1521:0:b0:43c:9566:7a6a with SMTP id v33-20020a631521000000b0043c95667a6amr47040859pgl.339.1667893254225; Mon, 07 Nov 2022 23:40:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667893254; cv=none; d=google.com; s=arc-20160816; b=mfD4bP1hHErNhI+lBNtR7x4TeHOKq5ow/KN0nQ8NChy1feJODBj1FRWBQAX/8L+ZmH TT1vv+jTu1DxZzHvxHWDU7uQXGh/Lk9AR8C9DnoWbemL2HywTtyZzq1yZxlo20HAvBt/ TS7JeWkHVLwuyRNXBEsQqKOfX/j3WXAURf1lZN85jiQsbZo83qMQdTIbXWZo2eWi/utw 8t28k1O3M1qKwytr+E9ffcLFf6RD/TRisDk4HJvZYwguI/y36iBctRQ8e6YxCV7d6UKX kBJ2uStuEX3yN5dng3K2/dw1Z+w84zW8bA4XwrdRAaKSdk/zExSXE2pv+RJv0vmf6wr0 esXw== 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=mcIKP47y+JSPnlG86ZitTgFKXbNZnIlDlaeWOyIniEY=; b=kAvkvCiBIIQHyyDWp/Qy6KmO9l6STX9Ak/bWm2syAbQ/7fbaIezrMRg83A8gH7n1dR wjJwtvG1af8rwBYUtDijFXcr9yzmGxcf7hbUaWGCAj19SvscYmDbySNTMf00SsDzJLL9 xvq+9GYnUwEdxt2FWrmk1TA/0wk+jWpeo9H7JPevkIFUU8CmHn0wdge3m0gq5UtDC23c s+jX7V+a68rAmuOrbfPcSGfW8z0k97KJ9ES/qYjSATNTvqCq/0n+8Qor3E5Fu4HBPAcU Jbp0ikEDNDOdDTAC2EKCM8y5P7MgTebMeISTHQRD87rOE7nEWhifj5Ai7fEvQ3pa+A50 B11g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=BMEqfqsj; 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 w184-20020a6382c1000000b0046ebb8fc292si13401700pgd.7.2022.11.07.23.40.41; Mon, 07 Nov 2022 23:40:54 -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=BMEqfqsj; 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 S233656AbiKHHhm (ORCPT + 99 others); Tue, 8 Nov 2022 02:37:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233647AbiKHHhK (ORCPT ); Tue, 8 Nov 2022 02:37:10 -0500 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA07A32057 for ; Mon, 7 Nov 2022 23:37:08 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id h67-20020a252146000000b006ccc4702068so13436919ybh.12 for ; Mon, 07 Nov 2022 23:37:08 -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=mcIKP47y+JSPnlG86ZitTgFKXbNZnIlDlaeWOyIniEY=; b=BMEqfqsjTeaurfuCtzDjeW0q1DlJjsXAbVlSiJWF6mS4cGaDikyIVmW7hXbUkRIkPW UvWAdu2eu24JqRTfL0s+jvV5dTXwHqNOq9TIUN9qMWufZJfLai2rq51rnM92BzwNufQ9 Aw3eqRg7nFANy08wGWjKnI3o/1l48dQ36o+G7IpZ9i0EWrwoB84wfu05aAFalfhT8Yma HMUnB9GWxsHH9jUcZKCKj5gGbAwrrNiudjy72wClI37rzGIw6Zjd27IA4VUF9cVbRUOe NunT5LBVtrED8jJM8ywv+7FzBrvbug7O2c8iZDwIfmozF2NCetrmb1eR0bcZOk/4Q0G4 ilSg== 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=mcIKP47y+JSPnlG86ZitTgFKXbNZnIlDlaeWOyIniEY=; b=6dlbKKHvY/TQkooqefLF8zSwyoVdgo55x9oJ1g9/Ick8CQgeI0vxNjkmW/UcWvrvPy YW/25zOfg16hdJCETH4hFZluwmitMml5w27TSwPqzMrHLdaLzaOeW/Yrt6CoDVbna+9b OMp/hI96BV80/EeuGQGgyt5OYI4feUaE8jFBSroa0Cmgm33sd6eydmzLvPhrkLsJMvqY OBDFNz90XrY98F6iOtHOX+25F5c4CjrwTNwwxtap3t84IuJwlRwyc/hVWx1es08c0mfG TN4PHfPHf5XC2Fv6W9nPutzn5/964dPV6jN2bZlq/hTK0dgxBrpIrXwB2g5pjOn5Zgby 55bQ== X-Gm-Message-State: ACrzQf1pgVirYi4iR4u/Y0IJL5qB0rvbffSneoKmCsThUGjs7lA47Uuf N8ZN4Ccyf+NPwKRulZs9s54T/GohoP8U X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:a697:9013:186f:ed07]) (user=irogers job=sendgmr) by 2002:a0d:c481:0:b0:370:7a9a:564 with SMTP id g123-20020a0dc481000000b003707a9a0564mr863517ywd.278.1667893028204; Mon, 07 Nov 2022 23:37:08 -0800 (PST) Date: Mon, 7 Nov 2022 23:35:16 -0800 In-Reply-To: <20221108073518.1154450-1-irogers@google.com> Message-Id: <20221108073518.1154450-13-irogers@google.com> Mime-Version: 1.0 References: <20221108073518.1154450-1-irogers@google.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Subject: [PATCH v1 12/14] perf thread_map: Reduce exposure of libperf internal API 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 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=unavailable 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?1748912837236962492?= X-GMAIL-MSGID: =?utf-8?q?1748912837236962492?= Remove unnecessary include of internal threadmap.h and refcount.h in thread_map.h. Switch to using public APIs when possible or including the internal header file in the C file. Fix a transitive dependency in openat-syscall.c broken by the clean up. Signed-off-by: Ian Rogers --- tools/perf/builtin-stat.c | 1 + tools/perf/builtin-trace.c | 4 ++-- tools/perf/tests/openat-syscall.c | 1 + tools/perf/tests/thread-map.c | 1 + tools/perf/util/bpf_counter.c | 2 +- tools/perf/util/evsel.c | 1 + tools/perf/util/python.c | 6 +++--- tools/perf/util/scripting-engines/trace-event-python.c | 2 +- tools/perf/util/thread_map.c | 1 + tools/perf/util/thread_map.h | 2 -- 10 files changed, 12 insertions(+), 9 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index d5e1670bca20..fb2d13650e42 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -93,6 +93,7 @@ #include #include +#include #define DEFAULT_SEPARATOR " " #define FREEZE_ON_SMI_PATH "devices/cpu/freeze_on_smi" diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 72991528687e..b403f3fab2a4 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -4092,8 +4092,8 @@ static int trace__run(struct trace *trace, int argc, const char **argv) } trace->multiple_threads = perf_thread_map__pid(evlist->core.threads, 0) == -1 || - evlist->core.threads->nr > 1 || - evlist__first(evlist)->core.attr.inherit; + perf_thread_map__nr(evlist->core.threads) > 1 || + evlist__first(evlist)->core.attr.inherit; /* * Now that we already used evsel->core.attr to ask the kernel to setup the diff --git a/tools/perf/tests/openat-syscall.c b/tools/perf/tests/openat-syscall.c index 7e05b8b5cc95..131b62271bfa 100644 --- a/tools/perf/tests/openat-syscall.c +++ b/tools/perf/tests/openat-syscall.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "thread_map.h" #include "evsel.h" #include "debug.h" diff --git a/tools/perf/tests/thread-map.c b/tools/perf/tests/thread-map.c index e413c1387fcb..74308c1368fe 100644 --- a/tools/perf/tests/thread-map.c +++ b/tools/perf/tests/thread-map.c @@ -11,6 +11,7 @@ #include "util/synthetic-events.h" #include #include +#include struct perf_sample; struct perf_tool; diff --git a/tools/perf/util/bpf_counter.c b/tools/perf/util/bpf_counter.c index ef1c15e4aeba..eeee899fcf34 100644 --- a/tools/perf/util/bpf_counter.c +++ b/tools/perf/util/bpf_counter.c @@ -561,7 +561,7 @@ static int bperf__load(struct evsel *evsel, struct target *target) if (filter_type == BPERF_FILTER_PID || filter_type == BPERF_FILTER_TGID) - key = evsel->core.threads->map[i].pid; + key = perf_thread_map__pid(evsel->core.threads, i); else if (filter_type == BPERF_FILTER_CPU) key = evsel->core.cpus->map[i].cpu; else diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 2139e8b0e401..2e212ae73b9f 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -53,6 +53,7 @@ #include "util/parse-branch-options.h" #include #include +#include #include diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index 5be5fa2391de..b5941c74a0d6 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c @@ -718,17 +718,17 @@ static Py_ssize_t pyrf_thread_map__length(PyObject *obj) { struct pyrf_thread_map *pthreads = (void *)obj; - return pthreads->threads->nr; + return perf_thread_map__nr(pthreads->threads); } static PyObject *pyrf_thread_map__item(PyObject *obj, Py_ssize_t i) { struct pyrf_thread_map *pthreads = (void *)obj; - if (i >= pthreads->threads->nr) + if (i >= perf_thread_map__nr(pthreads->threads)) return NULL; - return Py_BuildValue("i", pthreads->threads->map[i]); + return Py_BuildValue("i", perf_thread_map__pid(pthreads->threads, i)); } static PySequenceMethods pyrf_thread_map__sequence_methods = { diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c index 1985d1a42a22..1cf65db8f861 100644 --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c @@ -1654,7 +1654,7 @@ static void python_process_stat(struct perf_stat_config *config, struct perf_cpu_map *cpus = counter->core.cpus; int cpu, thread; - for (thread = 0; thread < threads->nr; thread++) { + for (thread = 0; thread < perf_thread_map__nr(threads); thread++) { for (cpu = 0; cpu < perf_cpu_map__nr(cpus); cpu++) { process_stat(counter, perf_cpu_map__cpu(cpus, cpu), perf_thread_map__pid(threads, thread), tstamp, diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c index c9bfe4696943..e848579e61a8 100644 --- a/tools/perf/util/thread_map.c +++ b/tools/perf/util/thread_map.c @@ -18,6 +18,7 @@ #include "thread_map.h" #include "debug.h" #include "event.h" +#include /* Skip "." and ".." directories */ static int filter(const struct dirent *dir) diff --git a/tools/perf/util/thread_map.h b/tools/perf/util/thread_map.h index 3bb860a32b8e..00ec05fc1656 100644 --- a/tools/perf/util/thread_map.h +++ b/tools/perf/util/thread_map.h @@ -4,8 +4,6 @@ #include #include -#include -#include #include struct perf_record_thread_map; From patchwork Tue Nov 8 07:35:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 16908 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2545072wru; Mon, 7 Nov 2022 23:39:42 -0800 (PST) X-Google-Smtp-Source: AMsMyM64avfZhzSoU6HhPWXkkhSGGnyPVPmx46wawOg4TVwenK7VhTCC206Ll6ooMBgXyw7p2e91 X-Received: by 2002:a05:6a00:2193:b0:56c:ea4c:6947 with SMTP id h19-20020a056a00219300b0056cea4c6947mr54923988pfi.27.1667893181839; Mon, 07 Nov 2022 23:39:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667893181; cv=none; d=google.com; s=arc-20160816; b=jqhrF6hU+QqYG2p3C9hSkF6oSbyUUwmbwHTIS59M7Ie3pLGoSbGdRIIVcZy843tngI CxL5U8kmUMHS8ONErZzYmOVOWHc/6GP326JeUr7rltV+Gd7cgHSdEBMfRfqbVtpVwQVS U01Sk6aSEL13NHRdxi2BrXo3J81F6ysFtzP3gu1X/xZrtnC4DrjCY40BMq6qf3+2ZoES XJ6rEJDssgIO+UrYxo52nHr7HXGlnJS2GoHzJgqIGpwjbH3E+i59kH2L2tDcGZGl0geb +QzjVJO31wP6ccJHYIS0uk0Yn1AtSo7eGE/wgGWSbln0F1ayKttlg+N/pjaju89XoG64 q5AA== 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=FRHZ0FW2HIw6QS+Bkui5kSfb7e3a9NpS1DLZODqxyrQ=; b=avfc++ZRFgVHmsNjdOnCQEZNJzVytst3clInuUawc38Np6MRGX8uzdSLC2grxm+hC9 WGyJTTmQ5vk+A6dAxinSos3QQNnTsXhSGfcdRrcYT3Q+zbjCpdLJXyTxKBOmHohL1Bvl Gz6GPho53KPn961yKoZ8Qz5FwnOAUJArxlfV/lOD9vV/7vfo2IiBdnK73WKdMtKaLuUd MaSFu+xRuN+AJPbDTq5/UV5WvYfvZxgmPPS90e5YHgpceegXxKMD9QIh9UjKAsHyrYCV ERhWTpM0A2mWVYyyFtyFXfRw53HDDep2mG7jVUOjNgfEYMd4oFBw08+JKmtAnD3Et+C6 K1CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=UK9wldQb; 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 jj17-20020a170903049100b0017492fb90b0si12171557plb.182.2022.11.07.23.39.28; Mon, 07 Nov 2022 23:39:41 -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=UK9wldQb; 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 S233714AbiKHHhu (ORCPT + 99 others); Tue, 8 Nov 2022 02:37:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233582AbiKHHhS (ORCPT ); Tue, 8 Nov 2022 02:37:18 -0500 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82A753E0B7 for ; Mon, 7 Nov 2022 23:37:17 -0800 (PST) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-3735edd4083so129419547b3.0 for ; Mon, 07 Nov 2022 23:37:17 -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=FRHZ0FW2HIw6QS+Bkui5kSfb7e3a9NpS1DLZODqxyrQ=; b=UK9wldQbKYz7jAyqp+y9ajL5KFs/W8dhw8WTiCKwIN0gvbMvW/zwJwry3YzoY7dfK9 ZV2AaTazbIV9GyTPQ22svSW1O4C9JtIo/yTNaDlH/crRhHjsEOEpF9Sr+MWanyb7a6qM YGzUgX7/VVf2zRl1nTBL9ON8REIjnqlEE+CQ5NuIKRyT619PTBW9aNyyqdnnc4s7a0Mc 1HNjuH/401liKQtNxjzgCHTMlnOeOycKWitfRQPqEEpunjXdP2pSPHltTsYGTRW/xGFY vGmTEdA3+JmX1xATUiMFTK8IpHCWZ28rXjR7/WmW4mBs4penOn+mJ/VFlopVl+SVvE+y IHxw== 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=FRHZ0FW2HIw6QS+Bkui5kSfb7e3a9NpS1DLZODqxyrQ=; b=2eDZxY9rmVJuVqvbS+I1QuKUhe19sBhdxw+IKiQE/GZ2q/c5GuQ9y676UfkqGcsG2Y iWo06mmQv58ClGsEVDeIyrejM/YYTFwUHlLE/LFRdB0qNsWukHuEyqrGIIte9kEePMIs R9pbztCw6XJGkI2x+5MTzHYJMYj1CXg27jLC5g5LhRNwMLb8MmsSD8i6iaVrfpfU5MW/ RDHmm+dSLnCg3RTxz9bd5ReX2n5tyQPWetD9t3fN3CclByCTRZZu3RUFFq/ynkh61X0U ktGjy7+VjDJuQnz1jZC3SifmLmv9yXmGpDAoAU/HPx/LfVNIvRNmzOmgsMCjf2uGrBBp kpVQ== X-Gm-Message-State: ACrzQf0q0dftJqCN5kRoAsgdLPiG8u/ABJnYmYxYQxwKBngjWJi81pJq DnLfi9BzZWZo7mei80XKvUOUcH8oGtMf X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:a697:9013:186f:ed07]) (user=irogers job=sendgmr) by 2002:a25:bd1:0:b0:6cb:ada3:1ca with SMTP id 200-20020a250bd1000000b006cbada301camr51188690ybl.24.1667893036863; Mon, 07 Nov 2022 23:37:16 -0800 (PST) Date: Mon, 7 Nov 2022 23:35:17 -0800 In-Reply-To: <20221108073518.1154450-1-irogers@google.com> Message-Id: <20221108073518.1154450-14-irogers@google.com> Mime-Version: 1.0 References: <20221108073518.1154450-1-irogers@google.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Subject: [PATCH v1 13/14] perf cpumap: Tidy libperf includes 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 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=unavailable 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?1748912761128182284?= X-GMAIL-MSGID: =?utf-8?q?1748912761128182284?= Use public API when possible, don't include internal API in header files in evsel.h. Fix any related breakages. Signed-off-by: Ian Rogers --- tools/perf/tests/cpumap.c | 2 +- tools/perf/util/auxtrace.h | 2 +- tools/perf/util/cpumap.c | 1 + tools/perf/util/cpumap.h | 2 +- tools/perf/util/evsel.h | 2 -- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/perf/tests/cpumap.c b/tools/perf/tests/cpumap.c index 7c873c6ae3eb..3150fc1fed6f 100644 --- a/tools/perf/tests/cpumap.c +++ b/tools/perf/tests/cpumap.c @@ -6,7 +6,7 @@ #include "util/synthetic-events.h" #include #include -#include +#include #include "debug.h" struct machine; diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h index 6a0f9b98f059..2cf63d377831 100644 --- a/tools/perf/util/auxtrace.h +++ b/tools/perf/util/auxtrace.h @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c index 6e3fcf523de9..5e564974fba4 100644 --- a/tools/perf/util/cpumap.c +++ b/tools/perf/util/cpumap.c @@ -12,6 +12,7 @@ #include #include +#include static struct perf_cpu max_cpu_num; static struct perf_cpu max_present_cpu_num; diff --git a/tools/perf/util/cpumap.h b/tools/perf/util/cpumap.h index da28b3146ef9..c2f5824a3a22 100644 --- a/tools/perf/util/cpumap.h +++ b/tools/perf/util/cpumap.h @@ -4,8 +4,8 @@ #include #include -#include #include +#include /** Identify where counts are aggregated, -1 implies not to aggregate. */ struct aggr_cpu_id { diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 989865e16aad..f5d9f6a351cd 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -10,8 +10,6 @@ #include #include #include "symbol_conf.h" -#include -#include struct bpf_object; struct cgroup; From patchwork Tue Nov 8 07:35:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 16909 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2545352wru; Mon, 7 Nov 2022 23:40:38 -0800 (PST) X-Google-Smtp-Source: AMsMyM71y7H0gjJVR8Od+R4O85IdHuv9XmTYSf2yv3lWfa7LRRVHlw25AbZ2OKHt5xaA911VUrq9 X-Received: by 2002:a17:902:daca:b0:188:5136:c230 with SMTP id q10-20020a170902daca00b001885136c230mr29283232plx.157.1667893238041; Mon, 07 Nov 2022 23:40:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667893238; cv=none; d=google.com; s=arc-20160816; b=0QBydXWWYOsenVUWpRdGmhlaxjjfziEDBe8uKBceBmN0I/IwrU7HeCQDmezyi6anOP ogNGwy1Qs8dxFjhRMxSRkGvQ7rD6gdovjDmT11U2UqfOgaXXZZhs/5ZT3CLYEJZ24rGd a4o7jFde9L8z+cFH8BQOqqq42xIq8mnRXPGSqfTX64+xgp8YWebtWdSbWneFngiG5svN l0m7I6UkwGy6sBIXU/o6xJ+GK3n852lnXq3cQaUKssVHBI1biH0vNmUahu+jKjZ+rRDe cB2mlA/vGiupqmZG4w/qDpVzVNQc6U7CltDD9FAGvYvzYmWsGxSJPCcfcP/jt9Ci0n9D Sblg== 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=XHQYG2S+r6ZQkfu64Vbijcu9xq3IEuE8DFugpR25f3I=; b=QJLrHquSx/4E0k5V/UDUEjucHBUPpiU/rVtFn1I3XvNA+7ViLppk3r4iE5P+qdiV7H 7Pz7UvIstrfg8YI6NTfvF+HZIuRBCEVYl4tQnwXtv0TEetEG7D56ZF1By9DjkwIz6SRs eCddUDOEhYMIOGlzGUtc4onNAn+L6lIGeWrOFzbttalUJXQDQ9TsFoLTR4S3bk1qzXkd Uj2K+cI/acPwmZej3l9Av4n0R8+VKPINfNzGFXNgxiyRdh6Kwf37A9bFijs6q1rvoqVG n0eSvh8xiw0e8+A+Y2iBcbCqc4vbXJrpdRYjcDHAmjMtNGoDkIfV8DMeHfetpkAeA3Eu Zraw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ZUAZDJI6; 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 my5-20020a17090b4c8500b00206012b593csi21605725pjb.33.2022.11.07.23.40.24; Mon, 07 Nov 2022 23:40:38 -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=ZUAZDJI6; 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 S233695AbiKHHiM (ORCPT + 99 others); Tue, 8 Nov 2022 02:38:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233692AbiKHHh2 (ORCPT ); Tue, 8 Nov 2022 02:37:28 -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 8B4773204D for ; Mon, 7 Nov 2022 23:37:25 -0800 (PST) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-36fde8f2cdcso130160307b3.23 for ; Mon, 07 Nov 2022 23:37:25 -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=XHQYG2S+r6ZQkfu64Vbijcu9xq3IEuE8DFugpR25f3I=; b=ZUAZDJI66aG+v2oL+iUezXAlrcjCsx9STzuWpYrFIJ7KKSwlLdAeNYs6QXC12jzbr/ bUpGUlyBk99Us4IxVCkwQlFnPFn8h1EUalTZqH/TU8mV86dDNvu0UmnfecUV5mPeockq G3yZNHGXas/SEjphMVJ2jTGysrb12qr9GZefcLdrPs7fWqPM5xK0/u58DVEyA4hKvkz5 6pKeza5OGk7tiEFBLcXfYErgwUObvWjHsk5t9Lu70d89j87FhY3ebuxcNMz3iCj9jl/l m2kdkkOoG0vomG1G7qgqFTFoKv3qWH+KoJM5BQMF+aFTpwNRQcfpDXzK2Ey1BZ5y9fwh QjEw== 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=XHQYG2S+r6ZQkfu64Vbijcu9xq3IEuE8DFugpR25f3I=; b=Pd4q9uCSn0kH8qzJxVWFfxTrHhFn3nbBWn7h5IjG/R3KN/skqXbXioyYPOYXB9QfLD bgP13MRIojt3NKUfU5TYZrYuvIrxn303u7d0ZPDd5K0R6o+1Go6kb+bSCTOi4luw9MDC PjTT0wAuctw8VTyj3E1c2XQP5bna4fMWEf0Go7zjcICV7P1DrBNSJyNRrB8VhQI/hn3t I9lRu5AKCJK2rPiKyjKEq0g4Nubt4rcopOgw5+sk/Y5z96AnToiYdW71FOZgefG7rwTK yjk89bBgBsiJ+YMyCnG4FoUceezmQsxHLimGTP2vFKkpNoA9g4qol6XJ/GXdsNsx1QnS WDhw== X-Gm-Message-State: ANoB5pmCWwrD093NfnI3dSH6J/I6AlU/pjCxMk0Uaw1NYOa+FN/+ZN6f fDk3Fck0NtF833qy9vmSwb+gkZCwAYCm X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:a697:9013:186f:ed07]) (user=irogers job=sendgmr) by 2002:a25:2507:0:b0:6d4:13d1:c781 with SMTP id l7-20020a252507000000b006d413d1c781mr617399ybl.478.1667893044770; Mon, 07 Nov 2022 23:37:24 -0800 (PST) Date: Mon, 7 Nov 2022 23:35:18 -0800 In-Reply-To: <20221108073518.1154450-1-irogers@google.com> Message-Id: <20221108073518.1154450-15-irogers@google.com> Mime-Version: 1.0 References: <20221108073518.1154450-1-irogers@google.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Subject: [PATCH v1 14/14] 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 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=unavailable 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?1748912819713979953?= X-GMAIL-MSGID: =?utf-8?q?1748912819713979953?= Switch -I from tools/lib to the install path for the tools/lib libraries that are depended upon. Signed-off-by: Ian Rogers --- tools/perf/Makefile.config | 2 -- tools/perf/Makefile.perf | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index d3d3c13a9f25..d7fcd1624cd7 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 1d90d78303b4..851dcc0272e5 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/