lift FnEvents and and Binning stuff out of LinuxSystem into commonn places with Tru64.

kern/linux/linux_system.cc:
    add binned_fns parameter to System, remove nonLinux events from LinuxSystem, fix ~LinuxSystem() by adding delete of some things that need to be deleted.
kern/linux/linux_system.hh:
    fix header file to go with linux_system.cc, removing nonLinux events and adding binned_fns param.
kern/tru64/tru64_system.cc:
    add somme consistency by having having binned_fns be _binned_fns in the Tru64System arg list.

--HG--
extra : convert_revision : b2ec0c1614e185aafa177c220b91d1f6a4fe6876
This commit is contained in:
Lisa Hsu 2004-05-18 13:53:11 -04:00
parent a0ccdf8aba
commit f42b13afc1
3 changed files with 20 additions and 117 deletions

View file

@ -45,17 +45,16 @@
extern SymbolTable *debugSymbolTable; extern SymbolTable *debugSymbolTable;
//un-comment this to see the state of call stack when it changes.
//#define SW_DEBUG
using namespace std; using namespace std;
LinuxSystem::LinuxSystem(const string _name, const uint64_t _init_param, LinuxSystem::LinuxSystem(const string _name, const uint64_t _init_param,
MemoryController *_memCtrl, PhysicalMemory *_physmem, MemoryController *_memCtrl, PhysicalMemory *_physmem,
const string &kernel_path, const string &console_path, const string &kernel_path, const string &console_path,
const string &palcode, const string &boot_osflags, const string &palcode, const string &boot_osflags,
const string &bootloader_path, const bool _bin) const string &bootloader_path, const bool _bin,
: System(_name, _init_param, _memCtrl, _physmem, _bin), bin(_bin) const vector<string> &_binned_fns)
: System(_name, _init_param, _memCtrl, _physmem, _bin, _binned_fns),
bin(_bin), binned_fns(_binned_fns)
{ {
kernelSymtab = new SymbolTable; kernelSymtab = new SymbolTable;
consoleSymtab = new SymbolTable; consoleSymtab = new SymbolTable;
@ -122,13 +121,6 @@ LinuxSystem::LinuxSystem(const string _name, const uint64_t _init_param,
consolePanicEvent = new BreakPCEvent(&pcEventQueue, "console panic"); consolePanicEvent = new BreakPCEvent(&pcEventQueue, "console panic");
#endif #endif
badaddrEvent = new LinuxBadAddrEvent(&pcEventQueue, "badaddr");
skipPowerStateEvent = new LinuxSkipFuncEvent(&pcEventQueue,
"tl_v48_capture_power_state");
skipScavengeBootEvent = new LinuxSkipFuncEvent(&pcEventQueue,
"pmap_scavenge_boot");
printfEvent = new LinuxPrintfEvent(&pcEventQueue, "printf");
skipIdeDelay50msEvent = new LinuxSkipIdeDelay50msEvent(&pcEventQueue, skipIdeDelay50msEvent = new LinuxSkipIdeDelay50msEvent(&pcEventQueue,
"ide_delay_50ms"); "ide_delay_50ms");
@ -137,13 +129,6 @@ LinuxSystem::LinuxSystem(const string _name, const uint64_t _init_param,
skipCacheProbeEvent = new LinuxSkipFuncEvent(&pcEventQueue, "determine_cpu_caches"); skipCacheProbeEvent = new LinuxSkipFuncEvent(&pcEventQueue, "determine_cpu_caches");
/* debugPrintfEvent = new DebugPrintfEvent(&pcEventQueue,
"debug_printf", false);
debugPrintfrEvent = new DebugPrintfEvent(&pcEventQueue,
"debug_printfr", true);
dumpMbufEvent = new DumpMbufEvent(&pcEventQueue, "dump_mbuf");
*/
Addr addr = 0; Addr addr = 0;
if (kernelSymtab->findAddress("est_cycle_freq", addr)) { if (kernelSymtab->findAddress("est_cycle_freq", addr)) {
@ -197,17 +182,6 @@ LinuxSystem::LinuxSystem(const string _name, const uint64_t _init_param,
consolePanicEvent->schedule(addr); consolePanicEvent->schedule(addr);
#endif #endif
if (kernelSymtab->findAddress("badaddr", addr))
badaddrEvent->schedule(addr);
// else
//panic("could not find kernel symbol \'badaddr\'");
if (kernelSymtab->findAddress("tl_v48_capture_power_state", addr))
skipPowerStateEvent->schedule(addr);
if (kernelSymtab->findAddress("pmap_scavenge_boot", addr))
skipScavengeBootEvent->schedule(addr);
if (kernelSymtab->findAddress("ide_delay_50ms", addr)) if (kernelSymtab->findAddress("ide_delay_50ms", addr))
skipIdeDelay50msEvent->schedule(addr+8); skipIdeDelay50msEvent->schedule(addr+8);
@ -216,20 +190,6 @@ LinuxSystem::LinuxSystem(const string _name, const uint64_t _init_param,
if (kernelSymtab->findAddress("determine_cpu_caches", addr)) if (kernelSymtab->findAddress("determine_cpu_caches", addr))
skipCacheProbeEvent->schedule(addr+8); skipCacheProbeEvent->schedule(addr+8);
#if TRACING_ON
if (kernelSymtab->findAddress("printk", addr))
printfEvent->schedule(addr);
if (kernelSymtab->findAddress("m5printf", addr))
debugPrintfEvent->schedule(addr);
if (kernelSymtab->findAddress("m5printfr", addr))
debugPrintfrEvent->schedule(addr);
if (kernelSymtab->findAddress("m5_dump_mbuf", addr))
dumpMbufEvent->schedule(addr);
#endif
} }
LinuxSystem::~LinuxSystem() LinuxSystem::~LinuxSystem()
@ -243,14 +203,9 @@ LinuxSystem::~LinuxSystem()
delete kernelPanicEvent; delete kernelPanicEvent;
delete consolePanicEvent; delete consolePanicEvent;
delete badaddrEvent; delete skipIdeDelay50msEvent;
delete skipPowerStateEvent; delete skipDelayLoopEvent;
delete skipScavengeBootEvent; delete skipCacheProbeEvent;
delete printfEvent;
/*delete debugPrintfEvent;
delete debugPrintfrEvent;
delete dumpMbufEvent;
*/
} }
void void
@ -309,48 +264,6 @@ LinuxSystem::breakpoint()
return remoteGDB[0]->trap(ALPHA_KENTRY_IF); return remoteGDB[0]->trap(ALPHA_KENTRY_IF);
} }
void
LinuxSystem::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
LinuxSystem::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
LinuxSystem::dumpState(ExecContext *xc) const
{
#ifndef SW_DEBUG
return;
#endif
if (xc->swCtx) {
stack<fnCall *> copy(xc->swCtx->callStack);
if (copy.empty())
return;
cprintf("xc->swCtx:\n");
fnCall *top;
cprintf("|| call: %d\n",xc->swCtx->calls);
for (top = copy.top(); !copy.empty(); copy.pop() ) {
top = copy.top();
cprintf("|| %13s : %s \n", top->name, top->myBin->name());
}
}
}
BEGIN_DECLARE_SIM_OBJECT_PARAMS(LinuxSystem) BEGIN_DECLARE_SIM_OBJECT_PARAMS(LinuxSystem)
Param<bool> bin; Param<bool> bin;
@ -363,6 +276,7 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(LinuxSystem)
Param<string> pal_code; Param<string> pal_code;
Param<string> boot_osflags; Param<string> boot_osflags;
Param<string> bootloader_code; Param<string> bootloader_code;
VectorParam<string> binned_fns;
END_DECLARE_SIM_OBJECT_PARAMS(LinuxSystem) END_DECLARE_SIM_OBJECT_PARAMS(LinuxSystem)
@ -378,7 +292,8 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(LinuxSystem)
INIT_PARAM(pal_code, "file that contains palcode"), INIT_PARAM(pal_code, "file that contains palcode"),
INIT_PARAM_DFLT(boot_osflags, "flags to pass to the kernel during boot", INIT_PARAM_DFLT(boot_osflags, "flags to pass to the kernel during boot",
"a"), "a"),
INIT_PARAM(bootloader_code, "file that contains the bootloader") INIT_PARAM(bootloader_code, "file that contains the bootloader"),
INIT_PARAM(binned_fns, "functions to be broken down and binned")
END_INIT_SIM_OBJECT_PARAMS(LinuxSystem) END_INIT_SIM_OBJECT_PARAMS(LinuxSystem)
@ -387,7 +302,8 @@ CREATE_SIM_OBJECT(LinuxSystem)
{ {
LinuxSystem *sys = new LinuxSystem(getInstanceName(), init_param, mem_ctl, LinuxSystem *sys = new LinuxSystem(getInstanceName(), init_param, mem_ctl,
physmem, kernel_code, console_code, physmem, kernel_code, console_code,
pal_code, boot_osflags, bootloader_code, bin); pal_code, boot_osflags, bootloader_code,
bin, binned_fns);
return sys; return sys;
} }

View file

@ -64,16 +64,9 @@ class LinuxSystem : public System
BreakPCEvent *kernelPanicEvent; BreakPCEvent *kernelPanicEvent;
BreakPCEvent *consolePanicEvent; BreakPCEvent *consolePanicEvent;
LinuxBadAddrEvent *badaddrEvent;
LinuxSkipFuncEvent *skipPowerStateEvent;
LinuxSkipFuncEvent *skipScavengeBootEvent;
LinuxSkipFuncEvent *skipCacheProbeEvent; LinuxSkipFuncEvent *skipCacheProbeEvent;
LinuxSkipIdeDelay50msEvent *skipIdeDelay50msEvent; LinuxSkipIdeDelay50msEvent *skipIdeDelay50msEvent;
LinuxSkipDelayLoopEvent *skipDelayLoopEvent; LinuxSkipDelayLoopEvent *skipDelayLoopEvent;
LinuxPrintfEvent *printfEvent;
LinuxDebugPrintfEvent *debugPrintfEvent;
LinuxDebugPrintfEvent *debugPrintfrEvent;
LinuxDumpMbufEvent *dumpMbufEvent;
private: private:
@ -81,9 +74,7 @@ class LinuxSystem : public System
Addr kernelEnd; Addr kernelEnd;
Addr kernelEntry; Addr kernelEntry;
bool bin; bool bin;
std::vector<string> binned_fns;
std::multimap<const std::string, std::string> callerMap;
void populateMap(std::string caller, std::string callee);
public: public:
std::vector<RemoteGDB *> remoteGDB; std::vector<RemoteGDB *> remoteGDB;
@ -98,8 +89,10 @@ class LinuxSystem : public System
const std::string &console_path, const std::string &console_path,
const std::string &palcode, const std::string &palcode,
const std::string &boot_osflags, const std::string &boot_osflags,
const std::string &bootloader_path, const std::string &bootloader_path,
const bool _bin); const bool _bin,
const std::vector<std::string> &_binned_fns);
~LinuxSystem(); ~LinuxSystem();
void setDelayLoop(ExecContext *xc); void setDelayLoop(ExecContext *xc);
@ -111,12 +104,6 @@ class LinuxSystem : public System
Addr getKernelEnd() const { return kernelEnd; } Addr getKernelEnd() const { return kernelEnd; }
Addr getKernelEntry() const { return kernelEntry; } Addr getKernelEntry() const { return kernelEntry; }
bool breakpoint(); bool breakpoint();
static void Printf(AlphaArguments args);
static void DumpMbuf(AlphaArguments args);
bool findCaller(std::string callee, std::string caller) const;
void dumpState(ExecContext *xc) const;
}; };
#endif // __LINUX_SYSTEM_HH__ #endif // __LINUX_SYSTEM_HH__

View file

@ -48,9 +48,9 @@ Tru64System::Tru64System(const string _name, const uint64_t _init_param,
MemoryController *_memCtrl, PhysicalMemory *_physmem, MemoryController *_memCtrl, PhysicalMemory *_physmem,
const string &kernel_path, const string &console_path, const string &kernel_path, const string &console_path,
const string &palcode, const string &boot_osflags, const string &palcode, const string &boot_osflags,
const bool _bin, const vector<string> &binned_fns) const bool _bin, const vector<string> &_binned_fns)
: System(_name, _init_param, _memCtrl, _physmem, _bin, binned_fns), : System(_name, _init_param, _memCtrl, _physmem, _bin,_binned_fns),
bin(_bin), binned_fns(binned_fns) bin(_bin), binned_fns(_binned_fns)
{ {
kernelSymtab = new SymbolTable; kernelSymtab = new SymbolTable;
consoleSymtab = new SymbolTable; consoleSymtab = new SymbolTable;