summaryrefslogtreecommitdiff
path: root/src/base/stats
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/stats
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/stats')
-rw-r--r--src/base/stats/info.hh1
-rw-r--r--src/base/stats/text.cc6
2 files changed, 7 insertions, 0 deletions
diff --git a/src/base/stats/info.hh b/src/base/stats/info.hh
index 2c5b44a38..98e811747 100644
--- a/src/base/stats/info.hh
+++ b/src/base/stats/info.hh
@@ -183,6 +183,7 @@ struct DistData
VCounter cvec;
Counter sum;
Counter squares;
+ Counter logs;
Counter samples;
};
diff --git a/src/base/stats/text.cc b/src/base/stats/text.cc
index 683ba7fe4..4cf98ca9e 100644
--- a/src/base/stats/text.cc
+++ b/src/base/stats/text.cc
@@ -367,6 +367,12 @@ DistPrint::operator()(ostream &stream) const
print.value = data.samples ? data.sum / data.samples : NAN;
print(stream);
+ if (data.type == Hist) {
+ print.name = base + "gmean";
+ print.value = data.samples ? exp(data.logs / data.samples) : NAN;
+ print(stream);
+ }
+
Result stdev = NAN;
if (data.samples)
stdev = sqrt((data.samples * data.squares - data.sum * data.sum) /