From mboxrd@z Thu Jan 1 00:00:00 1970 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 0F488FED3F1 for ; Fri, 24 Apr 2026 16:51:19 +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:Cc:To:From: Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FUJSZggZAnW35gY6L6UfepyO4olhr8IMzDQNCfxT3yU=; b=1zKTCSCGEq2zYnzR8ROLCCOLpR 9MIG/jnnT8DayL0hYjLBBwnahYtRe7ded3zq5ALKHVyKphz6kfU7PovlR89AuSYdGGi4soSQkH9kC xwPQuomRGvWxQtQsAYgg0qcF02uOX+j9hv00Dg9IvHknPWQl2V3CmC+OTLRrMr2JNNL0wRxkkCJ67 nKUR5THeLt/0uw/HXRfHQBcewYSbJy/zsR1bHOrPVSgFOut6wqNvrLqcqk7m1BWvjt9Pv54wHzMPW 0JnYFPA5I2CrBofTR6Yy1juVJSdifulHSP0cVRvvICsdvmKzAN7bhjT02IgvbWwiz8C0QUbUK2ijZ FUdTo7LA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1wGJkE-0000000DWe9-0U3M; Fri, 24 Apr 2026 16:51:10 +0000 Received: from mail-dl1-x1249.google.com ([2607:f8b0:4864:20::1249]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1wGJip-0000000DV2V-2yOg for linux-arm-kernel@lists.infradead.org; Fri, 24 Apr 2026 16:49:56 +0000 Received: by mail-dl1-x1249.google.com with SMTP id a92af1059eb24-12c8de02a4dso9870880c88.1 for ; Fri, 24 Apr 2026 09:49:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1777049381; x=1777654181; darn=lists.infradead.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=FUJSZggZAnW35gY6L6UfepyO4olhr8IMzDQNCfxT3yU=; b=ee+a2YUbOsTvncI4DzQaSmN9imU+DUMF2ob3u7/5qMdmDEDcPMyE+1mxe70usxMmKB 64VQtW41VbNNiK9F4YidFFJF4tytdi7WjC8YbbKmKkuPiGxcIABYRAQDo+Vx/Wb2q5ap +NuEFPsWlGgc6KKw0ddlTYb/7knQqYapDKz5LmzrKZBSEyaVtSlSYI7lsbBjLvh7VLZ3 t6EugQpVBtLgcYzbctXDxwXRuW1guvL9DdI3ZFgkXFbQsp0tVeEuUf+7ey+IwSEe+TBc jAo1JKzEcPSA0DbgL07HjqAyMFYKdr3Nenxg4CX3/WynvGE2fwscpDXVkoM5d7UNiGZk LlTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777049381; x=1777654181; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FUJSZggZAnW35gY6L6UfepyO4olhr8IMzDQNCfxT3yU=; b=mZp1aFqasqxvQIbBzhSW+jX6c6+iV86G7+Dk7dtAPsYe6C8mZEwcbMwAzPalQKdbKB YpJXhWvtIgDSjPfYBW1/AStQHAkV11V68EdJnC4241PXZPsgLHdmJLjLTqUpEjHphfjy FGHvjmAwkTFbQgaZ+kBCMmPisd3u7LSTneDlQKjBNyHYKqen17Qi0tncwN4vSvlGZOWz 8RSwd5Mi41vYFFzClPVpElrAgiN+Rcr6Qmx/zii6uBiG16/7r50iAtPieYShIHgdS37J REmYZBrORBOl5MkRYPVD4wbLrOQXEVKH6P1WQ/yv3V2Dnc7Aowv2QrcH2PTGqdDV+drH 33Vg== X-Forwarded-Encrypted: i=1; AFNElJ8NTUNcAGXsh2mMxaLkIWs9Z2ScRm25pj5ou+m+VWlF4QeHetfgaBPEitLcl2xh7e9/i5eyHl+5ZOsMhdkHKBGN@lists.infradead.org X-Gm-Message-State: AOJu0YyQAhIO0aEc4IS+FZyiMvMvaKj7/8PedXLCgiHghpwbIq6Z8q7Z Bv6qBdjp6cdWIsVFtTa6cO2NMRkX1uFrmFqPChdmXgyRLuvSu4V8ANEGLIP3t/cb1LvWMm4T2zb g+Lt8dXg55g== X-Received: from dlbbz15.prod.google.com ([2002:a05:7022:238f:b0:12c:34da:e06e]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7022:fa0:b0:12a:72af:83d1 with SMTP id a92af1059eb24-12c73f6f6famr19116159c88.11.1777049380784; Fri, 24 Apr 2026 09:49:40 -0700 (PDT) Date: Fri, 24 Apr 2026 09:47:17 -0700 In-Reply-To: <20260424164721.2229025-1-irogers@google.com> Mime-Version: 1.0 References: <20260423163406.1779809-1-irogers@google.com> <20260424164721.2229025-1-irogers@google.com> X-Mailer: git-send-email 2.54.0.545.g6539524ca2-goog Message-ID: <20260424164721.2229025-56-irogers@google.com> Subject: [PATCH v5 55/58] perf Makefile: Update Python script installation path From: Ian Rogers To: acme@kernel.org, adrian.hunter@intel.com, james.clark@linaro.org, leo.yan@linux.dev, namhyung@kernel.org, tmricht@linux.ibm.com Cc: alice.mei.rogers@gmail.com, dapeng1.mi@linux.intel.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, Ian Rogers Content-Type: text/plain; charset="UTF-8" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260424_094944_142261_709876C1 X-CRM114-Status: GOOD ( 21.10 ) 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 Remove libpython feature test that is now a python-module feature test. Update references from libpython to python-module accordingly. Remove references to legacy 'scripts/python' directory and install scripts directly to 'python' directory under libexec. This aligns with the removal of embedded interpreter and move to standalone scripts. Assisted-by: Gemini:gemini-3.1-pro-preview Signed-off-by: Ian Rogers --- tools/build/Makefile.feature | 4 ++-- tools/build/feature/Makefile | 4 ++-- tools/build/feature/test-all.c | 6 +++--- tools/build/feature/test-libpython.c | 10 ---------- tools/build/feature/test-python-module.c | 12 ++++++++++++ tools/perf/Makefile.config | 13 ++++++------- tools/perf/Makefile.perf | 10 ++++------ tools/perf/tests/make | 5 +---- 8 files changed, 30 insertions(+), 34 deletions(-) delete mode 100644 tools/build/feature/test-libpython.c create mode 100644 tools/build/feature/test-python-module.c diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature index 96d4382144c4..cbe41ba7bae5 100644 --- a/tools/build/Makefile.feature +++ b/tools/build/Makefile.feature @@ -79,7 +79,7 @@ FEATURE_TESTS_BASIC := \ libelf-zstd \ libnuma \ numa_num_possible_cpus \ - libpython \ + python-module \ libslang \ libtraceevent \ libcpupower \ @@ -140,7 +140,7 @@ FEATURE_DISPLAY ?= \ libelf \ libnuma \ numa_num_possible_cpus \ - libpython \ + python-module \ libcapstone \ llvm-perf \ zlib \ diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile index 60e3df8142a5..5530f9e03fcf 100644 --- a/tools/build/feature/Makefile +++ b/tools/build/feature/Makefile @@ -30,7 +30,7 @@ FILES= \ test-libdebuginfod.bin \ test-libnuma.bin \ test-numa_num_possible_cpus.bin \ - test-libpython.bin \ + test-python-module.bin \ test-libslang.bin \ test-libtraceevent.bin \ test-libcpupower.bin \ @@ -252,7 +252,7 @@ $(OUTPUT)test-gtk2-infobar.bin: grep-libs = $(filter -l%,$(1)) strip-libs = $(filter-out -l%,$(1)) -$(OUTPUT)test-libpython.bin: +$(OUTPUT)test-python-module.bin: $(BUILD) $(FLAGS_PYTHON_EMBED) $(OUTPUT)test-libbfd.bin: diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c index 1488bf6e6078..4400e3d24f81 100644 --- a/tools/build/feature/test-all.c +++ b/tools/build/feature/test-all.c @@ -10,8 +10,8 @@ * Quirk: Python headers cannot be in arbitrary places, so keep this testcase at * the top: */ -#define main main_test_libpython -# include "test-libpython.c" +#define main main_test_python_module +# include "test-python-module.c" #undef main #define main main_test_hello @@ -148,7 +148,7 @@ int main(int argc, char *argv[]) { - main_test_libpython(); + main_test_python_module(); main_test_hello(); main_test_libelf(); main_test_gettid(); diff --git a/tools/build/feature/test-libpython.c b/tools/build/feature/test-libpython.c deleted file mode 100644 index 371c9113e49d..000000000000 --- a/tools/build/feature/test-libpython.c +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include - -int main(void) -{ - Py_Initialize(); - - return 0; -} -#undef _GNU_SOURCE diff --git a/tools/build/feature/test-python-module.c b/tools/build/feature/test-python-module.c new file mode 100644 index 000000000000..d670dba014b0 --- /dev/null +++ b/tools/build/feature/test-python-module.c @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0 +#include + +int main(void) +{ + static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + }; + PyObject *module = PyModule_Create(&moduledef); + + return module ? 0 : -1; +} diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index ecddd91229c8..e2cef452964f 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -317,7 +317,7 @@ PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG)) # Python 3.8 changed the output of `python-config --ldflags` to not include the # '-lpythonX.Y' flag unless '--embed' is also passed. The feature check for -# libpython fails if that flag is not included in LDFLAGS +# python-module fails if that flag is not included in LDFLAGS ifeq ($(shell $(PYTHON_CONFIG_SQ) --ldflags --embed 2>&1 1>/dev/null; echo $$?), 0) PYTHON_CONFIG_LDFLAGS := --ldflags --embed else @@ -340,8 +340,8 @@ ifdef PYTHON_CONFIG endif endif -FEATURE_CHECK_CFLAGS-libpython := $(PYTHON_EMBED_CCOPTS) -FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS) +FEATURE_CHECK_CFLAGS-python-module := $(PYTHON_EMBED_CCOPTS) +FEATURE_CHECK_LDFLAGS-python-module := $(PYTHON_EMBED_LDOPTS) FEATURE_CHECK_LDFLAGS-libaio = -lrt @@ -830,13 +830,12 @@ endif disable-python = $(eval $(disable-python_code)) define disable-python_code - CFLAGS += -DNO_LIBPYTHON $(warning $1) - NO_LIBPYTHON := 1 + NO_PYTHON_MODULE := 1 endef PYTHON_EXTENSION_SUFFIX := '.so' -ifdef NO_LIBPYTHON +ifdef NO_PYTHON_MODULE $(call disable-python,Python support disabled by user) else @@ -849,7 +848,7 @@ else $(call disable-python,No 'python-config' tool was found: disables Python support - please install python-devel/python-dev) else - ifneq ($(feature-libpython), 1) + ifneq ($(feature-python-module), 1) $(call disable-python,No 'Python.h' was found: disables Python support - please install python-devel/python-dev) else PYTHON_SETUPTOOLS_INSTALLED := $(shell $(PYTHON) -c 'import setuptools;' 2> /dev/null && echo "yes" || echo "no") diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 2020532bab9c..e50b1e8cf85d 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -17,9 +17,7 @@ include ../scripts/utilities.mak # # Define CROSS_COMPILE as prefix name of compiler if you want cross-builds. # - -# -# Define NO_LIBPYTHON to disable python script extension. +# Define NO_PYTHON_MODULE to disable python script extension. # # Define PYTHON to point to the python binary if the default # `python' is not correct; for example: PYTHON=python2 @@ -1099,10 +1097,10 @@ endif $(call QUIET_INSTALL, perf-iostat) \ $(INSTALL) $(OUTPUT)perf-iostat -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)' -ifndef NO_LIBPYTHON +ifndef NO_PYTHON_MODULE $(call QUIET_INSTALL, python-scripts) \ - $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python'; \ - $(INSTALL) python/*.py -m 644 -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python' + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/python'; \ + $(INSTALL) python/*.py -m 644 -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/python' endif $(call QUIET_INSTALL, dlfilters) \ $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/dlfilters'; \ diff --git a/tools/perf/tests/make b/tools/perf/tests/make index 31b064928cfc..f2c5f1c254a7 100644 --- a/tools/perf/tests/make +++ b/tools/perf/tests/make @@ -75,8 +75,6 @@ make_jevents_all := JEVENTS_ARCH=all make_no_bpf_skel := BUILD_BPF_SKEL=0 make_gen_vmlinux_h := GEN_VMLINUX_H=1 -make_no_libpython := NO_LIBPYTHON=1 -make_no_scripts := NO_LIBPYTHON=1 make_no_slang := NO_SLANG=1 make_no_gtk2 := NO_GTK2=1 make_no_ui := NO_SLANG=1 NO_GTK2=1 @@ -118,7 +116,7 @@ make_install_prefix_slash := install prefix=/tmp/krava/ make_static := LDFLAGS=-static NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 NO_JVMTI=1 NO_LIBTRACEEVENT=1 NO_LIBELF=1 # all the NO_* variable combined -make_minimal := NO_LIBPYTHON=1 NO_GTK2=1 +make_minimal := NO_GTK2=1 make_minimal += NO_DEMANGLE=1 NO_LIBELF=1 NO_BACKTRACE=1 make_minimal += NO_LIBNUMA=1 NO_LIBBIONIC=1 NO_LIBDW=1 make_minimal += NO_LIBBPF=1 @@ -150,7 +148,6 @@ run += make_jevents_all run += make_no_bpf_skel run += make_gen_vmlinux_h -run += make_no_libpython run += make_no_scripts run += make_no_slang run += make_no_gtk2 -- 2.54.0.545.g6539524ca2-goog