aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/builtin-stat.c6
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++)