diff options
author | Jiri Olsa <jolsa@kernel.org> | 2014-11-21 04:31:15 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-12-01 18:00:31 -0500 |
commit | 6c0345b73b970078c3e71ecc614a007207a1428a (patch) | |
tree | a45e7f09514443f99f7b989a462c16fb26f8de3a | |
parent | 779d0b997e0787fc5f80110159b6c18ae0fae395 (diff) |
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: Jiri 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.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/builtin-stat.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 860e8ad06616..891086376381 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -443,7 +443,8 @@ static int read_cb(struct perf_evsel *evsel, int cpu, int thread __maybe_unused, | |||
443 | case AGGR_CORE: | 443 | case AGGR_CORE: |
444 | case AGGR_SOCKET: | 444 | case AGGR_SOCKET: |
445 | case AGGR_NONE: | 445 | case AGGR_NONE: |
446 | perf_evsel__compute_deltas(evsel, cpu, count); | 446 | if (!evsel->snapshot) |
447 | perf_evsel__compute_deltas(evsel, cpu, count); | ||
447 | perf_counts_values__scale(count, scale, NULL); | 448 | perf_counts_values__scale(count, scale, NULL); |
448 | evsel->counts->cpu[cpu] = *count; | 449 | evsel->counts->cpu[cpu] = *count; |
449 | update_shadow_stats(evsel, count->values); | 450 | update_shadow_stats(evsel, count->values); |
@@ -479,7 +480,8 @@ static int read_counter_aggr(struct perf_evsel *counter) | |||
479 | if (read_counter(counter)) | 480 | if (read_counter(counter)) |
480 | return -1; | 481 | return -1; |
481 | 482 | ||
482 | perf_evsel__compute_deltas(counter, -1, aggr); | 483 | if (!counter->snapshot) |
484 | perf_evsel__compute_deltas(counter, -1, aggr); | ||
483 | perf_counts_values__scale(aggr, scale, &counter->counts->scaled); | 485 | perf_counts_values__scale(aggr, scale, &counter->counts->scaled); |
484 | 486 | ||
485 | for (i = 0; i < 3; i++) | 487 | for (i = 0; i < 3; i++) |