mirror of
https://github.com/torvalds/linux
synced 2024-09-06 01:40:28 +00:00
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>
This commit is contained in:
parent
79bacb6ad7
commit
a734c7f969
|
@ -3,17 +3,32 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
set -e
|
||||
err=0
|
||||
|
||||
shelldir=$(dirname "$0")
|
||||
# shellcheck source=lib/setup_python.sh
|
||||
. "${shelldir}"/lib/setup_python.sh
|
||||
|
||||
list_output=$(mktemp /tmp/__perf_test.list_output.json.XXXXX)
|
||||
|
||||
cleanup() {
|
||||
rm -f "${list_output}"
|
||||
|
||||
trap - EXIT TERM INT
|
||||
}
|
||||
|
||||
trap_cleanup() {
|
||||
cleanup
|
||||
exit 1
|
||||
}
|
||||
trap trap_cleanup EXIT TERM INT
|
||||
|
||||
test_list_json() {
|
||||
echo "Json output test"
|
||||
perf list -j | $PYTHON -m json.tool
|
||||
perf list -j -o "${list_output}"
|
||||
$PYTHON -m json.tool "${list_output}"
|
||||
echo "Json output test [Success]"
|
||||
}
|
||||
|
||||
test_list_json
|
||||
exit $err
|
||||
cleanup
|
||||
exit 0
|
||||
|
|
Loading…
Reference in a new issue