summaryrefslogtreecommitdiff
path: root/tools/perf/builtin-stat.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2015-11-05 15:40:57 +0100
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-12-17 16:27:00 -0300
commit62ba18ba938a8740ab18e02342b282d7378986f7 (patch)
treeec3ab5fe4a51f70b5b3b9a2fd064864feb5c58a6 /tools/perf/builtin-stat.c
parent1975d36e14b3314d1d0c7a428946ec0c27fd6e95 (diff)
downloadlinux-62ba18ba938a8740ab18e02342b282d7378986f7.tar.gz
perf stat report: Process stat config event
Adding processing of stat config event and initialize stat_config object. Reported-by: Kan Liang <kan.liang@intel.com> Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1446734469-11352-14-git-send-email-jolsa@kernel.org [ Renamed 'stat' parameter to 'st' to fix 'already defined' build error with older distros (e.g. RHEL6.7) ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-stat.c')
-rw-r--r--tools/perf/builtin-stat.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 0a1cfdd70df0..1e5db50dab9e 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -1533,6 +1533,15 @@ static int __cmd_record(int argc, const char **argv)
return argc;
}
+static
+int process_stat_config_event(struct perf_tool *tool __maybe_unused,
+ union perf_event *event,
+ struct perf_session *session __maybe_unused)
+{
+ perf_event__read_stat_config(&stat_config, &event->stat_config);
+ return 0;
+}
+
static int set_maps(struct perf_stat *st)
{
if (!st->cpus || !st->threads)
@@ -1600,6 +1609,7 @@ static struct perf_stat perf_stat = {
.attr = perf_event__process_attr,
.thread_map = process_thread_map_event,
.cpu_map = process_cpu_map_event,
+ .stat_config = process_stat_config_event,
},
};