From 7af93dbdf6c86a915b99da1688f51dc12e7aafff Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Sat, 10 Jun 2006 13:08:43 -0400 Subject: Remove all binning stuff --HG-- extra : convert_revision : 6da2b3b0b6c2824f2064d42670fd8383edb7c718 --- kern/kernel_stats.cc | 18 ++---------- kern/kernel_stats.hh | 80 +-------------------------------------------------- kern/system_events.cc | 32 --------------------- kern/system_events.hh | 32 --------------------- 4 files changed, 4 insertions(+), 158 deletions(-) (limited to 'kern') diff --git a/kern/kernel_stats.cc b/kern/kernel_stats.cc index b85d88145..6bb166535 100644 --- a/kern/kernel_stats.cc +++ b/kern/kernel_stats.cc @@ -42,13 +42,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 @@ -183,7 +182,7 @@ Statistics::regStats(const string &_name) void Statistics::setIdleProcess(Addr idlepcbb, ExecContext *xc) { - assert(themode == kernel || themode == interrupt); + assert(themode == kernel); idleProcess = idlepcbb; themode = idle; changeMode(themode, xc); @@ -203,8 +202,6 @@ Statistics::changeMode(cpu_mode newmode, ExecContext *xc) _modeGood[newmode]++; _modeTicks[themode] += curTick - lastModeTick; - xc->getSystemPtr()->kernelBinning->changeMode(newmode); - lastModeTick = curTick; themode = newmode; } @@ -230,13 +227,9 @@ Statistics::mode(cpu_mode newmode, ExecContext *xc) { Addr pcbb = xc->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, xc); } @@ -265,11 +258,6 @@ Statistics::callpal(int code, ExecContext *xc) _syscall[cvtnum]++; } } break; - - case PAL::swpctx: - if (xc->getSystemPtr()->kernelBinning) - xc->getSystemPtr()->kernelBinning->palSwapContext(xc); - break; } } diff --git a/kern/kernel_stats.hh b/kern/kernel_stats.hh index 16ec721d0..f63b5e38b 100644 --- a/kern/kernel_stats.hh +++ b/kern/kernel_stats.hh @@ -44,95 +44,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 callStack; - }; - - std::map fnBins; - std::map swCtxMap; - - std::multimap callerMap; - void populateMap(std::string caller, std::string callee); - - std::vector 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 binned_fns; - - private: - Stats::MainBin *modeBin[cpu_mode_num]; - - public: - const bool bin; - const bool fnbin; - - cpu_mode themode; - void palSwapContext(ExecContext *xc); - void execute(ExecContext *xc, StaticInstPtr inst); - void call(ExecContext *xc, 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, ExecContext *xc); diff --git a/kern/system_events.cc b/kern/system_events.cc index 221eb228d..b76627dbf 100644 --- a/kern/system_events.cc +++ b/kern/system_events.cc @@ -48,22 +48,6 @@ SkipFuncEvent::process(ExecContext *xc) } } - -FnEvent::FnEvent(PCEventQueue *q, const std::string &desc, Addr addr, - Stats::MainBin *bin) - : PCEvent(q, desc, addr), _name(desc), mybin(bin) -{ -} - -void -FnEvent::process(ExecContext *xc) -{ - if (xc->misspeculating()) - return; - - xc->getSystemPtr()->kernelBinning->call(xc, mybin); -} - void IdleStartEvent::process(ExecContext *xc) { @@ -72,19 +56,3 @@ IdleStartEvent::process(ExecContext *xc) xc->readMiscReg(AlphaISA::IPR_PALtemp23), xc); remove(); } - -void -InterruptStartEvent::process(ExecContext *xc) -{ - if (xc->getKernelStats()) - xc->getKernelStats()->mode(Kernel::interrupt, xc); -} - -void -InterruptEndEvent::process(ExecContext *xc) -{ - // 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 (xc->getKernelStats()) - xc->getKernelStats()->mode(Kernel::kernel, xc); -} diff --git a/kern/system_events.hh b/kern/system_events.hh index 246140a09..c836cf4a7 100644 --- a/kern/system_events.hh +++ b/kern/system_events.hh @@ -42,19 +42,6 @@ class SkipFuncEvent : public PCEvent virtual void process(ExecContext *xc); }; -class FnEvent : public PCEvent -{ - public: - FnEvent(PCEventQueue *q, const std::string &desc, Addr addr, - Stats::MainBin *bin); - virtual void process(ExecContext *xc); - std::string myname() const { return _name; } - - private: - std::string _name; - Stats::MainBin *mybin; -}; - class IdleStartEvent : public PCEvent { public: @@ -64,23 +51,4 @@ class IdleStartEvent : public PCEvent virtual void process(ExecContext *xc); }; -class InterruptStartEvent : public PCEvent -{ - public: - InterruptStartEvent(PCEventQueue *q, const std::string &desc, Addr addr) - : PCEvent(q, desc, addr) - {} - virtual void process(ExecContext *xc); -}; - -class InterruptEndEvent : public PCEvent -{ - public: - InterruptEndEvent(PCEventQueue *q, const std::string &desc, Addr addr) - : PCEvent(q, desc, addr) - {} - virtual void process(ExecContext *xc); -}; - - #endif // __SYSTEM_EVENTS_HH__ -- cgit v1.2.3