mirror_ubuntu-kernels/tools/perf/tests/shell
Namhyung Kim 2aefb4cc90 perf test: Test perf lock contention CSV output
To verify CSV output, just check the number of separators (",") using
the tr and wc commands like this.

  grep -v "^#" ${result} | tr -d -c | wc -c

Now it expects 6 columns (and 5 separators) in the output, but it may
be changed later so count the field in the header first and compare it
to the actual output lines.

  $ cat ${result}
  # output: contended, total wait, max wait, avg wait, type, caller
  1, 28787, 28787, 28787, spinlock, raw_spin_rq_lock_nested+0x1b

The test looks like below now:

  $ sudo ./perf test -v contention
   86: kernel lock contention analysis test                            :
  --- start ---
  test child forked, pid 2705822
  Testing perf lock record and perf lock contention
  Testing perf lock contention --use-bpf
  Testing perf lock record and perf lock contention at the same time
  Testing perf lock contention --threads
  Testing perf lock contention --lock-addr
  Testing perf lock contention --type-filter (w/ spinlock)
  Testing perf lock contention --lock-filter (w/ tasklist_lock)
  Testing perf lock contention --callstack-filter (w/ unix_stream)
  Testing perf lock contention --callstack-filter with task aggregation
  Testing perf lock contention CSV output
  test child finished with 0
  ---- end ----
  kernel lock contention analysis test: Ok

Acked-by: Ian Rogers <irogers@google.com>
Cc: Hao Luo <haoluo@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20230628200141.2739587-5-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
2023-07-01 10:49:03 -07:00
..
coresight perf test coresight: Add unroll thread test shell script 2022-10-06 14:50:55 -03:00
lib perf test: Reorder event name checks in stat STD output linter 2023-06-23 21:35:45 -07:00
buildid.sh perf tests shell: Fixed shellcheck warnings 2023-06-13 23:40:34 -03:00
daemon.sh perf tests daemon: Address shellcheck warnings 2023-06-13 23:40:33 -03:00
lock_contention.sh perf test: Test perf lock contention CSV output 2023-07-01 10:49:03 -07:00
pipe_test.sh perf test: Replace pipe test workload with noploop 2022-11-20 11:32:23 -03:00
probe_vfs_getname.sh perf tests: Add missing SPDX headers 2019-06-17 15:57:19 -03:00
record_offcpu.sh Revert "perf build: Make BUILD_BPF_SKEL default, rename to NO_BPF_SKEL" 2023-05-06 18:07:37 -03:00
record.sh perf test: Fix record test on KVM guests 2022-11-23 10:35:45 -03:00
record+probe_libc_inet_pton.sh perf test record+probe_libc_inet_pton.sh: Use "grep -F" instead of obsolescent "fgrep" 2023-06-16 11:02:01 -03:00
record+script_probe_vfs_getname.sh perf tests shell: Fixed shellcheck warnings 2023-06-13 23:40:34 -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
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 tests stat_all_metrics: Fix shellcheck warning SC2076 2023-06-13 23:40:33 -03:00
stat_all_pfm.sh perf test: Add test of libpfm4 events 2023-06-12 15:57:53 -03:00
stat_all_pmu.sh perf test: Fix "all PMU test" to skip parametrized events 2022-12-21 14:52:40 -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
stat_bpf_counters.sh perf test: Remove bash construct from stat_bpf_counters.sh test 2021-11-13 18:11:51 -03:00
stat_metrics_values.sh perf test: Add metric value validation test 2023-06-21 22:23:32 -07:00
stat.sh perf test: Add cputype testing to perf stat 2023-05-15 09:18:43 -03:00
stat+csv_output.sh perf test: Move all the check functions of stat CSV output to lib 2023-06-16 09:58:32 -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: Address shellcheck warnings 2023-06-13 23:40:33 -03:00
stat+shadow_stat.sh perf tests stat+shadow_stat.sh: Fix all POSIX sh warnings found using shellcheck 2023-06-13 23:40:34 -03:00
stat+std_output.sh perf test: Skip metrics w/o event name in stat STD output linter 2023-06-23 21:35:45 -07:00
test_arm_callgraph_fp.sh perf tests: Fix test_arm_callgraph_fp variable expansion 2023-06-22 22:03:17 -07:00
test_arm_coresight.sh perf tests test_arm_coresight: Shellcheck fixes 2023-06-13 23:40:33 -03:00
test_arm_spe_fork.sh perf tools: Use "grep -E" instead of "egrep" 2022-12-14 15:28:19 -03:00
test_arm_spe.sh perf tests test_arm_spe: Address shellcheck warnings about signal name case 2023-06-13 23:40:33 -03:00
test_brstack.sh perf tests test_brstack.sh: Fix all POSIX sh warnings 2023-06-13 23:40:34 -03:00
test_data_symbol.sh perf tools: Use "grep -E" instead of "egrep" 2022-12-14 15:28:19 -03:00
test_intel_pt.sh perf test test_intel_pt.sh: Test sample mode with event with PMU name 2023-05-10 14:19:20 -03:00
test_java_symbol.sh perf test java symbol: Remove needless debuginfod queries 2023-05-10 12:54:53 -03:00
test_perf_data_converter_json.sh perf test: Add test validating JSON generated by 'perf data convert --to-json' 2023-05-22 15:47:48 -03:00
test_task_analyzer.sh perf test: Set PERF_EXEC_PATH for script execution 2023-06-22 22:11:13 -07:00
trace+probe_vfs_getname.sh perf tools: Use "grep -E" instead of "egrep" 2022-12-14 15:28:19 -03:00