ThreadState: Ensure that kernelStats is properly initialized
authorNathan Binkert <nate@binkert.org>
Wed, 18 Jun 2008 04:11:20 +0000 (21:11 -0700)
committerNathan Binkert <nate@binkert.org>
Wed, 18 Jun 2008 04:11:20 +0000 (21:11 -0700)
src/cpu/simple_thread.cc
src/cpu/thread_state.cc

index 93772fbe124e1f2a9016216b054552f821970f70..5a5444de413617386bb5b9e9cb3cb36971ad140f 100644 (file)
@@ -86,11 +86,8 @@ SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, System *_sys,
     profileNode = &dummyNode;
     profilePC = 3;
 
-    if (use_kernel_stats) {
+    if (use_kernel_stats)
         kernelStats = new TheISA::Kernel::Statistics(system);
-    } else {
-        kernelStats = NULL;
-    }
 }
 #else
 SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num, Process *_process,
index be8f822f2eb10b4436688e416cd3dd2f93ca62d0..bcfc9c924f077437668a605400ff0d7925422a57 100644 (file)
@@ -46,7 +46,7 @@
 ThreadState::ThreadState(BaseCPU *cpu, int _cpuId, int _tid)
     : baseCpu(cpu), cpuId(_cpuId), tid(_tid), lastActivate(0), lastSuspend(0),
       profile(NULL), profileNode(NULL), profilePC(0), quiesceEvent(NULL),
-      physPort(NULL), virtPort(NULL),
+      kernelStats(NULL), physPort(NULL), virtPort(NULL),
       microPC(0), nextMicroPC(1), funcExeInst(0), storeCondFailures(0)
 #else
 ThreadState::ThreadState(BaseCPU *cpu, int _cpuId, int _tid, Process *_process,