summaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2004-02-29 20:22:32 -0500
committerNathan Binkert <binkertn@umich.edu>2004-02-29 20:22:32 -0500
commitee967995196739b90c0b1c384d7e245d1dffdc80 (patch)
tree28b9302b5d221b0a079d6a8d7909ed62618b6b12 /sim
parent31f82cef41962fb57d343f4a8cd468c87d8204dc (diff)
downloadgem5-ee967995196739b90c0b1c384d7e245d1dffdc80.tar.xz
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
Diffstat (limited to 'sim')
-rw-r--r--sim/system.hh49
1 files changed, 21 insertions, 28 deletions
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 <string>
#include <vector>
-#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<const std::string, Statistics::MainBin *> fnBins;
std::map<const Addr, SWContext *> swCtxMap;
-#endif //FS_MEASURE
+
+ public:
+ Statistics::Scalar<Counter> 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<Counter, Statistics::MainBin> 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:
////////////////////////////////////////////
//