From patchwork Thu Jun 13 18:32:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13697302 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EC008C27C75 for ; Thu, 13 Jun 2024 18:32:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:To:From:Subject :Mime-Version:Message-Id:Date:Reply-To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=GvTiDUv73PJ62h8lVRQjJMyYJyL2LnE71Yt7gAeiVUY=; b=i9CXnFE4ZeRQmBDWdfzUDL+LFx syrAIYRRYkPDImIao2b3gBQAuRpH/gTVXCFkjiwS3L5QVXfWFL6lgz3tKiD3x6Ly6deiEK+1v5CoQ 8wsPOqQizKt7BpkcJn5F2QCqhcz8RSOuUjqgCU6CHMGAnDniHj4d/DsdZX64XlBhKFCXv/yl4oipP Ve20KuoTjrxqhZxsjvzHRpW8fzRLNr3G2FSYIOEdSFOYPqkaP7pQJKZkUeSg0biYffuKnJChLNmqE qOiZmdScFgHQZltKmk46FVD50sCwqqX0a8aEA8G2QuGNwhc8qb0jHHSQwDyp3gAAxWu1ZiTpfPjQV U43Nf+/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHpFW-000000005wd-28rl; Thu, 13 Jun 2024 18:32:38 +0000 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHpFU-000000005ve-06M5 for linux-arm-kernel@lists.infradead.org; Thu, 13 Jun 2024 18:32:37 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-62d032a07a9so26047177b3.2 for ; Thu, 13 Jun 2024 11:32:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718303553; x=1718908353; darn=lists.infradead.org; h=to:from:subject:mime-version:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=GvTiDUv73PJ62h8lVRQjJMyYJyL2LnE71Yt7gAeiVUY=; b=WQw4Gc0MQWY3DFp8O7w3j0GGaNc7yWgX626R0x8iyWxa8GIJYiW9/yyFruAHP6UwZx FDBnpmX+uOB0a9NChhI+cui+938M0g5vBnTd9YRuadBqKVE/IxbIBbzJQ4ULTtABxquk udRGdBwY9JUPhTBuckMMGtebxGvGtSIoSSs5uPonFHxDz+oioOeboBZynXlaMP99xWcP yWRKKT5O84e5ROIaaMPX99QoTJNNUVbTpRiu1laFo4J9LjvEeTN12krKPYvgCN6nSD4G 9p65T/wQydQ5dafgnzRcMqogBy/W0z3+n8n22larsaeSjUKtVu2An+WYeb/0D0d25hA0 vV9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718303553; x=1718908353; h=to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=GvTiDUv73PJ62h8lVRQjJMyYJyL2LnE71Yt7gAeiVUY=; b=H6681uJdC9BKXKXrqB4G/AGI/341X1v5Xmc9fYlGgaJeStg5CK4E9UKHfdmJKbnb1+ 9T/eoOqI5KgqghfT3DjWqMPcLzCoj6CqmO4pAgWnF2XhRgBlMznayE+yQuftpWOziuz0 YpZUypG2a/Tf2F3r6b/5Kx9QLqPQpHJb2+BpzhTIgB7Qkemn50e3I4OIXrTt20MHtjzR kayhEEkDrgh9h0o1fq26z3LZKLbe30DhpQem3KvIq7MnRzb6ilcWJsYxuaV5tuUHorme 0rvQ5LekYCqa5iUquSCz3t9bdf8zUrNe4IYSUoA1FwC6noS8TfGjgivmZIF8Bj6sU1Aw Mdbg== X-Forwarded-Encrypted: i=1; AJvYcCURPy8uwvWTF3eVn2W/p0r+IIZK0DS1UVYJVkI+WSUJt6XBw8sVQKeWucxrPNxsQF2daIt2yQrZ7ZNKEC+mHlrSkF6Yal79xCgkj0+L8D9FBXqw0yo= X-Gm-Message-State: AOJu0YwufMvoLEmwfZMRCYCO+Bf6Qc9h16zvNXHcvYL8HXAlv4Yy+Cd5 8e7LVFocS5M0tiif/wJg759o/xdzcHwY9q2cxco5uUfiHLMUVCC1+1g/8dybOvfHdn+jaiQcwC2 FGuI9zA== X-Google-Smtp-Source: AGHT+IF2KkrgoY57dGWdPw77kXn2zBaD+Uy2G1hRssubmTdIuyA2t/vU2zQn1FmdaIlmDTTWb1i59wcVKt0o X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:96dd:26a6:1493:53c8]) (user=irogers job=sendgmr) by 2002:a05:6902:2988:b0:dfa:4b20:bdaf with SMTP id 3f1490d57ef6-dff15470dfdmr25437276.13.1718303552539; Thu, 13 Jun 2024 11:32:32 -0700 (PDT) Date: Thu, 13 Jun 2024 11:32:16 -0700 Message-Id: <20240613183224.3399628-1-irogers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.45.2.627.g7a2c4fd464-goog Subject: [PATCH v2 0/8] Refactor perf python module build From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Guo Ren , Paul Walmsley , Palmer Dabbelt , Albert Ou , Suzuki K Poulose , Yicong Yang , Jonathan Cameron , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , " =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= " , Benno Lossin , Andreas Hindborg , Alice Ryhl , Nick Terrell , Ravi Bangoria , Kees Cook , Andrei Vagin , Athira Jajeev , Oliver Upton , Ze Gao , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-riscv@lists.infradead.org, coresight@lists.linaro.org, rust-for-linux@vger.kernel.org, bpf@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240613_113236_093611_5D22BBE1 X-CRM114-Status: GOOD ( 14.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Refactor the perf python module build to instead of building C files it links libraries. To support this make static libraries for tests, ui, util and pmu-events. Doing this allows fewer functions to be stubbed out, importantly parse_events is no longer stubbed out which will improve the ability to work with heterogeneous cores. By not building .c files for the python module and for the build of perf, this should also help build times. Patch 1 adds '*.a' cleanup to the clean target. Patches 2 to 6 add static libraries for existing parts of the perf build. Patch 7 adds the python build using libraries rather than C source files. Patch 8 cleans up the python dependencies and removes the no longer needed python-ext-sources. v2: Add '*.a' cleanup to clean target. Add reviewed-by James Clark. Ian Rogers (8): perf build: Add '*.a' to clean targets perf ui: Make ui its own library perf pmu-events: Make pmu-events a library perf test: Make tests its own library perf bench: Make bench its own library perf util: Make util its own library perf python: Switch module to linking libraries from building source perf python: Clean up build dependencies tools/perf/Build | 14 +- tools/perf/Makefile.config | 5 + tools/perf/Makefile.perf | 83 +++- tools/perf/arch/Build | 4 +- tools/perf/arch/arm/Build | 4 +- tools/perf/arch/arm/tests/Build | 8 +- tools/perf/arch/arm/util/Build | 10 +- tools/perf/arch/arm64/Build | 4 +- tools/perf/arch/arm64/tests/Build | 8 +- tools/perf/arch/arm64/util/Build | 20 +- tools/perf/arch/csky/Build | 2 +- tools/perf/arch/csky/util/Build | 6 +- tools/perf/arch/loongarch/Build | 2 +- tools/perf/arch/loongarch/util/Build | 8 +- tools/perf/arch/mips/Build | 2 +- tools/perf/arch/mips/util/Build | 6 +- tools/perf/arch/powerpc/Build | 4 +- tools/perf/arch/powerpc/tests/Build | 6 +- tools/perf/arch/powerpc/util/Build | 24 +- tools/perf/arch/riscv/Build | 2 +- tools/perf/arch/riscv/util/Build | 8 +- tools/perf/arch/s390/Build | 2 +- tools/perf/arch/s390/util/Build | 16 +- tools/perf/arch/sh/Build | 2 +- tools/perf/arch/sh/util/Build | 2 +- tools/perf/arch/sparc/Build | 2 +- tools/perf/arch/sparc/util/Build | 2 +- tools/perf/arch/x86/Build | 6 +- tools/perf/arch/x86/tests/Build | 20 +- tools/perf/arch/x86/util/Build | 42 +- tools/perf/bench/Build | 46 +- tools/perf/scripts/Build | 4 +- tools/perf/scripts/perl/Perf-Trace-Util/Build | 2 +- .../perf/scripts/python/Perf-Trace-Util/Build | 2 +- tools/perf/tests/Build | 140 +++---- tools/perf/tests/workloads/Build | 12 +- tools/perf/ui/Build | 18 +- tools/perf/ui/browsers/Build | 14 +- tools/perf/ui/tui/Build | 8 +- tools/perf/util/Build | 394 +++++++++--------- tools/perf/util/arm-spe-decoder/Build | 2 +- tools/perf/util/cs-etm-decoder/Build | 2 +- tools/perf/util/hisi-ptt-decoder/Build | 2 +- tools/perf/util/intel-pt-decoder/Build | 2 +- tools/perf/util/perf-regs-arch/Build | 18 +- tools/perf/util/python-ext-sources | 53 --- tools/perf/util/python.c | 271 +++++------- tools/perf/util/scripting-engines/Build | 4 +- tools/perf/util/setup.py | 33 +- 49 files changed, 624 insertions(+), 727 deletions(-) delete mode 100644 tools/perf/util/python-ext-sources