]> git.itanic.dy.fi Git - linux-stable/commit
perf test: Test perf lock contention CSV output
authorNamhyung Kim <namhyung@kernel.org>
Wed, 28 Jun 2023 20:01:41 +0000 (13:01 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Sat, 1 Jul 2023 17:49:03 +0000 (10:49 -0700)
commit2aefb4cc904f17aad03acc3e05f44cef7801c497
tree8b837eda603c6e836ce57f1ccfcedea4f1ac9a36
parentf6027053f82c9b533bb306bff64e4e8c8f92e9e4
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>
tools/perf/tests/shell/lock_contention.sh