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: 13697281 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EF891474A8 for ; Thu, 13 Jun 2024 18:32:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718303555; cv=none; b=aP1eO7szxq5G2uXdWh7+/gCi4AalMVTGmTQhGjyCGbhDw08M8cFXK1YwyVRZrV6yQbHOeb6s8iUwr/NsM/HWNWsNbGQM8MZqv+1E4+W8LHOSl/vHxEYXn0zjofIOOWX/0GIiSYosid8vburxy7H5osThJiMVDh2fMN07RvrvNrw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718303555; c=relaxed/simple; bh=cpWXRE0Fqv7sRk4O6Nqc1zzeKbf0oJzhfcWUtE6IajI=; h=Date:Message-Id:Mime-Version:Subject:From:To:Content-Type; b=kh1sycs+J55jsK71l0etbzqvAd4gkJWCzokmstWDd1RXsMbQuE147ugQymB6eAIZjaIptNiGwb2mBQSledA8FSQmWtIYOAyeez7CwgFB8qx3UF9S0ZV5E2S0fbio4XBI/87wGaHfNe1M477dpNVAo5SUKbLNE/wDl5N+BHJG7WE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=UIVuaW5m; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="UIVuaW5m" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-62fc0568219so24602107b3.1 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=vger.kernel.org; h=to:from:subject:mime-version:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=GvTiDUv73PJ62h8lVRQjJMyYJyL2LnE71Yt7gAeiVUY=; b=UIVuaW5mcqRS6Om8kCTGkKgvQWSeMloQ1RrRyKb0hlgLotfUgIIrf+CNucF5YWXpSK 4agbddR0fMUmfCMhujEJtk9DkKQpxLLFvPqlSNWg4jZuuZ2Io4ddGy0XTJS7ZX1O5qfz egaWJX9QOb3xVYtQDoUwU+iDnSVILwKW9bW8Oe1bKrJAPdee7/wWp4hCho8vaun8tf0b GZS9QtjXyekrRhFhh1DT539tla1Ru2vZn95U6QsyJuhklwVpXaVkuKI/aFUN3i2qpQ/L huC6NUvTFvQBGO53YKNnrU0Z0XsM8tbsi0PF0HLBfXHAmAvaSMRk2B7KLcDQ8BCvFAoY lR6w== 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=Bjz2oVG8NeGmPodyvSSnfK7XPJ2Xa6Furf7m3PvgY5VqWHIsiqpwm/qjx2ZTAaIiXd 9RsrGgNZaZ6Smkh39BEJDft4uryibRYx3PYnC1ZXlK3ddUQZCK6H8z7ZB7UFgxXp950b JFPdgzb2BO7BzXCL5BT74hbx9UYFaK10eyCjxmycUUQzXL4UBIQg+8nh24SUeV6yiUzN Vhh8HDIEwqylz8aigTushiTvj3YDpzB4s+ubjzEre+r+YzAkTAoNw1TKV24vX4/8zEr4 k7Bk3Kpq4evoKQUJOVb9VIaBwO6bv+pxH4uFJIk2fWOFu1kvwEGhdNRzaXw63SqZ8Lnl hMUw== X-Forwarded-Encrypted: i=1; AJvYcCUE7irEiY0JKIrlvABfyaD1RpwrVRZ0Z8mvbjBr0v+QwRgftPo/OZGdZ9PFEhM9pCLHiAOt4FMsDbu9YAk/aoSvvGu6 X-Gm-Message-State: AOJu0YwkfLdIzkU2EVZhjDbomMRBARrXdCBUgF7bHQG5jUnYmClIUTBt oWiMMaV48EsSt8B7Ua4P0YC0+tQzA0SPHR5YztdXMVzwbU5mP1tZX03qLoJzGiklkT5BJSeX+sd 7nhPZpA== 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> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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