summaryrefslogtreecommitdiff
path: root/cpu/base.cc
diff options
context:
space:
mode:
authorKevin Lim <ktlim@umich.edu>2006-03-07 22:21:39 -0500
committerKevin Lim <ktlim@umich.edu>2006-03-07 22:21:39 -0500
commit7712232e556c93204f78807194417e5b13d91cbe (patch)
tree9a49d1b3dd73b01d933943de12e7778b8b64253c /cpu/base.cc
parent97c4a84985b0f9168f60f28d5cc96be448eef4fa (diff)
downloadgem5-7712232e556c93204f78807194417e5b13d91cbe.tar.xz
Fixes to allow the ExecContext to be used for profiling.
cpu/base.cc: Change to be calls through the ExecContext instead of accessing the profile object directly. cpu/cpu_exec_context.cc: Add functions to clear and sample the profile object. cpu/cpu_exec_context.hh: Add functions to clear and sample the profile object. These are not the most flexible functions; it might be better to eventually move the quiesce, profile, and store conditional stuff out of ExecContext so they don't clutter the interface. cpu/exec_context.hh: Include functions to support using the profile object to clear itself and take samples. --HG-- extra : convert_revision : 40849915fd51303673451515debb9ecdc7afb8c8
Diffstat (limited to 'cpu/base.cc')
-rw-r--r--cpu/base.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/cpu/base.cc b/cpu/base.cc
index e2a4c214a..2eb5f7fd3 100644
--- a/cpu/base.cc
+++ b/cpu/base.cc
@@ -271,11 +271,10 @@ BaseCPU::takeOverFrom(BaseCPU *oldCPU)
for (int i = 0; i < TheISA::NumInterruptLevels; ++i)
interrupts[i] = oldCPU->interrupts[i];
intstatus = oldCPU->intstatus;
-/*
+
for (int i = 0; i < execContexts.size(); ++i)
- if (execContexts[i]->profile)
- execContexts[i]->profile->clear();
-*/
+ execContexts[i]->profileClear();
+
if (profileEvent)
profileEvent->schedule(curTick);
#endif
@@ -290,11 +289,11 @@ BaseCPU::ProfileEvent::ProfileEvent(BaseCPU *_cpu, int _interval)
void
BaseCPU::ProfileEvent::process()
{
-/* for (int i = 0, size = cpu->execContexts.size(); i < size; ++i) {
+ for (int i = 0, size = cpu->execContexts.size(); i < size; ++i) {
ExecContext *xc = cpu->execContexts[i];
- xc->profile->sample(xc->profileNode, xc->profilePC);
+ xc->profileSample();
}
-*/
+
schedule(curTick + interval);
}