3 # SPDX-License-Identifier: GPL-2.0
7 shelldir
=$
(dirname "$0")
8 # shellcheck source=lib/setup_python.sh
9 .
"${shelldir}"/lib
/setup_python.sh
11 list_output
=$
(mktemp
/tmp
/__perf_test.list_output.json.XXXXX
)
14 rm -f "${list_output}"
23 trap trap_cleanup EXIT TERM INT
26 echo "Json output test"
27 # Generate perf list json output into list_output file.
28 perf list
-j -o "${list_output}"
29 # Validate the json using python, redirect the json copy to /dev/null as
30 # otherwise the test may block writing to stdout.
31 $PYTHON -m json.tool
"${list_output}" /dev
/null
32 echo "Json output test [Success]"