summaryrefslogtreecommitdiff
path: root/src/base/stats/text.cc
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2011-05-12 11:19:35 -0700
committerNathan Binkert <nate@binkert.org>2011-05-12 11:19:35 -0700
commit1177e7a3c861d77360074e97661952d427cd8640 (patch)
treefc15f17092933cb9591cfadb1da2728d40e776d1 /src/base/stats/text.cc
parent35b0c1d3910595875de67a34f6b993047470fd55 (diff)
downloadgem5-1177e7a3c861d77360074e97661952d427cd8640.tar.xz
stats: move code that loops over all stats into python
Diffstat (limited to 'src/base/stats/text.cc')
-rw-r--r--src/base/stats/text.cc29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/base/stats/text.cc b/src/base/stats/text.cc
index f1ba59f0e..45d59ff29 100644
--- a/src/base/stats/text.cc
+++ b/src/base/stats/text.cc
@@ -48,7 +48,6 @@
#include "base/stats/info.hh"
#include "base/stats/text.hh"
-#include "base/stats/visit.hh"
#include "base/cast.hh"
#include "base/misc.hh"
#include "base/str.hh"
@@ -138,12 +137,14 @@ Text::valid() const
}
void
-Text::output()
+Text::begin()
{
ccprintf(*stream, "\n---------- Begin Simulation Statistics ----------\n");
- list<Info *>::const_iterator i, end = statsList().end();
- for (i = statsList().begin(); i != end; ++i)
- (*i)->visit(*this);
+}
+
+void
+Text::end()
+{
ccprintf(*stream, "\n---------- End Simulation Statistics ----------\n");
stream->flush();
}
@@ -580,23 +581,19 @@ Text::visit(const FormulaInfo &info)
visit((const VectorInfo &)info);
}
-bool
+Output *
initText(const string &filename, bool desc)
{
static Text text;
static bool connected = false;
- if (connected)
- return false;
-
- extern list<Output *> OutputList;
-
- text.open(*simout.find(filename));
- text.descriptions = desc;
- OutputList.push_back(&text);
- connected = true;
+ if (!connected) {
+ text.open(*simout.find(filename));
+ text.descriptions = desc;
+ connected = true;
+ }
- return true;
+ return &text;
}
} // namespace Stats