perf, tools, stat: Improve scaling The multiplexing scaling in perf stat mysteriously adds 0.5 to the value. This dates back to the original perf tool. Other scaling code doesn't use that strange convention. Remove the extra 0.5. Signed-off-by: Andi Kleen <ak@linux.intel.com>
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index be34f87..1d86ea9 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c
@@ -1359,7 +1359,7 @@ void perf_counts_values__scale(struct perf_counts_values *count, count->val = 0; } else if (count->run < count->ena) { scaled = 1; - count->val = (u64)((double) count->val * count->ena / count->run + 0.5); + count->val = (u64)((double) count->val * count->ena / count->run); } }