From f42b13afc158794bc7ddc3e0376c264dc15235a3 Mon Sep 17 00:00:00 2001 From: Lisa Hsu Date: Tue, 18 May 2004 13:53:11 -0400 Subject: [PATCH] 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 --- kern/linux/linux_system.cc | 108 +++++-------------------------------- kern/linux/linux_system.hh | 23 ++------ kern/tru64/tru64_system.cc | 6 +-- 3 files changed, 20 insertions(+), 117 deletions(-) diff --git a/kern/linux/linux_system.cc b/kern/linux/linux_system.cc index 0e0f141b6..a0000fe33 100644 --- a/kern/linux/linux_system.cc +++ b/kern/linux/linux_system.cc @@ -45,17 +45,16 @@ extern SymbolTable *debugSymbolTable; -//un-comment this to see the state of call stack when it changes. -//#define SW_DEBUG - using namespace std; LinuxSystem::LinuxSystem(const string _name, const uint64_t _init_param, MemoryController *_memCtrl, PhysicalMemory *_physmem, const string &kernel_path, const string &console_path, const string &palcode, const string &boot_osflags, - const string &bootloader_path, const bool _bin) - : System(_name, _init_param, _memCtrl, _physmem, _bin), bin(_bin) + const string &bootloader_path, const bool _bin, + const vector &_binned_fns) + : System(_name, _init_param, _memCtrl, _physmem, _bin, _binned_fns), + bin(_bin), binned_fns(_binned_fns) { kernelSymtab = 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"); #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, "ide_delay_50ms"); @@ -137,13 +129,6 @@ LinuxSystem::LinuxSystem(const string _name, const uint64_t _init_param, 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; if (kernelSymtab->findAddress("est_cycle_freq", addr)) { @@ -197,17 +182,6 @@ LinuxSystem::LinuxSystem(const string _name, const uint64_t _init_param, consolePanicEvent->schedule(addr); #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)) 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)) 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() @@ -243,14 +203,9 @@ LinuxSystem::~LinuxSystem() delete kernelPanicEvent; delete consolePanicEvent; - delete badaddrEvent; - delete skipPowerStateEvent; - delete skipScavengeBootEvent; - delete printfEvent; - /*delete debugPrintfEvent; - delete debugPrintfrEvent; - delete dumpMbufEvent; -*/ + delete skipIdeDelay50msEvent; + delete skipDelayLoopEvent; + delete skipCacheProbeEvent; } void @@ -309,48 +264,6 @@ LinuxSystem::breakpoint() return remoteGDB[0]->trap(ALPHA_KENTRY_IF); } -void -LinuxSystem::populateMap(std::string callee, std::string caller) -{ - multimap::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_iterator iter; - pair 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 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) Param bin; @@ -363,6 +276,7 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(LinuxSystem) Param pal_code; Param boot_osflags; Param bootloader_code; + VectorParam binned_fns; 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_DFLT(boot_osflags, "flags to pass to the kernel during boot", "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) @@ -387,7 +302,8 @@ CREATE_SIM_OBJECT(LinuxSystem) { LinuxSystem *sys = new LinuxSystem(getInstanceName(), init_param, mem_ctl, physmem, kernel_code, console_code, - pal_code, boot_osflags, bootloader_code, bin); + pal_code, boot_osflags, bootloader_code, + bin, binned_fns); return sys; } diff --git a/kern/linux/linux_system.hh b/kern/linux/linux_system.hh index 93f765ba1..3b65e7379 100644 --- a/kern/linux/linux_system.hh +++ b/kern/linux/linux_system.hh @@ -64,16 +64,9 @@ class LinuxSystem : public System BreakPCEvent *kernelPanicEvent; BreakPCEvent *consolePanicEvent; - LinuxBadAddrEvent *badaddrEvent; - LinuxSkipFuncEvent *skipPowerStateEvent; - LinuxSkipFuncEvent *skipScavengeBootEvent; LinuxSkipFuncEvent *skipCacheProbeEvent; LinuxSkipIdeDelay50msEvent *skipIdeDelay50msEvent; LinuxSkipDelayLoopEvent *skipDelayLoopEvent; - LinuxPrintfEvent *printfEvent; - LinuxDebugPrintfEvent *debugPrintfEvent; - LinuxDebugPrintfEvent *debugPrintfrEvent; - LinuxDumpMbufEvent *dumpMbufEvent; private: @@ -81,9 +74,7 @@ class LinuxSystem : public System Addr kernelEnd; Addr kernelEntry; bool bin; - - std::multimap callerMap; - void populateMap(std::string caller, std::string callee); + std::vector binned_fns; public: std::vector remoteGDB; @@ -98,8 +89,10 @@ class LinuxSystem : public System const std::string &console_path, const std::string &palcode, const std::string &boot_osflags, - const std::string &bootloader_path, - const bool _bin); + const std::string &bootloader_path, + const bool _bin, + const std::vector &_binned_fns); + ~LinuxSystem(); void setDelayLoop(ExecContext *xc); @@ -111,12 +104,6 @@ class LinuxSystem : public System Addr getKernelEnd() const { return kernelEnd; } Addr getKernelEntry() const { return kernelEntry; } 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__ diff --git a/kern/tru64/tru64_system.cc b/kern/tru64/tru64_system.cc index ebd78c58b..31f9c9878 100644 --- a/kern/tru64/tru64_system.cc +++ b/kern/tru64/tru64_system.cc @@ -48,9 +48,9 @@ Tru64System::Tru64System(const string _name, const uint64_t _init_param, MemoryController *_memCtrl, PhysicalMemory *_physmem, const string &kernel_path, const string &console_path, const string &palcode, const string &boot_osflags, - const bool _bin, const vector &binned_fns) - : System(_name, _init_param, _memCtrl, _physmem, _bin, binned_fns), - bin(_bin), binned_fns(binned_fns) + const bool _bin, const vector &_binned_fns) + : System(_name, _init_param, _memCtrl, _physmem, _bin,_binned_fns), + bin(_bin), binned_fns(_binned_fns) { kernelSymtab = new SymbolTable; consoleSymtab = new SymbolTable; -- 2.30.2