X86: Define a noop ExtMachInst.
[gem5.git] / src / arch / alpha / kernel_stats.cc
index 13dc95af7934988f1b7b8166d7fcfeb03064dc2b..6e9dc1611ca3b5f3721b9ccc48cbbec8ddb0b5e0 100644 (file)
@@ -33,6 +33,7 @@
 #include <stack>
 #include <string>
 
+#include "arch/alpha/linux/threadinfo.hh"
 #include "arch/alpha/kernel_stats.hh"
 #include "arch/alpha/osfpal.hh"
 #include "base/trace.hh"
@@ -137,8 +138,9 @@ Statistics::changeMode(cpu_mode newmode, ThreadContext *tc)
     if (newmode == themode)
         return;
 
-    DPRINTF(Context, "old mode=%-8s new mode=%-8s\n",
-            modestr[themode], modestr[newmode]);
+    DPRINTF(Context, "old mode=%s new mode=%s pid=%d\n",
+            modestr[themode], modestr[newmode],
+            Linux::ThreadInfo(tc).curTaskPID());
 
     _modeGood[newmode]++;
     _modeTicks[themode] += curTick - lastModeTick;
@@ -150,7 +152,7 @@ Statistics::changeMode(cpu_mode newmode, ThreadContext *tc)
 void
 Statistics::mode(cpu_mode newmode, ThreadContext *tc)
 {
-    Addr pcbb = tc->readMiscRegNoEffect(AlphaISA::IPR_PALtemp23);
+    Addr pcbb = tc->readMiscRegNoEffect(IPR_PALtemp23);
 
     if (newmode == kernel && pcbb == idleProcess)
         newmode = idle;
@@ -165,6 +167,10 @@ Statistics::context(Addr oldpcbb, Addr newpcbb, ThreadContext *tc)
 
     _swap_context++;
     changeMode(newpcbb == idleProcess ? idle : kernel, tc);
+
+    DPRINTF(Context, "Context Switch old pid=%d new pid=%d\n",
+            Linux::ThreadInfo(tc, oldpcbb).curTaskPID(),
+            Linux::ThreadInfo(tc, newpcbb).curTaskPID());
 }
 
 void
@@ -207,5 +213,5 @@ Statistics::unserialize(Checkpoint *cp, const string &section)
     themode = (cpu_mode)exemode;
 }
 
-} /* end namespace AlphaISA::Kernel */
-} /* end namespace AlphaISA */
+} // namespace Kernel
+} // namespace AlphaISA