summaryrefslogtreecommitdiff
path: root/src/base/statistics.hh
diff options
context:
space:
mode:
authorPrakash Ramrakhyani <Prakash.Ramrakhyani@arm.com>2012-01-09 18:08:20 -0600
committerPrakash Ramrakhyani <Prakash.Ramrakhyani@arm.com>2012-01-09 18:08:20 -0600
commit51aa7e4a0392d5e8f98bd7a4d09f4026dd21bd0a (patch)
tree4a93fd0bdfd9e4403053e10ac329500649216f08 /src/base/statistics.hh
parent525d1e46dcb3180c8d73996adc025ce255575bd7 (diff)
downloadgem5-51aa7e4a0392d5e8f98bd7a4d09f4026dd21bd0a.tar.xz
sim: Enable sampling of run-time for code-sections marked using pseudo insts.
This patch adds a mechanism to collect run time samples for specific portions of a benchmark, using work_begin and work_end pseudo instructions.It also enhances the histogram stat to report geometric mean.
Diffstat (limited to 'src/base/statistics.hh')
-rw-r--r--src/base/statistics.hh5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/base/statistics.hh b/src/base/statistics.hh
index d98c79414..1f8a59326 100644
--- a/src/base/statistics.hh
+++ b/src/base/statistics.hh
@@ -1477,6 +1477,8 @@ class HistStor
/** The current sum. */
Counter sum;
+ /** The sum of logarithm of each sample, used to compute geometric mean. */
+ Counter logs;
/** The sum of squares. */
Counter squares;
/** The number of samples. */
@@ -1528,6 +1530,7 @@ class HistStor
sum += val * number;
squares += val * val * number;
+ logs += log(val) * number;
samples += number;
}
@@ -1567,6 +1570,7 @@ class HistStor
data.cvec[i] = cvec[i];
data.sum = sum;
+ data.logs = logs;
data.squares = squares;
data.samples = samples;
}
@@ -1589,6 +1593,7 @@ class HistStor
sum = Counter();
squares = Counter();
samples = Counter();
+ logs = Counter();
}
};