summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2011-01-10 11:11:16 -0800
committerNathan Binkert <nate@binkert.org>2011-01-10 11:11:16 -0800
commitff592e0ed1d03609a3e0d8dee9a4fc83a3d8e807 (patch)
tree79b3537e98fd900a4b570e64e3479c8d1bae0909
parentfcc621ac796f824f784ecae2e4335ab183313000 (diff)
downloadgem5-ff592e0ed1d03609a3e0d8dee9a4fc83a3d8e807.tar.xz
stats: fix the distribution stat
-rw-r--r--src/base/statistics.hh5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/base/statistics.hh b/src/base/statistics.hh
index 9c10164a9..529871dc4 100644
--- a/src/base/statistics.hh
+++ b/src/base/statistics.hh
@@ -1361,9 +1361,8 @@ class DistStor
if (val > max_val)
max_val = val;
- Counter sample = val * number;
- sum += sample;
- squares += sample * sample;
+ sum += val * number;
+ squares += val * val * number;
samples += number;
}