aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/stat.h
diff options
context:
space:
mode:
authoryuzhoujian <yuzhoujian@didichuxing.com>2018-01-29 10:25:22 +0100
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-02-16 10:09:24 -0300
commitdb06a269ecbb1d71d534fc5713624eeeee0b8f92 (patch)
treeb8c81956f4d193ec5066b8a1f0a89dc135931393 /tools/perf/util/stat.h
parentperf report: Add support to display group output for non group events (diff)
downloadlinux-dev-db06a269ecbb1d71d534fc5713624eeeee0b8f92.tar.xz
linux-dev-db06a269ecbb1d71d534fc5713624eeeee0b8f92.zip
perf stat: Add support to print counts for fixed times
Introduce a new option to print counts for fixed number of times and update 'perf stat' documentation accordingly. Show below is the output of the new option for perf stat. $ perf stat -I 1000 --interval-count 2 -e cycles -a # time counts unit events 1.002827089 93,884,870 cycles 2.004231506 56,573,446 cycles We can just print the counts for several times with this newly introduced option. The usage of it is a little like 'vmstat', and it should be used together with "-I" option. $ vmstat -n 1 2 procs ---------memory-------------- --swap- ----io-- -system-- ------cpu--- r b swpd free buff cache si so bi bo in cs us sy id wa st 0 0 0 78270544 547484 51732076 0 0 0 20 1 1 1 0 99 0 0 0 0 0 78270512 547484 51732080 0 0 0 16 477 1555 0 0 100 0 0 Changes since v3: - merge interval_count check and times check to one line. - fix the wrong indent in stat.h - use stat_config.times instead of 'times' in cmd_stat function. Changes since v2: - none. Changes since v1: - change the name of the new option "times-print" to "interval-count". - keep the new option interval specifically. Signed-off-by: yuzhoujian <yuzhoujian@didichuxing.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Kan Liang <kan.liang@intel.com> Cc: Milian Wolff <milian.wolff@kdab.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/r/1517217923-8302-2-git-send-email-ufo19890607@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/stat.h')
-rw-r--r--tools/perf/util/stat.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h
index dbc6f7134f61..540fbb350e53 100644
--- a/tools/perf/util/stat.h
+++ b/tools/perf/util/stat.h
@@ -90,6 +90,7 @@ struct perf_stat_config {
bool scale;
FILE *output;
unsigned int interval;
+ int times;
struct runtime_stat *stats;
int stats_num;
};