Fix up kernel stats, allow them to not be used as well.
arch/alpha/ev5.cc: Fix up some stuff I missed in the last kernel stats checkin. cpu/checker/cpu.cc: Allow the checker to disable its kernel stats. cpu/cpu_exec_context.cc: Allow CPUExecContext to be created without kernelStats. cpu/cpu_exec_context.hh: Allow CPUExecContext to be created without kernelStats. Default usage leaves kernelStats on. --HG-- extra : convert_revision : 8ed5bffd3a5b6275baa07fb4ea385eeab1a0456a
This commit is contained in:
parent
3fe3523232
commit
32509d8387
|
@ -146,7 +146,8 @@ CPUExecContext::hwrei()
|
||||||
setNextPC(readMiscReg(AlphaISA::IPR_EXC_ADDR));
|
setNextPC(readMiscReg(AlphaISA::IPR_EXC_ADDR));
|
||||||
|
|
||||||
if (!misspeculating()) {
|
if (!misspeculating()) {
|
||||||
kernelStats->hwrei();
|
if (kernelStats)
|
||||||
|
kernelStats->hwrei();
|
||||||
|
|
||||||
cpu->checkInterrupts = true;
|
cpu->checkInterrupts = true;
|
||||||
}
|
}
|
||||||
|
@ -372,10 +373,9 @@ AlphaISA::MiscRegFile::setIpr(int idx, uint64_t val, ExecContext *xc)
|
||||||
if (val & 0x18) {
|
if (val & 0x18) {
|
||||||
if (xc->getKernelStats())
|
if (xc->getKernelStats())
|
||||||
xc->getKernelStats()->mode(Kernel::user, xc);
|
xc->getKernelStats()->mode(Kernel::user, xc);
|
||||||
else {
|
} else {
|
||||||
if (xc->getKernelStats())
|
if (xc->getKernelStats())
|
||||||
xc->getKernelStats()->mode(Kernel::kernel, xc);
|
xc->getKernelStats()->mode(Kernel::kernel, xc);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case AlphaISA::IPR_ICM:
|
case AlphaISA::IPR_ICM:
|
||||||
|
@ -562,7 +562,8 @@ AlphaISA::MiscRegFile::copyIprs(ExecContext *xc)
|
||||||
bool
|
bool
|
||||||
CPUExecContext::simPalCheck(int palFunc)
|
CPUExecContext::simPalCheck(int palFunc)
|
||||||
{
|
{
|
||||||
kernelStats->callpal(palFunc, proxy);
|
if (kernelStats)
|
||||||
|
kernelStats->callpal(palFunc, proxy);
|
||||||
|
|
||||||
switch (palFunc) {
|
switch (palFunc) {
|
||||||
case PAL::halt:
|
case PAL::halt:
|
||||||
|
|
|
@ -103,7 +103,7 @@ CheckerCPU::setMemory(FunctionalMemory *mem)
|
||||||
execContexts.push_back(xcProxy);
|
execContexts.push_back(xcProxy);
|
||||||
#else
|
#else
|
||||||
if (systemPtr) {
|
if (systemPtr) {
|
||||||
cpuXC = new CPUExecContext(this, 0, systemPtr, itb, dtb, memPtr);
|
cpuXC = new CPUExecContext(this, 0, systemPtr, itb, dtb, memPtr, false);
|
||||||
|
|
||||||
cpuXC->setStatus(ExecContext::Suspended);
|
cpuXC->setStatus(ExecContext::Suspended);
|
||||||
xcProxy = cpuXC->getProxy();
|
xcProxy = cpuXC->getProxy();
|
||||||
|
@ -122,7 +122,7 @@ CheckerCPU::setSystem(System *system)
|
||||||
systemPtr = system;
|
systemPtr = system;
|
||||||
|
|
||||||
if (memPtr) {
|
if (memPtr) {
|
||||||
cpuXC = new CPUExecContext(this, 0, systemPtr, itb, dtb, memPtr);
|
cpuXC = new CPUExecContext(this, 0, systemPtr, itb, dtb, memPtr, false);
|
||||||
|
|
||||||
cpuXC->setStatus(ExecContext::Suspended);
|
cpuXC->setStatus(ExecContext::Suspended);
|
||||||
xcProxy = cpuXC->getProxy();
|
xcProxy = cpuXC->getProxy();
|
||||||
|
|
|
@ -53,8 +53,9 @@ using namespace std;
|
||||||
// constructor
|
// constructor
|
||||||
#if FULL_SYSTEM
|
#if FULL_SYSTEM
|
||||||
CPUExecContext::CPUExecContext(BaseCPU *_cpu, int _thread_num, System *_sys,
|
CPUExecContext::CPUExecContext(BaseCPU *_cpu, int _thread_num, System *_sys,
|
||||||
AlphaITB *_itb, AlphaDTB *_dtb,
|
AlphaITB *_itb, AlphaDTB *_dtb,
|
||||||
FunctionalMemory *_mem)
|
FunctionalMemory *_mem,
|
||||||
|
bool use_kernel_stats)
|
||||||
: _status(ExecContext::Unallocated), cpu(_cpu), thread_num(_thread_num),
|
: _status(ExecContext::Unallocated), cpu(_cpu), thread_num(_thread_num),
|
||||||
cpu_id(-1), lastActivate(0), lastSuspend(0), mem(_mem), itb(_itb),
|
cpu_id(-1), lastActivate(0), lastSuspend(0), mem(_mem), itb(_itb),
|
||||||
dtb(_dtb), system(_sys), memctrl(_sys->memctrl), physmem(_sys->physmem),
|
dtb(_dtb), system(_sys), memctrl(_sys->memctrl), physmem(_sys->physmem),
|
||||||
|
@ -79,6 +80,12 @@ CPUExecContext::CPUExecContext(BaseCPU *_cpu, int _thread_num, System *_sys,
|
||||||
static ProfileNode dummyNode;
|
static ProfileNode dummyNode;
|
||||||
profileNode = &dummyNode;
|
profileNode = &dummyNode;
|
||||||
profilePC = 3;
|
profilePC = 3;
|
||||||
|
|
||||||
|
if (use_kernel_stats) {
|
||||||
|
kernelStats = new Kernel::Statistics(system);
|
||||||
|
} else {
|
||||||
|
kernelStats = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
CPUExecContext::CPUExecContext(BaseCPU *_cpu, int _thread_num,
|
CPUExecContext::CPUExecContext(BaseCPU *_cpu, int _thread_num,
|
||||||
|
@ -279,8 +286,8 @@ void
|
||||||
CPUExecContext::regStats(const string &name)
|
CPUExecContext::regStats(const string &name)
|
||||||
{
|
{
|
||||||
#if FULL_SYSTEM
|
#if FULL_SYSTEM
|
||||||
kernelStats = new Kernel::Statistics(system);
|
if (kernelStats)
|
||||||
kernelStats->regStats(name + ".kern");
|
kernelStats->regStats(name + ".kern");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -193,7 +193,8 @@ class CPUExecContext
|
||||||
// constructor: initialize context from given process structure
|
// constructor: initialize context from given process structure
|
||||||
#if FULL_SYSTEM
|
#if FULL_SYSTEM
|
||||||
CPUExecContext(BaseCPU *_cpu, int _thread_num, System *_system,
|
CPUExecContext(BaseCPU *_cpu, int _thread_num, System *_system,
|
||||||
AlphaITB *_itb, AlphaDTB *_dtb, FunctionalMemory *_dem);
|
AlphaITB *_itb, AlphaDTB *_dtb, FunctionalMemory *_mem,
|
||||||
|
bool use_kernel_stats = true);
|
||||||
#else
|
#else
|
||||||
CPUExecContext(BaseCPU *_cpu, int _thread_num, Process *_process, int _asid);
|
CPUExecContext(BaseCPU *_cpu, int _thread_num, Process *_process, int _asid);
|
||||||
CPUExecContext(BaseCPU *_cpu, int _thread_num, FunctionalMemory *_mem,
|
CPUExecContext(BaseCPU *_cpu, int _thread_num, FunctionalMemory *_mem,
|
||||||
|
|
Loading…
Reference in a new issue