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 6189EFF8863 for ; Sat, 25 Apr 2026 22:46:05 +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=pBA5HOQz8OcQS9LPFOh1LK4xve v/6mnFa3fu1S/q5a+BooTAIhjm8Z6wg22HNIYu7EPozMvJNQlBttl2HfboIIgUSfn17Lc3XcIN+CH +0GB5wlWGTQH1tsWC1/CDx9rHk+KQ1e5m4utu4BYAZyPt9bmpNRA4W6umdmwCDmRDYcMVX+iI4A0M uybmvRHjeLlsT7I/RBLQxwg43MmSAMg/3mSxaWhcGrNR4U0kHkxRsaWvo3Ode0qvluevLX9O0KrQv 2cHupVssDiwlmcnPSK9YO1w6LW0bPzo++mVXv8T3V2UUca2+Jm1PHJvubxhNWnoU/Jjq12Ktz9FBg GNg/Zzww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1wGll7-0000000Ewkw-2Xzz; Sat, 25 Apr 2026 22:45:57 +0000 Received: from mail-dy1-x134a.google.com ([2607:f8b0:4864:20::134a]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1wGlkl-0000000EwQk-0Af8 for linux-arm-kernel@lists.infradead.org; Sat, 25 Apr 2026 22:45:43 +0000 Received: by mail-dy1-x134a.google.com with SMTP id 5a478bee46e88-2dd6fb4c867so15657565eec.0 for ; Sat, 25 Apr 2026 15:45:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1777157132; x=1777761932; 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=k4KMaNwyTB+acc65jogTX/437xEYeLGztBnKwWD5DC8DLnNjrBbf8brtRTdB6svLvY LPGAX2Bu450I/zZIYrZvRq/VbCQkJUVeb3+rawJKDJHVu7dNkyIq9rHNP90ZDedsiRlX ce+c7Dijo0AQYqkvNoI461CKGwDl4Y4Yh/jOQQGxvNe6AM5XlThorGq06WK6BXQjzo+C 7+vKkw3irPmMMlhwX1X+F014Vtl2Yn22DUIT0UVmqkdTzYgscfwcvO32aSPmuTy+fkQ5 9cx+foODfb0nF13sdyralvUUQ3BCN2Va18ZV19sLauhmioWy6mHZ+fyX1p69cUSagizn M70w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777157132; x=1777761932; 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=VQk2xwdPahbRTOkKIMoBj56GjwFmPsAXopTTboOY7yGLK+OFcV8XA+8caKvcm+fFHf KuRBl8H/loCrtSP2xi2YH9lsFjp8YLqGozSnMthu40BICQWvAKm6o2H2TuDUFYbM6HkR YHibwlpnxpxOueOyuo6XEbs+v7DutSZIOoIbxHmQK4Z8pcDBZI21sZVKOo8MzRm/814n bIqxPNepVSCGnYtfna1V09tujnBqM2+7gYNQ9E5iwQI9e6Cnl3+qnwbVlbPNR3Br8evt gCr5RuwVHIBbXOUlxEfEqHBwNA2hrt2BL931QkOOHDsTe/2zPOPaUrYG1V/4OZEYdImD F8gg== X-Forwarded-Encrypted: i=1; AFNElJ/8a4ufveLp9n65tk9x4D0WdD0rX4qk/5p4mHf7Wzl1C5Hn/3RhxLpgiVpWDtGpCZ0idjan3wv3d/3P3c+YCehk@lists.infradead.org X-Gm-Message-State: AOJu0YzXuk1QEPm84BYxajHdOMPS47XqkFQL3Ez4k4T86CmYTgk/W/gN PykE/T838c5OEPOFCWHiMDMAJmKXegZ4pJxXZmKbKbkrTPDa60JoJHM6s8QyYr/mfn6booY6Ze9 JSFRRLCwvzA== X-Received: from dycf28.prod.google.com ([2002:a05:7300:50dc:b0:2d9:6c52:c24a]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7300:d717:b0:2e2:a64b:63b5 with SMTP id 5a478bee46e88-2e479c08fa4mr22676842eec.18.1777157131715; Sat, 25 Apr 2026 15:45:31 -0700 (PDT) Date: Sat, 25 Apr 2026 15:44:59 -0700 In-Reply-To: <20260425224503.170337-1-irogers@google.com> Mime-Version: 1.0 References: <20260425174858.3922152-1-irogers@google.com> <20260425224503.170337-1-irogers@google.com> X-Mailer: git-send-email 2.54.0.545.g6539524ca2-goog Message-ID: <20260425224503.170337-13-irogers@google.com> Subject: [PATCH v7 55/59] 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-20260425_154535_105400_A0137268 X-CRM114-Status: GOOD ( 21.04 ) 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