1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/tools/perf/tests/shell
Athira Rajeev 58d4802a5e perf tests stat+json_output: Include sanity check for topology
Testcase stat+json_output.sh fails in powerpc:

	86: perf stat JSON output linter : FAILED!

The testcase "stat+json_output.sh" verifies perf stat JSON output. The
test covers aggregation modes like per-socket, per-core, per-die, -A
(no_aggr mode) along with few other tests. It counts expected fields for
various commands. For example say -A (i.e, AGGR_NONE mode), expects 7
fields in the output having "CPU" as first field. Same way, for
per-socket, it expects the first field in result to point to socket id.
The testcases compares the result with expected count.

The values for socket, die, core and cpu are fetched from topology
directory:

  /sys/devices/system/cpu/cpu*/topology.

For example, socket value is fetched from "physical_package_id" file of
topology directory.  (cpu__get_topology_int() in util/cpumap.c)

If a platform fails to fetch the topology information, values will be
set to -1. For example, incase of pSeries platform of powerpc, value for
"physical_package_id" is restricted and not exposed. So, -1 will be
assigned.

Perf code has a checks for valid cpu id in "aggr_printout"
(stat-display.c), which displays the fields. So, in cases where topology
values not exposed, first field of the output displaying will be empty.
This cause the testcase to fail, as it counts  number of fields in the
output.

Incase of -A (AGGR_NONE mode,), testcase expects 7 fields in the output,
becos of -1 value obtained from topology files for some, only 6 fields
are printed. Hence a testcase failure reported due to mismatch in number
of fields in the output.

Patch here adds a sanity check in the testcase for topology.  Check will
help to skip the test if -1 value found.

Fixes: 0c343af2a2 ("perf test: JSON format checking")
Reported-by: Disha Goel <disgoel@linux.vnet.ibm.com>
Suggested-by: Ian Rogers <irogers@google.com>
Suggested-by: James Clark <james.clark@arm.com>
Signed-off-by: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
Cc: Claire Jensen <cjense@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nageswara R Sastry <rnsastry@linux.ibm.com>
Link: https://lore.kernel.org/r/20221006155149.67205-2-atrajeev@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2022-10-15 10:13:16 -03:00
..
coresight perf test coresight: Add unroll thread test shell script 2022-10-06 14:50:55 -03:00
lib perf test: Add CoreSight shell lib shared code for future tests 2022-10-06 11:12:14 -03:00
buildid.sh perf buildid-cache: Add test for PE executable 2021-03-02 09:41:04 -03:00
daemon.sh Merge remote-tracking branch 'torvalds/master' into perf/core 2021-03-29 10:39:10 -03:00
lock_contention.sh perf test: Add kernel lock contention test 2022-10-04 08:55:23 -03:00
pipe_test.sh perf tools: Add pipe_test.sh to verify pipe operations 2021-08-02 10:14:58 -03:00
probe_vfs_getname.sh perf tests: Add missing SPDX headers 2019-06-17 15:57:19 -03:00
record+probe_libc_inet_pton.sh Merge remote-tracking branch 'tip/perf/core' into perf/urgent 2019-07-08 13:06:57 -03:00
record+script_probe_vfs_getname.sh perf test: Fix record+script_probe_vfs_getname.sh /tmp cleanup 2021-10-26 11:14:49 -03:00
record+zstd_comp_decomp.sh perf tests: Remove bash construct from record+zstd_comp_decomp.sh 2021-11-13 18:11:51 -03:00
record.sh perf test: Fix test case 87 ("perf record tests") for hybrid systems 2022-09-29 09:52:56 -03:00
record_offcpu.sh perf offcpu: Update offcpu test for child process 2022-08-11 17:57:45 -03:00
stat+csv_output.sh perf tests stat+csv_output: Include sanity check for topology 2022-10-15 10:13:16 -03:00
stat+csv_summary.sh perf test: Add CSV summary test 2021-03-24 10:21:57 -03:00
stat+json_output.sh perf tests stat+json_output: Include sanity check for topology 2022-10-15 10:13:16 -03:00
stat+shadow_stat.sh perf tests: Skip 'perf stat metrics (shadow stat) test' for hybrid 2021-04-29 10:31:00 -03:00
stat.sh perf test: Stat test for repeat with a weak group 2022-08-27 11:55:17 -03:00
stat_all_metricgroups.sh perf test: Enable system wide for metricgroups test 2022-01-11 18:46:23 -03:00
stat_all_metrics.sh perf test: Make all metrics test more tolerant 2022-07-12 08:54:47 -03:00
stat_all_pmu.sh perf test: Fix "all PMU test" to skip hv_24x7/hv_gpci tests on powerpc 2022-05-21 14:45:06 -03:00
stat_bpf_counters.sh perf test: Remove bash construct from stat_bpf_counters.sh test 2021-11-13 18:11:51 -03:00
stat_bpf_counters_cgrp.sh perf test: Add a new test for perf stat cgroup BPF counter 2022-09-21 10:30:55 -03:00
test_arm_callgraph_fp.sh perf test: Record only user callchains on the "Check Arm64 callgraphs are complete in fp mode" test 2022-06-19 10:41:43 -03:00
test_arm_coresight.sh perf test: Fix test_arm_coresight.sh failures on Juno 2022-10-14 10:32:39 -03:00
test_arm_spe.sh perf test: Add ARM SPE system wide test 2022-08-01 14:46:30 -03:00
test_arm_spe_fork.sh perf test arm-spe: Check if perf-record hangs when recording workload with forks 2022-06-03 21:18:35 +02:00
test_brstack.sh perf tests powerpc: Fix branch stack sampling test to include sanity check for branch filter 2022-09-26 10:24:31 -03:00
test_data_symbol.sh perf test: Introduce script for data symbol testing 2022-10-06 11:12:14 -03:00
test_intel_pt.sh perf test: test_intel_pt.sh: Add 9 tests 2022-10-15 10:13:16 -03:00
test_java_symbol.sh perf test: Introduce script for java symbol testing 2022-10-04 08:55:23 -03:00
trace+probe_vfs_getname.sh perf tests: Fix trace+probe_vfs_getname.sh /tmp cleanup 2021-10-26 11:17:38 -03:00