42 #include "debug/Context.hh" 46 using namespace Stats;
51 const char *
modestr[] = {
"kernel",
"user",
"idle" };
53 Statistics::Statistics()
55 idleProcess((
Addr)-1), themode(
kernel), lastModeTick(0),
56 iplLast(0), iplLastTick(0)
68 .
desc(
"number of callpals executed")
80 .
desc(
"number of hwrei instructions executed")
86 .
desc(
"number of protection mode switches")
102 .
desc(
"fraction of useful protection mode switches")
114 .
desc(
"number of ticks spent at the given mode")
122 .
desc(
"number of times the context was actually changed")
128 .
desc(
"number of times we switched to this ipl")
135 .
desc(
"number of times we switched to this ipl from a different ipl")
142 .
desc(
"number of cycles we spent at this ipl")
148 .
desc(
"fraction of swpipl calls that actually changed the ipl")
172 DPRINTF(Context,
"old mode=%s new mode=%s pid=%d\n",
173 modestr[
themode], modestr[newmode],
202 DPRINTF(Context,
"Context Switch old pid=%d new pid=%d\n",
219 assert(ipl >= 0 && ipl <= 0x1f &&
"invalid IPL\n");
const FlagsType pdf
Print the percent of the total that this entry represents.
Derived & subname(off_type index, const std::string &name)
Set the subfield name for the given index, and marks this stat to print at the end of simulation...
void mode(cpu_mode newmode, ThreadContext *tc)
const FlagsType nonan
Don't print if this is NAN.
void regStats(const std::string &name) override
Overload hash function for BasicBlockRange type.
Derived & flags(Flags _flags)
Set the flags and marks this stat to print at the end of simulation.
ThreadContext is the external interface to all thread state for anything outside of the CPU...
Derived & init(size_type size)
Set this vector to have the given size.
void changeMode(cpu_mode newmode, ThreadContext *tc)
void context(Addr oldpcbb, Addr newpcbb, ThreadContext *tc)
#define UNSERIALIZE_SCALAR(scalar)
Tick curTick()
The current simulated tick.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Stats::Formula _modeFraction
void callpal(int code, ThreadContext *tc)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Stats::Scalar _swap_context
static const char * name(int index)
const FlagsType total
Print the total.
#define SERIALIZE_SCALAR(scalar)
Derived & name(const std::string &name)
Set the name and marks this stat to print at the end of simulation.
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
const std::string name() const
void setIdleProcess(Addr idle, ThreadContext *tc)
std::ostream CheckpointOut
Derived & desc(const std::string &_desc)
Set the description and marks this stat to print at the end of simulation.
const FlagsType nozero
Don't print if this is zero.
void serialize(CheckpointOut &cp) const override
Serialize an object.