summaryrefslogtreecommitdiff
path: root/kern/tru64
diff options
context:
space:
mode:
authorLisa Hsu <hsul@eecs.umich.edu>2004-05-17 15:08:24 -0400
committerLisa Hsu <hsul@eecs.umich.edu>2004-05-17 15:08:24 -0400
commitb8082eb508f15f09eb7416a67b6d3a1886b4fa34 (patch)
treedc921c20d907c8ea16d473f4abf95cf34f5446ff /kern/tru64
parent73501ea38f3c3e53fc02561444e25989c29224af (diff)
downloadgem5-b8082eb508f15f09eb7416a67b6d3a1886b4fa34.tar.xz
lift system-independent binning stuff out of Tru64System into System.
kern/tru64/tru64_system.cc: make binned_fns a parameter for System in addition to Tru64System. Do all the fnEvents setting at the System level, since that is system-independent. kern/tru64/tru64_system.hh: deal with FnEvents in the System, and move some fns over to System. sim/system.cc: sim/system.hh: lift binning stuff into System out of Tru64System --HG-- extra : convert_revision : 591dee6f2013f5c43037726c529a00682b5cf82e
Diffstat (limited to 'kern/tru64')
-rw-r--r--kern/tru64/tru64_system.cc68
-rw-r--r--kern/tru64/tru64_system.hh13
2 files changed, 1 insertions, 80 deletions
diff --git a/kern/tru64/tru64_system.cc b/kern/tru64/tru64_system.cc
index 7e68dc5a1..0717bcbbe 100644
--- a/kern/tru64/tru64_system.cc
+++ b/kern/tru64/tru64_system.cc
@@ -49,7 +49,7 @@ Tru64System::Tru64System(const string _name, const uint64_t _init_param,
const string &kernel_path, const string &console_path,
const string &palcode, const string &boot_osflags,
const bool _bin, const vector<string> &binned_fns)
- : System(_name, _init_param, _memCtrl, _physmem, _bin),
+ : System(_name, _init_param, _memCtrl, _physmem, _bin, binned_fns),
bin(_bin), binned_fns(binned_fns)
{
kernelSymtab = new SymbolTable;
@@ -163,33 +163,14 @@ Tru64System::Tru64System(const string _name, const uint64_t _init_param,
// BINNING STUFF
if (bin == true) {
int end = binned_fns.size();
- assert(!(end & 1));
-
- Statistics::MainBin *Bin;
Addr address = 0;
- fnEvents.resize(end>>1);
-
for (int i = 0; i < end; i +=2) {
- Bin = new Statistics::MainBin(binned_fns[i]);
- fnBins.insert(make_pair(binned_fns[i], Bin));
-
- fnEvents[(i>>1)] = new FnEvent(&pcEventQueue, binned_fns[i], this);
if (kernelSymtab->findAddress(binned_fns[i], address))
fnEvents[(i>>1)]->schedule(address);
else
panic("could not find kernel symbol %s\n", binned_fns[i]);
-
- if (binned_fns[i+1] == "null")
- populateMap(binned_fns[i], "");
- else
- populateMap(binned_fns[i], binned_fns[i+1]);
}
-
- fnCalls
- .name(name() + ":fnCalls")
- .desc("all fn calls being tracked")
- ;
}
//
}
@@ -213,14 +194,6 @@ Tru64System::~Tru64System()
delete debugPrintfEvent;
delete debugPrintfrEvent;
delete dumpMbufEvent;
-
- if (bin == true) {
- int end = fnEvents.size();
- for (int i = 0; i < end; ++i) {
- delete fnEvents[i];
- }
- fnEvents.clear();
- }
}
int
@@ -261,45 +234,6 @@ Tru64System::breakpoint()
return remoteGDB[0]->trap(ALPHA_KENTRY_INT);
}
-void
-Tru64System::populateMap(std::string callee, std::string caller)
-{
- multimap<const string, string>::const_iterator i;
- i = callerMap.insert(make_pair(callee, caller));
- assert(i != callerMap.end() && "should not fail populating callerMap");
-}
-
-bool
-Tru64System::findCaller(std::string callee, std::string caller) const
-{
- typedef multimap<const std::string, std::string>::const_iterator iter;
- pair<iter, iter> range;
-
- range = callerMap.equal_range(callee);
- for (iter i = range.first; i != range.second; ++i) {
- if ((*i).second == caller)
- return true;
- }
- return false;
-}
-
-void
-Tru64System::dumpState(ExecContext *xc) const
-{
- if (xc->swCtx) {
- stack<fnCall *> copy(xc->swCtx->callStack);
- if (copy.empty())
- return;
- DPRINTF(TCPIP, "xc->swCtx, size: %d:\n", copy.size());
- fnCall *top;
- DPRINTF(TCPIP, "|| call : %d\n",xc->swCtx->calls);
- for (top = copy.top(); !copy.empty(); copy.pop() ) {
- top = copy.top();
- DPRINTF(TCPIP, "|| %13s : %s \n", top->name, top->myBin->name());
- }
- }
-}
-
BEGIN_DECLARE_SIM_OBJECT_PARAMS(Tru64System)
Param<bool> bin;
diff --git a/kern/tru64/tru64_system.hh b/kern/tru64/tru64_system.hh
index 34569664d..144febbf9 100644
--- a/kern/tru64/tru64_system.hh
+++ b/kern/tru64/tru64_system.hh
@@ -67,8 +67,6 @@ class Tru64System : public System
DebugPrintfEvent *debugPrintfrEvent;
DumpMbufEvent *dumpMbufEvent;
- std::vector<FnEvent *> fnEvents;
-
private:
Addr kernelStart;
@@ -104,17 +102,6 @@ class Tru64System : public System
static void Printf(AlphaArguments args);
static void DumpMbuf(AlphaArguments args);
-
-
- // Lisa's binning stuff
- private:
- std::multimap<const std::string, std::string> callerMap;
- void populateMap(std::string caller, std::string callee);
-
- public:
- bool findCaller(std::string callee, std::string caller) const;
- void dumpState(ExecContext *xc) const;
- //
};
#endif // __TRU64_SYSTEM_HH__