O3: Add support of function tracing with O3 CPU.
authorAli Saidi <Ali.Saidi@ARM.com>
Tue, 10 Jan 2012 00:08:20 +0000 (18:08 -0600)
committerAli Saidi <Ali.Saidi@ARM.com>
Tue, 10 Jan 2012 00:08:20 +0000 (18:08 -0600)
src/cpu/base.hh
src/cpu/o3/commit_impl.hh

index ce02889f31a6164c967442cfa6f363866a4dca51..638556deb96e3794320f1bcfcee992ebeee0092d 100644 (file)
@@ -291,17 +291,16 @@ class BaseCPU : public MemObject
     void enableFunctionTrace();
     void traceFunctionsInternal(Addr pc);
 
-  protected:
+  private:
+    static std::vector<BaseCPU *> cpuList;   //!< Static global cpu list
+
+  public:
     void traceFunctions(Addr pc)
     {
         if (functionTracingEnabled)
             traceFunctionsInternal(pc);
     }
 
-  private:
-    static std::vector<BaseCPU *> cpuList;   //!< Static global cpu list
-
-  public:
     static int numSimulatedCPUs() { return cpuList.size(); }
     static Counter numSimulatedInstructions()
     {
index 75ae87c7545f8311c431350dcb73b7432a4e4a51..9ff31a6229433303de6d0445255d2054d2b31d8a 100644 (file)
@@ -52,6 +52,7 @@
 #include "config/use_checker.hh"
 #include "cpu/o3/commit.hh"
 #include "cpu/o3/thread_state.hh"
+#include "cpu/base.hh"
 #include "cpu/exetrace.hh"
 #include "cpu/timebuf.hh"
 #include "debug/Activity.hh"
@@ -992,6 +993,8 @@ DefaultCommit<Impl>::commitInsts()
                 // Updates misc. registers.
                 head_inst->updateMiscRegs();
 
+                cpu->traceFunctions(pc[tid].instAddr());
+
                 TheISA::advancePC(pc[tid], head_inst->staticInst);
 
                 // Keep track of the last sequence number commited