summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2005-02-17 02:48:56 -0500
committerNathan Binkert <binkertn@umich.edu>2005-02-17 02:48:56 -0500
commita24016c731a69c47e694458f7f564ef1630d34c1 (patch)
tree8c03f1fb82dc9c5c0c7a100d00d4e42b48b151a1 /base
parent2e4bb0fc0ca51d08b64f364305661b883e429170 (diff)
downloadgem5-a24016c731a69c47e694458f7f564ef1630d34c1.tar.xz
Several tweaks to make binning work in any simulation
configuration so that we can always have binning on. base/statistics.cc: If we're binning, and there is no bin active at the time we check all stats stuff, create a bin. base/statistics.hh: FS_MEASURE doesn't exist anymore base/stats/text.cc: don't print out bin names if there is only one bin sim/process.cc: don't zero stats. It happens automatically. Don't activate the context at the time it is registered, instead activate the first context in a startup callback. sim/process.hh: Add startup callback to initialize the first exec context --HG-- extra : convert_revision : bcb23cdb184b0abf7cecd79902f8a59b50f71fe4
Diffstat (limited to 'base')
-rw-r--r--base/statistics.cc7
-rw-r--r--base/statistics.hh2
-rw-r--r--base/stats/text.cc2
3 files changed, 9 insertions, 2 deletions
diff --git a/base/statistics.cc b/base/statistics.cc
index 6e3dae1ef..6f5caf1fe 100644
--- a/base/statistics.cc
+++ b/base/statistics.cc
@@ -286,6 +286,13 @@ check()
Database::stats().sort(StatData::less);
+#if defined(STATS_BINNING)
+ if (MainBin::curBin() == NULL) {
+ static MainBin mainBin("main bin");
+ mainBin.activate();
+ }
+#endif
+
if (i == end)
return;
diff --git a/base/statistics.hh b/base/statistics.hh
index 9ec26eb4d..667a0ed48 100644
--- a/base/statistics.hh
+++ b/base/statistics.hh
@@ -2184,7 +2184,7 @@ class SumNode : public Node
* binned. If the typedef is NoBin, nothing is binned. If it is
* MainBin, then all stats are binned under that Bin.
*/
-#if defined(FS_MEASURE) || defined(STATS_BINNING)
+#if defined(STATS_BINNING)
typedef MainBin DefaultBin;
#else
typedef NoBin DefaultBin;
diff --git a/base/stats/text.cc b/base/stats/text.cc
index f7e82a30f..8cc5ff65e 100644
--- a/base/stats/text.cc
+++ b/base/stats/text.cc
@@ -126,7 +126,7 @@ Text::output()
using namespace Database;
ccprintf(*stream, "\n---------- Begin Simulation Statistics ----------\n");
- if (bins().empty()) {
+ if (bins().empty() || bins().size() == 1) {
stat_list_t::const_iterator i, end = stats().end();
for (i = stats().begin(); i != end; ++i)
(*i)->visit(*this);