diff options
Diffstat (limited to 'src/kern')
-rw-r--r-- | src/kern/kernel_stats.cc | 18 | ||||
-rw-r--r-- | src/kern/kernel_stats.hh | 80 | ||||
-rw-r--r-- | src/kern/system_events.cc | 32 | ||||
-rw-r--r-- | src/kern/system_events.hh | 32 |
4 files changed, 4 insertions, 158 deletions
diff --git a/src/kern/kernel_stats.cc b/src/kern/kernel_stats.cc index 2ba120b6f..f7868b50f 100644 --- a/src/kern/kernel_stats.cc +++ b/src/kern/kernel_stats.cc @@ -45,13 +45,12 @@ using namespace Stats; namespace Kernel { -const char *modestr[] = { "kernel", "user", "idle", "interrupt" }; +const char *modestr[] = { "kernel", "user", "idle" }; Statistics::Statistics(System *system) : idleProcess((Addr)-1), themode(kernel), lastModeTick(0), iplLast(0), iplLastTick(0) { - bin_int = system->params()->bin_int; } void @@ -186,7 +185,7 @@ Statistics::regStats(const string &_name) void Statistics::setIdleProcess(Addr idlepcbb, ThreadContext *tc) { - assert(themode == kernel || themode == interrupt); + assert(themode == kernel); idleProcess = idlepcbb; themode = idle; changeMode(themode, tc); @@ -206,8 +205,6 @@ Statistics::changeMode(cpu_mode newmode, ThreadContext *tc) _modeGood[newmode]++; _modeTicks[themode] += curTick - lastModeTick; - tc->getSystemPtr()->kernelBinning->changeMode(newmode); - lastModeTick = curTick; themode = newmode; } @@ -233,13 +230,9 @@ Statistics::mode(cpu_mode newmode, ThreadContext *tc) { Addr pcbb = tc->readMiscReg(AlphaISA::IPR_PALtemp23); - if ((newmode == kernel || newmode == interrupt) && - pcbb == idleProcess) + if (newmode == kernel && pcbb == idleProcess) newmode = idle; - if (bin_int == false && newmode == interrupt) - newmode = kernel; - changeMode(newmode, tc); } @@ -268,11 +261,6 @@ Statistics::callpal(int code, ThreadContext *tc) _syscall[cvtnum]++; } } break; - - case PAL::swpctx: - if (tc->getSystemPtr()->kernelBinning) - tc->getSystemPtr()->kernelBinning->palSwapContext(tc); - break; } } diff --git a/src/kern/kernel_stats.hh b/src/kern/kernel_stats.hh index 781b6f6da..c691ad8cf 100644 --- a/src/kern/kernel_stats.hh +++ b/src/kern/kernel_stats.hh @@ -47,95 +47,17 @@ class System; namespace Kernel { -enum cpu_mode { kernel, user, idle, interrupt, cpu_mode_num }; +enum cpu_mode { kernel, user, idle, cpu_mode_num }; extern const char *modestr[]; -class Binning -{ - private: - std::string myname; - System *system; - - private: - // lisa's binning stuff - struct fnCall - { - Stats::MainBin *myBin; - std::string name; - }; - - struct SWContext - { - Counter calls; - std::stack<fnCall *> callStack; - }; - - std::map<const std::string, Stats::MainBin *> fnBins; - std::map<const Addr, SWContext *> swCtxMap; - - std::multimap<const std::string, std::string> callerMap; - void populateMap(std::string caller, std::string callee); - - std::vector<FnEvent *> fnEvents; - - Stats::Scalar<> fnCalls; - - Stats::MainBin *getBin(const std::string &name); - bool findCaller(std::string, std::string) const; - - SWContext *findContext(Addr pcb); - bool addContext(Addr pcb, SWContext *ctx) - { - return (swCtxMap.insert(std::make_pair(pcb, ctx))).second; - } - - void remContext(Addr pcb) - { - swCtxMap.erase(pcb); - } - - void dumpState() const; - - SWContext *swctx; - std::vector<std::string> binned_fns; - - private: - Stats::MainBin *modeBin[cpu_mode_num]; - - public: - const bool bin; - const bool fnbin; - - cpu_mode themode; - void palSwapContext(ThreadContext *tc); - void execute(ThreadContext *tc, StaticInstPtr inst); - void call(ThreadContext *tc, Stats::MainBin *myBin); - void changeMode(cpu_mode mode); - - public: - Binning(System *sys); - virtual ~Binning(); - - const std::string name() const { return myname; } - void regStats(const std::string &name); - - public: - virtual void serialize(std::ostream &os); - virtual void unserialize(Checkpoint *cp, const std::string §ion); -}; - class Statistics : public Serializable { private: - friend class Binning; - - private: std::string myname; Addr idleProcess; cpu_mode themode; Tick lastModeTick; - bool bin_int; void changeMode(cpu_mode newmode, ThreadContext *tc); diff --git a/src/kern/system_events.cc b/src/kern/system_events.cc index fe3805ce2..177ce96d1 100644 --- a/src/kern/system_events.cc +++ b/src/kern/system_events.cc @@ -55,22 +55,6 @@ SkipFuncEvent::process(ThreadContext *tc) */ } - -FnEvent::FnEvent(PCEventQueue *q, const std::string &desc, Addr addr, - Stats::MainBin *bin) - : PCEvent(q, desc, addr), _name(desc), mybin(bin) -{ -} - -void -FnEvent::process(ThreadContext *tc) -{ - if (tc->misspeculating()) - return; - - tc->getSystemPtr()->kernelBinning->call(tc, mybin); -} - void IdleStartEvent::process(ThreadContext *tc) { @@ -79,19 +63,3 @@ IdleStartEvent::process(ThreadContext *tc) tc->readMiscReg(AlphaISA::IPR_PALtemp23), tc); remove(); } - -void -InterruptStartEvent::process(ThreadContext *tc) -{ - if (tc->getKernelStats()) - tc->getKernelStats()->mode(Kernel::interrupt, tc); -} - -void -InterruptEndEvent::process(ThreadContext *tc) -{ - // We go back to kernel, if we are user, inside the rti - // pal code we will get switched to user because of the ICM write - if (tc->getKernelStats()) - tc->getKernelStats()->mode(Kernel::kernel, tc); -} diff --git a/src/kern/system_events.hh b/src/kern/system_events.hh index 05c878577..ccd6bd9a4 100644 --- a/src/kern/system_events.hh +++ b/src/kern/system_events.hh @@ -45,19 +45,6 @@ class SkipFuncEvent : public PCEvent virtual void process(ThreadContext *tc); }; -class FnEvent : public PCEvent -{ - public: - FnEvent(PCEventQueue *q, const std::string &desc, Addr addr, - Stats::MainBin *bin); - virtual void process(ThreadContext *tc); - std::string myname() const { return _name; } - - private: - std::string _name; - Stats::MainBin *mybin; -}; - class IdleStartEvent : public PCEvent { public: @@ -67,23 +54,4 @@ class IdleStartEvent : public PCEvent virtual void process(ThreadContext *tc); }; -class InterruptStartEvent : public PCEvent -{ - public: - InterruptStartEvent(PCEventQueue *q, const std::string &desc, Addr addr) - : PCEvent(q, desc, addr) - {} - virtual void process(ThreadContext *tc); -}; - -class InterruptEndEvent : public PCEvent -{ - public: - InterruptEndEvent(PCEventQueue *q, const std::string &desc, Addr addr) - : PCEvent(q, desc, addr) - {} - virtual void process(ThreadContext *tc); -}; - - #endif // __SYSTEM_EVENTS_HH__ |