Skip to content

Commit a734c7f

Browse files
captain5050acmel
authored andcommitted
perf test: Workaround debug output in list test
Write the JSON output to a specific file to avoid debug output breaking it. Signed-off-by: Ian Rogers <[email protected]> Acked-by: Namhyung Kim <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Athira Rajeev <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kajol Jain <[email protected]> Cc: Kan Liang <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Ravi Bangoria <[email protected]> Cc: Ross Zwisler <[email protected]> Cc: Shirisha G <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 79bacb6 commit a734c7f

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

tools/perf/tests/shell/list.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,32 @@
33
# SPDX-License-Identifier: GPL-2.0
44

55
set -e
6-
err=0
76

87
shelldir=$(dirname "$0")
98
# shellcheck source=lib/setup_python.sh
109
. "${shelldir}"/lib/setup_python.sh
1110

11+
list_output=$(mktemp /tmp/__perf_test.list_output.json.XXXXX)
12+
13+
cleanup() {
14+
rm -f "${list_output}"
15+
16+
trap - EXIT TERM INT
17+
}
18+
19+
trap_cleanup() {
20+
cleanup
21+
exit 1
22+
}
23+
trap trap_cleanup EXIT TERM INT
24+
1225
test_list_json() {
1326
echo "Json output test"
14-
perf list -j | $PYTHON -m json.tool
27+
perf list -j -o "${list_output}"
28+
$PYTHON -m json.tool "${list_output}"
1529
echo "Json output test [Success]"
1630
}
1731

1832
test_list_json
19-
exit $err
33+
cleanup
34+
exit 0

0 commit comments

Comments
 (0)