linux-stable/tools/perf/tests
Claire Jensen 0c343af2a2 perf test: JSON format checking
Add field checking tests for perf stat JSON output.

Sanity checks the expected number of fields are present, that the
expected keys are present and they have the correct values.

Committer notes:

Had to fix this:

  -               $(INSTALL) tests/shell/lib/*.sh '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell/lib' \
  +               $(INSTALL) tests/shell/lib/*.sh '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell/lib'; \

Committer testing:

  [root@quaco ~]# perf test json
   90: perf stat JSON output linter                                    : Ok
  [root@quaco ~]# set -o vi
  [root@quaco ~]# perf test -v json
   90: perf stat JSON output linter                                    :
  --- start ---
  test child forked, pid 560794
  Checking json output: no args [Success]
  Checking json output: system wide [Success]
  Checking json output: system wide Checking json output: system wide no aggregation [Success]
  Checking json output: interval [Success]
  Checking json output: event [Success]
  Checking json output: per core [Success]
  Checking json output: per thread [Success]
  Checking json output: per die [Success]
  Checking json output: per node [Success]
  Checking json output: per socket [Success]
  test child finished with 0
  ---- end ----
  perf stat JSON output linter: Ok
  [root@quaco ~]#

Signed-off-by: Claire Jensen <cjense@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alyssa Ross <hi@alyssa.is>
Cc: Claire Jensen <clairej735@gmail.com>
Cc: Florian Fischer <florian.fischer@muhq.space>
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: Like Xu <likexu@tencent.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sandipan Das <sandipan.das@amd.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
Link: https://lore.kernel.org/r/20220805200105.2020995-3-irogers@google.com
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2022-08-10 10:44:01 -03:00
..
attr perf test: Add perf_event_attr test for Arm SPE 2022-04-28 10:40:49 -03:00
shell perf test: JSON format checking 2022-08-10 10:44:01 -03:00
.gitignore
api-io.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
attr.c perf cpumap: Give CPUs their own type 2022-01-12 14:28:23 -03:00
attr.py
backward-ring-buffer.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
bitmap.c perf cpumap: Migrate to libperf cpumap api 2022-01-22 17:08:42 -03:00
bp_account.c perf test: Fix variable length array undefined behavior in bp_account 2022-06-19 10:41:43 -03:00
bp_signal.c perf test: BP tests, remove is_supported use 2021-11-13 18:11:50 -03:00
bp_signal_overflow.c perf test: BP tests, remove is_supported use 2021-11-13 18:11:50 -03:00
bpf-script-example.c perf bpf: Convert legacy map definition to BTF-defined 2022-08-01 14:43:13 -03:00
bpf-script-test-kbuild.c
bpf-script-test-prologue.c
bpf-script-test-relocation.c
bpf.c perf test bpf: Skip test if clang is not present 2022-05-21 14:54:21 -03:00
Build perf test sigtrap: Add basic stress test for sigtrap handling 2021-12-07 22:18:23 -03:00
builtin-test.c perf test: Skip reason for suites with 1 test 2022-05-23 10:00:43 -03:00
clang.c perf test: Remove skip_if_fail 2021-11-13 18:11:50 -03:00
code-reading.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
cpumap.c perf cpumap: Migrate to libperf cpumap api 2022-02-11 14:01:15 -03:00
demangle-java-test.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
demangle-ocaml-test.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
dlfilter-test.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
dso-data.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
dwarf-unwind.c perf unwind: Don't show unwind error messages when augmenting frame pointer stack 2022-04-09 12:34:29 -03:00
event-times.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
event_update.c perf cpumap: Migrate to libperf cpumap api 2022-01-22 17:08:42 -03:00
evsel-roundtrip-name.c perf evsel: Constify a few arrays 2022-05-09 10:12:14 -03:00
evsel-tp-sched.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
expand-cgroup.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
expr.c perf test: Add test for #system_tsc_freq in metrics 2022-07-25 12:29:07 -03:00
fdarray.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
genelf.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
hists_common.c
hists_common.h
hists_cumulate.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
hists_filter.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
hists_link.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
hists_output.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
is_printable_array.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
keep-tracking.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
kmod-path.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
llvm.c perf: Stop using bpf_object__open_buffer() API 2022-01-24 20:44:09 -08:00
llvm.h
make perf tools: Test build with libbpf/LIBBPF_DYNAMIC=1 2021-05-17 20:32:05 -03:00
maps.c perf test: Use pointer for maps 2022-02-14 16:51:03 -03:00
mem.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
mem2node.c perf cpumap: Migrate to libperf cpumap api 2022-01-22 17:08:42 -03:00
mmap-basic.c perf test: Add user space counter reading tests 2022-08-01 09:20:18 -03:00
mmap-thread-lookup.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
openat-syscall-all-cpus.c perf test: Use skip in openat syscall 2022-05-23 10:01:57 -03:00
openat-syscall-tp-fields.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
openat-syscall.c perf test: Use skip in openat syscall 2022-05-23 10:01:57 -03:00
parse-events.c perf test: Parse events break apart tests 2022-05-23 10:04:59 -03:00
parse-metric.c perf test: Reset shadow counts before loading 2021-12-06 21:57:53 -03:00
parse-no-sample-id-all.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
pe-file-parsing.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
pe-file.c perf tests: Add test for PE binary format support 2020-09-04 14:38:15 -03:00
pe-file.exe perf tests: Add test for PE binary format support 2020-09-04 14:38:15 -03:00
pe-file.exe.debug perf tests: Add test for PE binary format support 2020-09-04 14:38:15 -03:00
perf-hooks.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
perf-record.c perf test: Use skip in PERF_RECORD_* 2022-05-23 10:05:07 -03:00
perf-targz-src-pkg
perf-time-to-tsc.c perf tests: Fix Convert perf time to TSC test for hybrid 2022-07-17 10:57:07 -03:00
pfm.c perf test: Remove skip_if_fail 2021-11-13 18:11:50 -03:00
pmu-events.c perf test: Avoid sysfs state affecting fake events 2022-07-26 16:31:55 -03:00
pmu.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
python-use.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
sample-parsing.c perf test sample-parsing: Fix branch_stack entry endianness check 2021-11-18 10:08:07 -03:00
sdt.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
sigtrap.c perf test: Skip failing sigtrap test for arm+aarch64 2022-02-18 09:54:50 -03:00
stat.c perf cpumap: Give CPUs their own type 2022-01-12 14:28:23 -03:00
sw-clock.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
switch-tracking.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
task-exit.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
tests.h perf test sigtrap: Add basic stress test for sigtrap handling 2021-12-07 22:18:23 -03:00
thread-map.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
thread-maps-share.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
time-utils-test.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
topology.c perf test topology: Use !strncmp(right platform) to fix guest PPC comparision check 2022-06-19 10:41:43 -03:00
unit_number__scnprintf.c perf test: Rename struct test to test_suite 2021-11-13 10:32:22 -03:00
vmlinux-kallsyms.c perf test: Use skip in vmlinux kallsyms 2022-05-23 10:01:15 -03:00
wp.c perf tests wp: Remove unused functions on s390 2021-11-18 10:08:07 -03:00