linux-stable/tools/perf
James Clark fe4104304b perf tools: Use Python devtools for version autodetection rather than runtime
[ Upstream commit 630af16eee ]

This fixes the issue where the build will fail if only the Python2
runtime is installed but the Python3 devtools are installed. Currently
the workaround is 'make PYTHON=python3'.

Fix it by autodetecting Python based on whether python[x]-config exists
rather than just python[x] because both are needed for the build. Then
-config is stripped to find the Python runtime.

Testing
=======

 * Auto detect links with Python3 when the v3 devtools are installed
   and only Python 2 runtime is installed
 * Auto detect links with Python2 when both devtools are installed
 * Sensible warning is printed if no Python devtools are installed
 * 'make PYTHON=x' still automatically sets PYTHON_CONFIG=x-config
 * 'make PYTHON=x' fails if x-config doesn't exist
 * 'make PYTHON=python3' overrides Python2 devtools
 * 'make PYTHON=python2' overrides Python3 devtools
 * 'make PYTHON_CONFIG=x-config' works
 * 'make PYTHON=x PYTHON_CONFIG=x' works
 * 'make PYTHON=missing' reports an error
 * 'make PYTHON_CONFIG=missing' reports an error

Fixes: 79373082fa ("perf python: Autodetect python3 binary")
Signed-off-by: James Clark <james.clark@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20220309194313.3350126-2-james.clark@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-09 10:25:46 +02:00
..
arch perf regs x86: Fix arch__intr_reg_mask() for the hybrid platform 2022-05-25 09:59:12 +02:00
bench perf bench numa: Address compiler error on s390 2022-05-25 09:59:12 +02:00
dlfilters perf dlfilter: Drop unused variable 2021-12-16 12:18:11 -03:00
Documentation perf record: Disable debuginfod by default 2022-01-15 17:41:25 -03:00
examples/bpf
include
jvmti
pmu-events perf vendor events: Update metrics for SkyLake Server 2022-04-08 13:59:02 +02:00
python
scripts perf scripts python: intel-pt-events.py: Fix printing of switch events 2021-12-28 17:26:25 -03:00
tests perf test bpf: Skip test if clang is not present 2022-05-25 09:59:12 +02:00
trace perf beauty: Make the prctl arg regexp more strict to cope with PR_SET_VMA 2022-02-01 13:03:27 -03:00
ui perf annotate: Avoid TUI crash when navigating in the annotation of recursive functions 2022-01-10 15:47:30 -03:00
util perf tools: Add missing headers needed by util/data.h 2022-06-09 10:25:45 +02:00
.gitignore
Build
builtin-annotate.c
builtin-bench.c perf bench: Use unbuffered output when pipe/tee'ing to a file 2021-12-16 12:18:11 -03:00
builtin-buildid-cache.c perf record: Disable debuginfod by default 2022-01-15 17:41:25 -03:00
builtin-buildid-list.c
builtin-c2c.c perf cpumap: Give CPUs their own type 2022-01-12 14:28:23 -03:00
builtin-config.c
builtin-daemon.c
builtin-data.c
builtin-diff.c
builtin-evlist.c
builtin-ftrace.c perf ftrace: system_wide collection is not effective by default 2022-02-06 09:19:51 -03:00
builtin-help.c
builtin-inject.c perf tools: Remove redundant err variable 2022-01-22 17:25:02 -03:00
builtin-kallsyms.c
builtin-kmem.c perf cpumap: Give CPUs their own type 2022-01-12 14:28:23 -03:00
builtin-kvm.c
builtin-list.c
builtin-lock.c
builtin-mem.c
builtin-probe.c
builtin-record.c perf record: Disable debuginfod by default 2022-01-15 17:41:25 -03:00
builtin-report.c perf report: Set PERF_SAMPLE_DATA_SRC bit for Arm SPE event 2022-04-27 14:41:13 +02:00
builtin-sched.c perf cpumap: Give CPUs their own type 2022-01-12 14:28:23 -03:00
builtin-script.c perf script: Always allow field 'data_src' for auxtrace 2022-04-27 14:41:13 +02:00
builtin-stat.c perf stat: Fix forked applications enablement of counters 2022-04-08 13:58:32 +02:00
builtin-timechart.c
builtin-top.c
builtin-trace.c perf trace: Avoid early exit due SIGCHLD from non-workload processes 2022-02-16 13:47:12 -03:00
builtin-version.c
builtin.h
check-headers.sh
command-list.txt
CREDITS
design.txt
Makefile
Makefile.config perf tools: Use Python devtools for version autodetection rather than runtime 2022-06-09 10:25:46 +02:00
Makefile.perf perf ftrace: Add -b/--use-bpf option for latency subcommand 2021-12-16 12:18:12 -03:00
MANIFEST
perf-archive.sh
perf-completion.sh
perf-iostat.sh
perf-read-vdso.c
perf-sys.h
perf-with-kcore.sh
perf.c perf tools: Fix perf's libperf_print callback 2022-04-13 19:27:34 +02:00
perf.h