提交 f340c5fc 编写于 作者: A Andi Kleen 提交者: Arnaldo Carvalho de Melo

perf stat: Scale values by unit before metrics

Scale values by unit before passing them to the metrics printing
functions.  This is needed for TopDown, because it needs to scale the
slots correctly by pipeline width / SMTness.

For existing metrics it shouldn't make any difference, as those
generally use events that don't have any units.
Signed-off-by: NAndi Kleen <ak@linux.intel.com>
Acked-by: NJiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1462489447-31832-8-git-send-email-andi@firstfloor.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 841e3558
...@@ -307,6 +307,7 @@ int perf_stat_process_counter(struct perf_stat_config *config, ...@@ -307,6 +307,7 @@ int perf_stat_process_counter(struct perf_stat_config *config,
struct perf_counts_values *aggr = &counter->counts->aggr; struct perf_counts_values *aggr = &counter->counts->aggr;
struct perf_stat_evsel *ps = counter->priv; struct perf_stat_evsel *ps = counter->priv;
u64 *count = counter->counts->aggr.values; u64 *count = counter->counts->aggr.values;
u64 val;
int i, ret; int i, ret;
aggr->val = aggr->ena = aggr->run = 0; aggr->val = aggr->ena = aggr->run = 0;
...@@ -346,7 +347,8 @@ int perf_stat_process_counter(struct perf_stat_config *config, ...@@ -346,7 +347,8 @@ int perf_stat_process_counter(struct perf_stat_config *config,
/* /*
* Save the full runtime - to allow normalization during printout: * Save the full runtime - to allow normalization during printout:
*/ */
perf_stat__update_shadow_stats(counter, count, 0); val = counter->scale * *count;
perf_stat__update_shadow_stats(counter, &val, 0);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册