CPA: Add code to automatically record function symbols as CPU executes.
authorAli Saidi <saidi@eecs.umich.edu>
Fri, 27 Feb 2009 00:29:17 +0000 (19:29 -0500)
committerAli Saidi <saidi@eecs.umich.edu>
Fri, 27 Feb 2009 00:29:17 +0000 (19:29 -0500)
src/arch/alpha/ev5.cc
src/cpu/o3/commit_impl.hh
src/cpu/o3/dyn_inst_impl.hh
src/cpu/simple/base.cc

index b3ef8f5d889bab10567b5b0e3e1ed2e51abc96c1..02497e282bfb7a2237a84cf9534c77b401f56f5f 100644 (file)
@@ -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();
index e215fe49ea4e8f21b03384e193d8b5088f2a8c31..7cd88b49bc13bf077dddc9e9ebde6da886ae85e5 100644 (file)
@@ -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) {
index 6398a3afee8c9d9892c3bb860697b8a624ca6ab3..8d391ceaffc79bd62c6266ddc1bfe5ba05c68ad3 100644 (file)
@@ -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);
index 9372ff43d40ee5eabef9bfccc41b695726e7a198..348d2392f3e6a657b12e8e89e0b8d4308b128804 100644 (file)
@@ -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) {