diff options
author | David Guillen Fandos <david.guillen@arm.com> | 2016-07-21 17:19:15 +0100 |
---|---|---|
committer | David Guillen Fandos <david.guillen@arm.com> | 2016-07-21 17:19:15 +0100 |
commit | d25b58036a040d8ac733b824e2865e1f5fe43e00 (patch) | |
tree | b8b2cd01c429e9c89555f738c14f975dbcc52313 /src/base/stats | |
parent | 0020662459fdd9efcfe9864ef12160515434ccdb (diff) | |
download | gem5-d25b58036a040d8ac733b824e2865e1f5fe43e00.tar.xz |
base: Add total() to Vector2D stat
This patch adds a total() function to the Vector2D
stat type. Similar to other stats such as Scalar or
Vector it is useful to be able to read the total for
a given stat.
Diffstat (limited to 'src/base/stats')
-rw-r--r-- | src/base/stats/info.hh | 2 | ||||
-rw-r--r-- | src/base/stats/text.cc | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/base/stats/info.hh b/src/base/stats/info.hh index b2ba41485..6ce7376a4 100644 --- a/src/base/stats/info.hh +++ b/src/base/stats/info.hh @@ -229,6 +229,8 @@ class Vector2dInfo : public Info mutable VCounter cvec; void enable(); + + virtual Result total() const = 0; }; class FormulaInfo : public VectorInfo diff --git a/src/base/stats/text.cc b/src/base/stats/text.cc index 05ce33cdf..ae09b9b8d 100644 --- a/src/base/stats/text.cc +++ b/src/base/stats/text.cc @@ -588,7 +588,6 @@ Text::visit(const Vector2dInfo &info) } VResult tot_vec(info.y); - VResult super_total(1, 0.0); for (off_type i = 0; i < info.x; ++i) { if (havesub && (i >= info.subnames.size() || info.subnames[i].empty())) continue; @@ -601,7 +600,6 @@ Text::visit(const Vector2dInfo &info) yvec[j] = info.cvec[iy + j]; tot_vec[j] += yvec[j]; total += yvec[j]; - super_total[0] += yvec[j]; } print.name = info.name + "_" + @@ -620,7 +618,7 @@ Text::visit(const Vector2dInfo &info) print.name = info.name; print.subnames = total_subname; print.desc = info.desc; - print.vec = super_total; + print.vec = VResult(1, info.total()); print.flags = print.flags & ~total; print(*stream); } |