summaryrefslogtreecommitdiff
path: root/src/kern
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2006-06-11 22:01:34 -0400
committerNathan Binkert <binkertn@umich.edu>2006-06-11 22:01:34 -0400
commit3c95f5958fd1a90cf83d85e1b24fb700c07bae91 (patch)
treeff0fba54297f66dd8e5ef7cbb46d09d8698ee08b /src/kern
parent4ab8e881edecd47ae3f2ba5fda345f7ff9788870 (diff)
parent7af93dbdf6c86a915b99da1688f51dc12e7aafff (diff)
downloadgem5-3c95f5958fd1a90cf83d85e1b24fb700c07bae91.tar.xz
Merge iceaxe.:/Volumes/work/research/m5/head
into iceaxe.:/Volumes/work/research/m5/merge src/cpu/simple/base.cc: src/kern/kernel_stats.cc: src/kern/kernel_stats.hh: src/kern/system_events.cc: src/kern/system_events.hh: src/python/m5/objects/System.py: src/sim/system.cc: src/sim/system.hh: hand merge --HG-- rename : build/SConstruct => SConstruct rename : SConscript => src/SConscript rename : arch/alpha/freebsd/system.cc => src/arch/alpha/freebsd/system.cc rename : arch/alpha/linux/system.cc => src/arch/alpha/linux/system.cc rename : arch/alpha/linux/system.hh => src/arch/alpha/linux/system.hh rename : arch/alpha/system.cc => src/arch/alpha/system.cc rename : arch/alpha/tru64/system.cc => src/arch/alpha/tru64/system.cc rename : base/statistics.cc => src/base/statistics.cc rename : base/statistics.hh => src/base/statistics.hh rename : base/stats/mysql.cc => src/base/stats/mysql.cc rename : base/stats/mysql.hh => src/base/stats/mysql.hh rename : base/stats/statdb.cc => src/base/stats/statdb.cc rename : base/stats/statdb.hh => src/base/stats/statdb.hh rename : base/stats/text.cc => src/base/stats/text.cc rename : base/stats/text.hh => src/base/stats/text.hh rename : cpu/simple/cpu.cc => src/cpu/simple/base.cc rename : kern/kernel_stats.cc => src/kern/kernel_stats.cc rename : kern/kernel_stats.hh => src/kern/kernel_stats.hh rename : kern/system_events.cc => src/kern/system_events.cc rename : kern/system_events.hh => src/kern/system_events.hh rename : python/m5/objects/System.py => src/python/m5/objects/System.py rename : sim/system.cc => src/sim/system.cc rename : sim/system.hh => src/sim/system.hh rename : test/stattest.cc => src/unittest/stattest.cc extra : convert_revision : 4bb576a2bf5e32784efc48030bd776c6c7c29a7c
Diffstat (limited to 'src/kern')
-rw-r--r--src/kern/kernel_stats.cc18
-rw-r--r--src/kern/kernel_stats.hh80
-rw-r--r--src/kern/system_events.cc32
-rw-r--r--src/kern/system_events.hh32
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 &section);
-};
-
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__