Bug 1201811 (part 1) - Don't use integer arithmetic when summing totals in rapl. r=erahm.
authorNicholas Nethercote <nnethercote@mozilla.com>
Fri, 04 Sep 2015 01:04:46 -0700
changeset 293734 37c9cc67c1e9704eea0b6f186ed5d02e23d8f106
parent 293733 5bc2bf65bcf59e01fed8aa3f5de0c0f7df7b2e77
child 293735 b77b0bda050313973e5f24b165528ef94079bf05
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerserahm
bugs1201811
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1201811 (part 1) - Don't use integer arithmetic when summing totals in rapl. r=erahm.
tools/power/rapl.cpp
--- a/tools/power/rapl.cpp
+++ b/tools/power/rapl.cpp
@@ -679,17 +679,17 @@ Finish()
     int(n), n == 1 ? "" : "s",
     n * gSampleInterval_sec, time == 1.0 ? "" : "s");
 
   if (n == 0) {
     exit(0);
   }
 
   // Compute the mean.
-  double sum = std::accumulate(gTotals_W.begin(), gTotals_W.end(), 0);
+  double sum = std::accumulate(gTotals_W.begin(), gTotals_W.end(), 0.0);
   double mean = sum / n;
 
   // Compute the *population* standard deviation:
   //
   //   popStdDev = sqrt(Sigma(x - m)^2 / n)
   //
   // where |x| is the sum variable, |m| is the mean, and |n| is the
   // population size.