lkml.org 
[lkml]   [2012]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] perf test: Check python path on attr test
Date
From: Namhyung Kim <namhyung.kim@lge.com>

Current perf test code tries to execute python version 2 in order to
test attributes on perf_event_open syscall. However it's not default
python version anymore a system can have python v3 only or v2 with a
different name (e.g. python2). So if there's no such python
interpreter with the name 'python', the test would fail like this
(yes, it's happened on my new archlinux laptop :).

13: struct perf_event_attr setup :sh: python: command not found
FAILED!

As we can pass name of the python interpreter on make, use it for
the attr test also.

Cc: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/Makefile | 2 +-
tools/perf/tests/attr.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 7d6d2846477b..2e9a287b3a23 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -952,7 +952,7 @@ $(OUTPUT)util/exec_cmd.o: util/exec_cmd.c $(OUTPUT)PERF-CFLAGS

$(OUTPUT)tests/attr.o: tests/attr.c $(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \
- '-DBINDIR="$(bindir_SQ)"' \
+ '-DBINDIR="$(bindir_SQ)"' -DPYTHON='"$(PYTHON_WORD)"' \
$<

$(OUTPUT)util/config.o: util/config.c $(OUTPUT)PERF-CFLAGS
diff --git a/tools/perf/tests/attr.c b/tools/perf/tests/attr.c
index 25638a986257..6a6be5ea1311 100644
--- a/tools/perf/tests/attr.c
+++ b/tools/perf/tests/attr.c
@@ -146,7 +146,7 @@ static int run_dir(const char *d, const char *perf)
{
char cmd[3*PATH_MAX];

- snprintf(cmd, 3*PATH_MAX, "python %s/attr.py -d %s/attr/ -p %s %s",
+ snprintf(cmd, 3*PATH_MAX, PYTHON " %s/attr.py -d %s/attr/ -p %s %s",
d, d, perf, verbose ? "-v" : "");

return system(cmd);
--
1.7.11.7


\
 
 \ /
  Last update: 2012-12-17 09:01    [W:0.045 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site