42 #include "debug/Context.hh"
46 using namespace Stats;
51 const char *
modestr[] = {
"kernel",
"user",
"idle" };
55 idleProcess((
Addr)-1), themode(
kernel), lastModeTick(0)
67 .
desc(
"number of callpals executed")
79 .
desc(
"number of hwrei instructions executed")
85 .
desc(
"number of protection mode switches")
101 .
desc(
"fraction of useful protection mode switches")
113 .
desc(
"number of ticks spent at the given mode")
121 .
desc(
"number of times the context was actually changed")
142 DPRINTF(Context,
"old mode=%s new mode=%s pid=%d\n",
172 DPRINTF(Context,
"Context Switch old pid=%d new pid=%d\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)
void regStats(const std::string &name)
const FlagsType nonan
Don't print if this is NAN.
virtual MiscReg readMiscRegNoEffect(int misc_reg) const =0
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)
const std::string name() const
#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.
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.