diff options
author | Nathan Binkert <binkertn@umich.edu> | 2004-02-25 16:13:00 -0500 |
---|---|---|
committer | Nathan Binkert <binkertn@umich.edu> | 2004-02-25 16:13:00 -0500 |
commit | 087a2ed6a13e6bcd7eeff09e324707d9bb8432b4 (patch) | |
tree | 35b3d60798fdc30b9cee16494306428ee81b9e8e | |
parent | 6a306d4cafae360c9107a845ee2d08c8667453ae (diff) | |
parent | b678152277d5f876efcf7bcac99926a977fdccac (diff) | |
download | gem5-087a2ed6a13e6bcd7eeff09e324707d9bb8432b4.tar.xz |
Merge zizzer.eecs.umich.edu:/bk/m5
into ziff.eecs.umich.edu:/z/binkertn/research/m5/latest
--HG--
extra : convert_revision : 2a258d16ba51ce34f5748825a94b456abfb577cc
-rw-r--r-- | base/statistics.cc | 14 | ||||
-rw-r--r-- | base/statistics.hh | 15 |
2 files changed, 16 insertions, 13 deletions
diff --git a/base/statistics.cc b/base/statistics.cc index 49294ad27..dce545f18 100644 --- a/base/statistics.cc +++ b/base/statistics.cc @@ -57,7 +57,7 @@ __nan() } #endif -#ifdef STAT_DEBUG +#ifdef DEBUG static int total_stats = 0; #endif @@ -409,6 +409,14 @@ DataAccess::setPrint() Database::StatDB().regPrint(this); } +StatData::StatData() + : flags(none), precision(-1), prereq(0) +{ +#ifdef DEBUG + number = total_stats++; +#endif +} + StatData::~StatData() { } @@ -443,8 +451,8 @@ bool StatData::baseCheck() const { if (!(flags & init)) { -#ifdef STAT_DEBUG - cprintf("this is stat number %d\n",(*i)->number); +#ifdef DEBUG + cprintf("this is stat number %d\n", number); #endif panic("Not all stats have been initialized"); return false; diff --git a/base/statistics.hh b/base/statistics.hh index d8b78fbff..71d2aa8c8 100644 --- a/base/statistics.hh +++ b/base/statistics.hh @@ -60,12 +60,6 @@ #include "base/str.hh" #include "sim/host.hh" -// -// Un-comment this to enable weirdo-stat debugging -// -// #define STAT_DEBUG - - #ifndef NAN float __nan(); /** Define Not a number. */ @@ -146,10 +140,7 @@ struct StatData /** A pointer to a prerequisite Stat. */ const StatData *prereq; - StatData() - : flags(none), precision(-1), prereq(0) - {} - + StatData(); virtual ~StatData(); /** @@ -193,6 +184,10 @@ struct StatData * @return stat1's name is alphabetically before stat2's */ static bool less(StatData *stat1, StatData *stat2); + +#ifdef DEBUG + int number; +#endif }; struct ScalarDataBase : public StatData |