summaryrefslogtreecommitdiff
path: root/src/base/stats
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2011-01-10 11:11:17 -0800
committerNathan Binkert <nate@binkert.org>2011-01-10 11:11:17 -0800
commit8e262adf4fcc009776810b9795f907fcd468591c (patch)
treeddd1b9449a4979b0f7c93d5823e3ed70f5b1a862 /src/base/stats
parentb9ddc1a7262abe747eaf77118c2c6992617d4e91 (diff)
downloadgem5-8e262adf4fcc009776810b9795f907fcd468591c.tar.xz
stats: Add a histogram statistic type
Diffstat (limited to 'src/base/stats')
-rw-r--r--src/base/stats/info.hh2
-rw-r--r--src/base/stats/text.cc12
2 files changed, 7 insertions, 7 deletions
diff --git a/src/base/stats/info.hh b/src/base/stats/info.hh
index 421ed4a55..b1c05eed1 100644
--- a/src/base/stats/info.hh
+++ b/src/base/stats/info.hh
@@ -164,7 +164,7 @@ class VectorInfo : public Info
virtual Result total() const = 0;
};
-enum DistType { Deviation, Dist };
+enum DistType { Deviation, Dist, Hist };
struct DistData
{
diff --git a/src/base/stats/text.cc b/src/base/stats/text.cc
index 576f7e5d4..385b92a1a 100644
--- a/src/base/stats/text.cc
+++ b/src/base/stats/text.cc
@@ -377,11 +377,11 @@ DistPrint::operator()(ostream &stream) const
size_t size = data.cvec.size();
Result total = 0.0;
- if (data.underflow != NAN)
+ if (data.type == Dist && data.underflow != NAN)
total += data.underflow;
for (off_type i = 0; i < size; ++i)
total += data.cvec[i];
- if (data.overflow != NAN)
+ if (data.type == Dist && data.overflow != NAN)
total += data.overflow;
if (total) {
@@ -389,7 +389,7 @@ DistPrint::operator()(ostream &stream) const
print.cdf = 0.0;
}
- if (data.underflow != NAN) {
+ if (data.type == Dist && data.underflow != NAN) {
print.name = base + "underflows";
print.update(data.underflow, total);
print(stream);
@@ -410,7 +410,7 @@ DistPrint::operator()(ostream &stream) const
print(stream);
}
- if (data.overflow != NAN) {
+ if (data.type == Dist && data.overflow != NAN) {
print.name = base + "overflows";
print.update(data.overflow, total);
print(stream);
@@ -419,13 +419,13 @@ DistPrint::operator()(ostream &stream) const
print.pdf = NAN;
print.cdf = NAN;
- if (data.min_val != NAN) {
+ if (data.type == Dist && data.min_val != NAN) {
print.name = base + "min_value";
print.value = data.min_val;
print(stream);
}
- if (data.max_val != NAN) {
+ if (data.type == Dist && data.max_val != NAN) {
print.name = base + "max_value";
print.value = data.max_val;
print(stream);