Merge zizzer:/bk/m5 into zeep.eecs.umich.edu:/z/saidi/work/m5
[gem5.git] / sim / stat_control.cc
index c7d2fdd5bc878e2537ed3098c94d24364a7d5291..8a8eaa7907e3926fd9ba69788c30aa9f004ed912 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003 The Regents of The University of Michigan
+ * Copyright (c) 2004 The Regents of The University of Michigan
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 
 using namespace std;
 
-Statistics::Formula hostInstRate;
-Statistics::Formula hostTickRate;
-Statistics::Value hostMemory;
-Statistics::Value hostSeconds;
+Stats::Formula hostInstRate;
+Stats::Formula hostTickRate;
+Stats::Value hostMemory;
+Stats::Value hostSeconds;
 
-Statistics::Value simTicks;
-Statistics::Value simInsts;
-Statistics::Value simFreq;
-Statistics::Formula simSeconds;
+Stats::Value simTicks;
+Stats::Value simInsts;
+Stats::Value simFreq;
+Stats::Formula simSeconds;
 
-namespace Statistics {
+namespace Stats {
 
 Time statTime(true);
 Tick startTick;
@@ -80,6 +80,12 @@ statElapsedTime()
     return elapsed();
 }
 
+Tick
+statElapsedTicks()
+{
+    return curTick - startTick;
+}
+
 SimTicksReset simTicksReset;
 
 void
@@ -105,7 +111,7 @@ InitSimStats()
         ;
 
     simTicks
-        .scalar(curTick)
+        .functor(statElapsedTicks)
         .name("sim_ticks")
         .desc("Number of ticks simulated")
         ;
@@ -173,10 +179,10 @@ StatEvent::description()
 void
 StatEvent::process()
 {
-    if (flags & Statistics::Dump)
+    if (flags & Stats::Dump)
         DumpNow();
 
-    if (flags & Statistics::Reset)
+    if (flags & Stats::Reset)
         reset();
 
     if (repeat)
@@ -205,11 +211,11 @@ SetupEvent(int flags, Tick when, Tick repeat)
     new StatEvent(flags, when, repeat);
 }
 
-/* namespace Statistics */ }
+/* namespace Stats */ }
 
 extern "C" void
 debugDumpStats()
 {
-    Statistics::DumpNow();
+    Stats::DumpNow();
 }