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 <irogers@google.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kajol Jain <kjain@linux.ibm.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ravi Bangoria <ravi.bangoria@amd.com> Cc: Ross Zwisler <zwisler@chromium.org> Cc: Shirisha G <shirisha@linux.ibm.com> Link: https://lore.kernel.org/r/20240124043015.1388867-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 79bacb6 commit a734c7f

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

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)