#include "base/output.hh"
#include "cpu/base.hh"
-#include "cpu/profile.hh"
#include "mem/port.hh"
#include "mem/port_proxy.hh"
#include "mem/se_translating_port_proxy.hh"
#include "sim/system.hh"
ThreadState::ThreadState(BaseCPU *cpu, ThreadID _tid, Process *_process)
- : numInst(0), numOp(0), numLoad(0), startNumLoad(0),
+ : numInst(0), numOp(0), threadStats(cpu, this),
+ numLoad(0), startNumLoad(0),
_status(ThreadContext::Halted), baseCpu(cpu),
_contextId(0), _threadId(_tid), lastActivate(0), lastSuspend(0),
- profile(NULL), profileNode(NULL), profilePC(0),
process(_process), physProxy(NULL), virtProxy(NULL),
funcExeInst(0), storeCondFailures(0)
{
return *virtProxy;
}
-void
-ThreadState::profileClear()
+ThreadState::ThreadStateStats::ThreadStateStats(BaseCPU *cpu,
+ ThreadState *thread)
+ : Stats::Group(cpu, csprintf("thread%i", thread->threadId()).c_str()),
+ ADD_STAT(numInsts, "Number of Instructions committed"),
+ ADD_STAT(numOps, "Number of Ops committed"),
+ ADD_STAT(numMemRefs, "Number of Memory References")
{
- if (profile)
- profile->clear();
-}
-void
-ThreadState::profileSample()
-{
- if (profile)
- profile->sample(profileNode, profilePC);
}