}
#endif
-#ifdef STAT_DEBUG
+#ifdef DEBUG
static int total_stats = 0;
#endif
Database::StatDB().regPrint(this);
}
+StatData::StatData()
+ : flags(none), precision(-1), prereq(0)
+{
+#ifdef DEBUG
+ number = total_stats++;
+#endif
+}
+
StatData::~StatData()
{
}
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;
#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. */
/** A pointer to a prerequisite Stat. */
const StatData *prereq;
- StatData()
- : flags(none), precision(-1), prereq(0)
- {}
-
+ StatData();
virtual ~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