Made sure the constructor for insts use ExtMachInst rather than MachInst, since other...
[gem5.git] / src / sim / stat_control.cc
index f7fc03d7409b6b9f4d142dd066ce5e6b235c9a72..3fad8beb511a7d3d8799f25f5c4e47ebe64367b5 100644 (file)
@@ -160,13 +160,13 @@ class StatEvent : public Event
     Tick repeat;
 
   public:
-    StatEvent(int _flags, Tick _when, Tick _repeat);
+    StatEvent(EventQueue *queue, int _flags, Tick _when, Tick _repeat);
     virtual void process();
     virtual const char *description();
 };
 
-StatEvent::StatEvent(int _flags, Tick _when, Tick _repeat)
-    : Event(&mainEventQueue, Stat_Event_Pri),
+StatEvent::StatEvent(EventQueue *queue, int _flags, Tick _when, Tick _repeat)
+    : Event(queue, Stat_Event_Pri),
       flags(_flags), repeat(_repeat)
 {
     setFlags(AutoDelete);
@@ -185,8 +185,10 @@ StatEvent::process()
     if (flags & Stats::Dump)
         DumpNow();
 
-    if (flags & Stats::Reset)
+    if (flags & Stats::Reset) {
+        cprintf("Resetting stats at cycle %d!\n", curTick);
         reset();
+    }
 
     if (repeat)
         schedule(curTick + repeat);
@@ -214,15 +216,17 @@ DumpNow()
 }
 
 void
-SetupEvent(int flags, Tick when, Tick repeat)
+SetupEvent(int flags, Tick when, Tick repeat, EventQueue *queue)
 {
-    new StatEvent(flags, when, repeat);
+    if (queue == NULL)
+        queue = &mainEventQueue;
+
+    new StatEvent(queue, flags, when, repeat);
 }
 
 /* namespace Stats */ }
 
-extern "C" void
-debugDumpStats()
+void debugDumpStats()
 {
     Stats::DumpNow();
 }