Add Quiesce trace flag to track CPU quiesce/wakeup events.
authorSteve Reinhardt <stever@eecs.umich.edu>
Sun, 22 Oct 2006 06:32:14 +0000 (23:32 -0700)
committerSteve Reinhardt <stever@eecs.umich.edu>
Sun, 22 Oct 2006 06:32:14 +0000 (23:32 -0700)
--HG--
extra : convert_revision : 23be99d0fe6e2184523efe5d9e0a1ac7bf19d087

src/base/traceflags.py
src/cpu/quiesce_event.cc
src/sim/pseudo_inst.cc

index 298d22c2bddcef5a940a200a2edc524dfdd6ce9e..2402cf36148faf85fe51b3d6a358dd8edfc6af33 100644 (file)
@@ -133,6 +133,7 @@ baseFlags = [
     'PciConfigAll',
     'Pipeline',
     'Printf',
+    'Quiesce',
     'ROB',
     'Regs',
     'Rename',
index 8dd20db0230614af86f965f5e78f1814234b1a30..fa79e6d1efdc2a4d11e0d422b7c2b8840a903d81 100644 (file)
@@ -28,6 +28,7 @@
  * Authors: Kevin Lim
  */
 
+#include "cpu/base.hh"
 #include "cpu/thread_context.hh"
 #include "cpu/quiesce_event.hh"
 
@@ -39,6 +40,7 @@ EndQuiesceEvent::EndQuiesceEvent(ThreadContext *_tc)
 void
 EndQuiesceEvent::process()
 {
+    DPRINTF(Quiesce, "activating %s\n", tc->getCpuPtr()->name());
     tc->activate();
 }
 
index addf897c605ac74c0b7e1ee598f0711da25593f1..4eb0866a52120e4312074f0ccdfb9e21cb5c9326 100644 (file)
@@ -87,10 +87,15 @@ namespace AlphaPseudo
 
         EndQuiesceEvent *quiesceEvent = tc->getQuiesceEvent();
 
+        Tick resume = curTick + Clock::Int::ns * ns;
+
         if (quiesceEvent->scheduled())
-            quiesceEvent->reschedule(curTick + Clock::Int::ns * ns);
+            quiesceEvent->reschedule(resume);
         else
-            quiesceEvent->schedule(curTick + Clock::Int::ns * ns);
+            quiesceEvent->schedule(resume);
+
+        DPRINTF(Quiesce, "%s: quiesceNs(%d) until %d\n",
+                tc->getCpuPtr()->name(), ns, resume);
 
         tc->suspend();
         if (tc->getKernelStats())
@@ -105,12 +110,15 @@ namespace AlphaPseudo
 
         EndQuiesceEvent *quiesceEvent = tc->getQuiesceEvent();
 
+        Tick resume = curTick + tc->getCpuPtr()->cycles(cycles);
+
         if (quiesceEvent->scheduled())
-            quiesceEvent->reschedule(curTick +
-                                     tc->getCpuPtr()->cycles(cycles));
+            quiesceEvent->reschedule(resume);
         else
-            quiesceEvent->schedule(curTick +
-                                   tc->getCpuPtr()->cycles(cycles));
+            quiesceEvent->schedule(resume);
+
+        DPRINTF(Quiesce, "%s: quiesceCycles(%d) until %d\n",
+                tc->getCpuPtr()->name(), cycles, resume);
 
         tc->suspend();
         if (tc->getKernelStats())