Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf test: Add basic 'perf list --json" test

Test that JSON output produces valid JSON.

Reviewed-by: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20231129213428.2227448-4-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
7d723ef8 8226e4a3

+19
+19
tools/perf/tests/shell/list.sh
··· 1 + #!/bin/sh 2 + # perf list tests 3 + # SPDX-License-Identifier: GPL-2.0 4 + 5 + set -e 6 + err=0 7 + 8 + shelldir=$(dirname "$0") 9 + # shellcheck source=lib/setup_python.sh 10 + . "${shelldir}"/lib/setup_python.sh 11 + 12 + test_list_json() { 13 + echo "Json output test" 14 + perf list -j | $PYTHON -m json.tool 15 + echo "Json output test [Success]" 16 + } 17 + 18 + test_list_json 19 + exit $err