提交 0f7ff383 编写于 作者: J Jin Yao 提交者: Arnaldo Carvalho de Melo

perf test: Add CSV summary test

The patch "perf stat: Align CSV output for summary mode" aligned CSV
output and added "summary" to the first column of summary lines.

Now we check if the "summary" string is added to the CSV output.

If we set '--no-csv-summary' option, the "summary" string would not be
added, also check with this case.

Committer testing:

  $ perf test csv
  84: perf stat csv summary test     : Ok
  $
Signed-off-by: NJin Yao <yao.jin@linux.intel.com>
Acked-by: NJiri Olsa <jolsa@redhat.com>
Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jin Yao <yao.jin@intel.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20210319070156.20394-2-yao.jin@linux.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 0bdad978
#!/bin/sh
# perf stat csv summary test
# SPDX-License-Identifier: GPL-2.0
set -e
#
# 1.001364330 9224197 cycles 8012885033 100.00
# summary 9224197 cycles 8012885033 100.00
#
perf stat -e cycles -x' ' -I1000 --interval-count 1 --summary 2>&1 | \
grep -e summary | \
while read summary num event run pct
do
if [ $summary != "summary" ]; then
exit 1
fi
done
#
# 1.001360298 9148534 cycles 8012853854 100.00
#9148534 cycles 8012853854 100.00
#
perf stat -e cycles -x' ' -I1000 --interval-count 1 --summary --no-csv-summary 2>&1 | \
grep -e summary | \
while read num event run pct
do
exit 1
done
exit 0
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册