[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-d6a947fb6cdff3a19db93895c746f70b5903a965@git.kernel.org>
Date: Tue, 12 Aug 2014 22:19:45 -0700
From: tip-bot for Thomas Ilsche <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: acme@...hat.com, linux-kernel@...r.kernel.org, paulus@...ba.org,
hpa@...or.com, mingo@...nel.org, a.p.zijlstra@...llo.nl,
namhyung@...nel.org, jolsa@...hat.com, thomas.ilsche@...dresden.de,
tglx@...utronix.de
Subject: [tip:perf/core] perf tools: Default to python version 2
Commit-ID: d6a947fb6cdff3a19db93895c746f70b5903a965
Gitweb: http://git.kernel.org/tip/d6a947fb6cdff3a19db93895c746f70b5903a965
Author: Thomas Ilsche <thomas.ilsche@...dresden.de>
AuthorDate: Mon, 4 Aug 2014 15:03:15 +0200
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Tue, 12 Aug 2014 12:03:08 -0300
perf tools: Default to python version 2
According to PEP 394 recommendation [1], it's more portable to use
python2 rather than plain python to refer python binary version 2.
Since there're distros using python3 by default like Arch, and we don't
support python3 (yet), it'd be better using python2 explicitly.
But older versions (prior to 2.7) seem not to provide python2 but just
python. Given that it's only old version, try python2 first and then
fallback to python. It'll ensure that it always points to python 2.x.
I tested (compiles and perf script runs) with the combinations:
1) python -> python2.x, python-config -> python2.x-config
python2 N/A, python2-config N/A
2) python -> python3.x, python-config -> python3.x-config
python2 -> python2.x, python2-config -> python2.x-config
3) python -> python2.x, python-config -> python2.x-config
python2 -> python2.x, python2-config -> python2.x-config
4) python -> python2.x, python-config -> python2.x-config
python2 -> python2.x, python2-config N/A
Based on / replaces the patch 2/2 by Namhyung Kim.
[1] https://www.python.org/dev/peps/pep-0394
Based-on-patch-by: Namhyung Kim <namhyung@...nel.org>
Signed-off-by: Thomas Ilsche <thomas.ilsche@...dresden.de>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Link: http://lkml.kernel.org/r/53DF8493.6070206@tu-dresden.de
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/config/Makefile | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index e05d8f9..75d4c23 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -121,10 +121,16 @@ ifdef PARSER_DEBUG
endif
ifndef NO_LIBPYTHON
- override PYTHON := \
- $(call get-executable-or-default,PYTHON,python)
+ # Try different combinations to accommodate systems that only have
+ # python[2][-config] in weird combinations but always preferring
+ # python2 and python2-config as per pep-0394. If we catch a
+ # python[-config] in version 3, the version check will kill it.
+ PYTHON2 := $(if $(call get-executable,python2),python2,python)
+ override PYTHON := $(call get-executable-or-default,PYTHON,$(PYTHON2))
+ PYTHON2_CONFIG := \
+ $(if $(call get-executable,$(PYTHON)-config),$(PYTHON)-config,python-config)
override PYTHON_CONFIG := \
- $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON)-config)
+ $(call get-executable-or-default,PYTHON_CONFIG,$(PYTHON2_CONFIG))
PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists