changeset 899ecfbce5af in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=899ecfbce5af
description:
CPA: Add code to automatically record function symbols as CPU executes.
diffstat:
4 files changed, 20 insertions(+)
src/arch/alpha/ev5.cc | 3 +++
src/cpu/o3/commit_impl.hh | 7 +++++++
src/cpu/o3/dyn_inst_impl.hh | 5 +++++
src/cpu/simple/base.cc | 5 +++++
diffs (88 lines):
diff -r c1ee8282291d -r 899ecfbce5af src/arch/alpha/ev5.cc
--- a/src/arch/alpha/ev5.cc Thu Feb 26 19:29:17 2009 -0500
+++ b/src/arch/alpha/ev5.cc Thu Feb 26 19:29:17 2009 -0500
@@ -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 @@
setNextPC(readMiscRegNoEffect(IPR_EXC_ADDR));
+ CPA::cpa()->swAutoBegin(tc, readNextPC());
+
if (!misspeculating()) {
if (kernelStats)
kernelStats->hwrei();
diff -r c1ee8282291d -r 899ecfbce5af src/cpu/o3/commit_impl.hh
--- a/src/cpu/o3/commit_impl.hh Thu Feb 26 19:29:17 2009 -0500
+++ b/src/cpu/o3/commit_impl.hh Thu Feb 26 19:29:17 2009 -0500
@@ -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 @@
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 -r c1ee8282291d -r 899ecfbce5af src/cpu/o3/dyn_inst_impl.hh
--- a/src/cpu/o3/dyn_inst_impl.hh Thu Feb 26 19:29:17 2009 -0500
+++ b/src/cpu/o3/dyn_inst_impl.hh Thu Feb 26 19:29:17 2009 -0500
@@ -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 @@
// 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 -r c1ee8282291d -r 899ecfbce5af src/cpu/simple/base.cc
--- a/src/cpu/simple/base.cc Thu Feb 26 19:29:17 2009 -0500
+++ b/src/cpu/simple/base.cc Thu Feb 26 19:29:17 2009 -0500
@@ -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 @@
comLoadEventQueue[0]->serviceEvents(numLoad);
}
+ if (CPA::available()) {
+ CPA::cpa()->swAutoBegin(tc, thread->readNextPC());
+ }
+
traceFunctions(thread->readPC());
if (traceData) {
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev