Commit 6c0345b7 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

perf stat: Add support for snapshot counters

The .snapshot file indicates that the provided event value is a snapshot
value. Bypassing the delta computation logic for such event.
Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Matt Fleming <matt.fleming@intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1416562275-12404-12-git-send-email-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 779d0b99
...@@ -443,6 +443,7 @@ static int read_cb(struct perf_evsel *evsel, int cpu, int thread __maybe_unused, ...@@ -443,6 +443,7 @@ static int read_cb(struct perf_evsel *evsel, int cpu, int thread __maybe_unused,
case AGGR_CORE: case AGGR_CORE:
case AGGR_SOCKET: case AGGR_SOCKET:
case AGGR_NONE: case AGGR_NONE:
if (!evsel->snapshot)
perf_evsel__compute_deltas(evsel, cpu, count); perf_evsel__compute_deltas(evsel, cpu, count);
perf_counts_values__scale(count, scale, NULL); perf_counts_values__scale(count, scale, NULL);
evsel->counts->cpu[cpu] = *count; evsel->counts->cpu[cpu] = *count;
...@@ -479,6 +480,7 @@ static int read_counter_aggr(struct perf_evsel *counter) ...@@ -479,6 +480,7 @@ static int read_counter_aggr(struct perf_evsel *counter)
if (read_counter(counter)) if (read_counter(counter))
return -1; return -1;
if (!counter->snapshot)
perf_evsel__compute_deltas(counter, -1, aggr); perf_evsel__compute_deltas(counter, -1, aggr);
perf_counts_values__scale(aggr, scale, &counter->counts->scaled); perf_counts_values__scale(aggr, scale, &counter->counts->scaled);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment