Skip to content

Commit e4ef3ef

Browse files
committed
perf test: Set PERF_EXEC_PATH for script execution
The task-analyzer.py script (actually every other scripts too) requires PERF_EXEC_PATH env to find dependent libraries and scripts. For scripts test to run correctly, it needs to set PERF_EXEC_PATH to the perf tool source directory. Instead of blindly update the env, let's check the directory structure to make sure it points to the correct location. Fixes: e8478b8 ("perf test: add new task-analyzer tests") Cc: Petar Gligoric <[email protected]> Cc: Hagen Paul Pfeifer <[email protected]> Cc: Aditya Gupta <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Ingo Molnar <[email protected]> Acked-by: Ian Rogers <[email protected]> Signed-off-by: Namhyung Kim <[email protected]>
1 parent 2d7f554 commit e4ef3ef

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/perf/tests/shell/test_task_analyzer.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
tmpdir=$(mktemp -d /tmp/perf-script-task-analyzer-XXXXX)
66
err=0
77

8+
# set PERF_EXEC_PATH to find scripts in the source directory
9+
perfdir=$(dirname "$0")/../..
10+
if [ -e "$perfdir/scripts/python/Perf-Trace-Util" ]; then
11+
export PERF_EXEC_PATH=$perfdir
12+
fi
13+
814
cleanup() {
915
rm -f perf.data
1016
rm -f perf.data.old

0 commit comments

Comments
 (0)