From ee967995196739b90c0b1c384d7e245d1dffdc80 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Sun, 29 Feb 2004 20:22:32 -0500 Subject: Initial cleanup pass of lisa's function call tracking code. base/statistics.hh: We're getting rid of FS_MEASURE, but for now, we're going to still use a compile time flag to turn on and off binning of statistics. (The flag is STATS_BINNING) cpu/exec_context.cc: cpu/exec_context.hh: kern/tru64/tru64_system.cc: get rid of FS_MEASURE cpu/simple_cpu/simple_cpu.cc: yank the function call tracking code out of the cpu and move it into the software context class itself. kern/tru64/tru64_system.hh: get rid of FS_MEASURE move all of the tacking stuff to the same place. sim/system.hh: cleanup --HG-- extra : convert_revision : 73d3843afe1b3ba0d5445421c39c1148d3f4e7c0 --- sim/system.hh | 49 +++++++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 28 deletions(-) (limited to 'sim') diff --git a/sim/system.hh b/sim/system.hh index 8348a144e..2e0cb3dbf 100644 --- a/sim/system.hh +++ b/sim/system.hh @@ -32,14 +32,11 @@ #include #include -#include "sim/sim_object.hh" -#include "cpu/pc_event.hh" #include "base/loader/symtab.hh" - -#ifdef FS_MEASURE #include "base/statistics.hh" +#include "cpu/pc_event.hh" +#include "sim/sim_object.hh" #include "sim/sw_context.hh" -#endif class MemoryController; class PhysicalMemory; @@ -50,11 +47,28 @@ class ExecContext; class System : public SimObject { -#ifdef FS_MEASURE + // lisa's binning stuff protected: std::map fnBins; std::map swCtxMap; -#endif //FS_MEASURE + + public: + Statistics::Scalar fnCalls; + Statistics::MainBin *nonPath; + + Statistics::MainBin * getBin(const std::string &name); + virtual bool findCaller(std::string, std::string) const = 0; + + SWContext *findContext(Addr pcb); + bool addContext(Addr pcb, SWContext *ctx) { + return (swCtxMap.insert(make_pair(pcb, ctx))).second; + } + void remContext(Addr pcb) { + swCtxMap.erase(pcb); + return; + } + + virtual void dumpState(ExecContext *xc) const = 0; public: const uint64_t init_param; @@ -69,11 +83,6 @@ class System : public SimObject virtual int registerExecContext(ExecContext *xc); virtual void replaceExecContext(int xcIndex, ExecContext *xc); -#ifdef FS_MEASURE - Statistics::Scalar fnCalls; - Statistics::MainBin *nonPath; -#endif //FS_MEASURE - public: System(const std::string _name, const uint64_t _init_param, MemoryController *, PhysicalMemory *, const bool); @@ -84,22 +93,6 @@ class System : public SimObject virtual Addr getKernelEntry() const = 0; virtual bool breakpoint() = 0; -#ifdef FS_MEASURE - Statistics::MainBin * getBin(const std::string &name); - virtual bool findCaller(std::string, std::string) const = 0; - - SWContext *findContext(Addr pcb); - bool addContext(Addr pcb, SWContext *ctx) { - return (swCtxMap.insert(make_pair(pcb, ctx))).second; - } - void remContext(Addr pcb) { - swCtxMap.erase(pcb); - return; - } - - virtual void dumpState(ExecContext *xc) const = 0; -#endif //FS_MEASURE - public: //////////////////////////////////////////// // -- cgit v1.2.3