summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2009-02-26 19:29:17 -0500
committerAli Saidi <saidi@eecs.umich.edu>2009-02-26 19:29:17 -0500
commitd447ccb2c61a9225e5663ac29c999ac0a52a412f (patch)
tree4bec20ac0e8d9d3fcc2c3b0166733d24e45d49cc /src
parent6fd4bc34a154601ba0a74e41875094c20076e091 (diff)
downloadgem5-d447ccb2c61a9225e5663ac29c999ac0a52a412f.tar.xz
CPA: Add code to automatically record function symbols as CPU executes.
Diffstat (limited to 'src')
-rw-r--r--src/arch/alpha/ev5.cc3
-rw-r--r--src/cpu/o3/commit_impl.hh7
-rw-r--r--src/cpu/o3/dyn_inst_impl.hh5
-rw-r--r--src/cpu/simple/base.cc5
4 files changed, 20 insertions, 0 deletions
diff --git a/src/arch/alpha/ev5.cc b/src/arch/alpha/ev5.cc
index b3ef8f5d8..02497e282 100644
--- a/src/arch/alpha/ev5.cc
+++ b/src/arch/alpha/ev5.cc
@@ -35,6 +35,7 @@
#include "arch/alpha/osfpal.hh"
#include "arch/alpha/tlb.hh"
#include "arch/alpha/kgdb.h"
+#include "base/cp_annotate.hh"
#include "base/debug.hh"
#include "base/remote_gdb.hh"
#include "base/stats/events.hh"
@@ -560,6 +561,8 @@ SimpleThread::hwrei()
setNextPC(readMiscRegNoEffect(IPR_EXC_ADDR));
+ CPA::cpa()->swAutoBegin(tc, readNextPC());
+
if (!misspeculating()) {
if (kernelStats)
kernelStats->hwrei();
diff --git a/src/cpu/o3/commit_impl.hh b/src/cpu/o3/commit_impl.hh
index e215fe49e..7cd88b49b 100644
--- a/src/cpu/o3/commit_impl.hh
+++ b/src/cpu/o3/commit_impl.hh
@@ -36,6 +36,7 @@
#include <string>
#include "arch/utility.hh"
+#include "base/cp_annotate.hh"
#include "base/loader/symtab.hh"
#include "base/timebuf.hh"
#include "cpu/exetrace.hh"
@@ -1097,6 +1098,12 @@ DefaultCommit<Impl>::commitHead(DynInstPtr &head_inst, unsigned inst_num)
if (node)
thread[tid]->profileNode = node;
}
+ if (CPA::available()) {
+ if (head_inst->isControl()) {
+ ThreadContext *tc = thread[tid]->getTC();
+ CPA::cpa()->swAutoBegin(tc, head_inst->readNextPC());
+ }
+ }
#endif
if (head_inst->traceData) {
diff --git a/src/cpu/o3/dyn_inst_impl.hh b/src/cpu/o3/dyn_inst_impl.hh
index 6398a3afe..8d391ceaf 100644
--- a/src/cpu/o3/dyn_inst_impl.hh
+++ b/src/cpu/o3/dyn_inst_impl.hh
@@ -28,6 +28,7 @@
* Authors: Kevin Lim
*/
+#include "base/cp_annotate.hh"
#include "cpu/o3/dyn_inst.hh"
template <class Impl>
@@ -136,6 +137,10 @@ BaseO3DynInst<Impl>::hwrei()
// Set the next PC based on the value of the EXC_ADDR IPR.
this->setNextPC(this->cpu->readMiscRegNoEffect(AlphaISA::IPR_EXC_ADDR,
this->threadNumber));
+ if (CPA::available()) {
+ ThreadContext *tc = this->cpu->tcBase(this->threadNumber);
+ CPA::cpa()->swAutoBegin(tc, this->readNextPC());
+ }
// Tell CPU to clear any state it needs to if a hwrei is taken.
this->cpu->hwrei(this->threadNumber);
diff --git a/src/cpu/simple/base.cc b/src/cpu/simple/base.cc
index 9372ff43d..348d2392f 100644
--- a/src/cpu/simple/base.cc
+++ b/src/cpu/simple/base.cc
@@ -31,6 +31,7 @@
#include "arch/utility.hh"
#include "arch/faults.hh"
#include "base/cprintf.hh"
+#include "base/cp_annotate.hh"
#include "base/inifile.hh"
#include "base/loader/symtab.hh"
#include "base/misc.hh"
@@ -450,6 +451,10 @@ BaseSimpleCPU::postExecute()
comLoadEventQueue[0]->serviceEvents(numLoad);
}
+ if (CPA::available()) {
+ CPA::cpa()->swAutoBegin(tc, thread->readNextPC());
+ }
+
traceFunctions(thread->readPC());
if (traceData) {