stats: rename StatEvent() function to schedStatEvent().
This follows the style rules and is more descriptive.
This commit is contained in:
parent
94807214c4
commit
c22be9f2f0
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
import internal
|
import internal
|
||||||
|
|
||||||
from internal.stats import StatEvent as event
|
from internal.stats import schedStatEvent as schedEvent
|
||||||
from objects import Root
|
from objects import Root
|
||||||
|
|
||||||
def initText(filename, desc=True):
|
def initText(filename, desc=True):
|
||||||
|
|
|
@ -50,7 +50,8 @@ void initMySQL(std::string host, std::string database, std::string user,
|
||||||
std::string passwd, std::string project, std::string name,
|
std::string passwd, std::string project, std::string name,
|
||||||
std::string sample);
|
std::string sample);
|
||||||
|
|
||||||
void StatEvent(bool dump, bool reset, Tick when = curTick, Tick repeat = 0);
|
void schedStatEvent(bool dump, bool reset,
|
||||||
|
Tick when = curTick, Tick repeat = 0);
|
||||||
|
|
||||||
void enable();
|
void enable();
|
||||||
void prepare();
|
void prepare();
|
||||||
|
|
|
@ -236,7 +236,7 @@ resetstats(ThreadContext *tc, Tick delay, Tick period)
|
||||||
Tick when = curTick + delay * SimClock::Int::ns;
|
Tick when = curTick + delay * SimClock::Int::ns;
|
||||||
Tick repeat = period * SimClock::Int::ns;
|
Tick repeat = period * SimClock::Int::ns;
|
||||||
|
|
||||||
Stats::StatEvent(false, true, when, repeat);
|
Stats::schedStatEvent(false, true, when, repeat);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -249,7 +249,7 @@ dumpstats(ThreadContext *tc, Tick delay, Tick period)
|
||||||
Tick when = curTick + delay * SimClock::Int::ns;
|
Tick when = curTick + delay * SimClock::Int::ns;
|
||||||
Tick repeat = period * SimClock::Int::ns;
|
Tick repeat = period * SimClock::Int::ns;
|
||||||
|
|
||||||
Stats::StatEvent(true, false, when, repeat);
|
Stats::schedStatEvent(true, false, when, repeat);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -262,7 +262,7 @@ dumpresetstats(ThreadContext *tc, Tick delay, Tick period)
|
||||||
Tick when = curTick + delay * SimClock::Int::ns;
|
Tick when = curTick + delay * SimClock::Int::ns;
|
||||||
Tick repeat = period * SimClock::Int::ns;
|
Tick repeat = period * SimClock::Int::ns;
|
||||||
|
|
||||||
Stats::StatEvent(true, true, when, repeat);
|
Stats::schedStatEvent(true, true, when, repeat);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -93,7 +93,7 @@ simulate(Tick num_cycles)
|
||||||
if (async_event) {
|
if (async_event) {
|
||||||
async_event = false;
|
async_event = false;
|
||||||
if (async_statdump || async_statreset) {
|
if (async_statdump || async_statreset) {
|
||||||
Stats::StatEvent(async_statdump, async_statreset);
|
Stats::schedStatEvent(async_statdump, async_statreset);
|
||||||
async_statdump = false;
|
async_statdump = false;
|
||||||
async_statreset = false;
|
async_statreset = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "sim/eventq.hh"
|
#include "sim/eventq.hh"
|
||||||
|
#include "sim/stat_control.hh"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
@ -164,7 +165,7 @@ initSimStats()
|
||||||
static Global global;
|
static Global global;
|
||||||
}
|
}
|
||||||
|
|
||||||
class _StatEvent : public Event
|
class StatEvent : public Event
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
bool dump;
|
bool dump;
|
||||||
|
@ -172,7 +173,7 @@ class _StatEvent : public Event
|
||||||
Tick repeat;
|
Tick repeat;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
_StatEvent(bool _dump, bool _reset, Tick _repeat)
|
StatEvent(bool _dump, bool _reset, Tick _repeat)
|
||||||
: Event(Stat_Event_Pri), dump(_dump), reset(_reset), repeat(_repeat)
|
: Event(Stat_Event_Pri), dump(_dump), reset(_reset), repeat(_repeat)
|
||||||
{
|
{
|
||||||
setFlags(AutoDelete);
|
setFlags(AutoDelete);
|
||||||
|
@ -188,16 +189,15 @@ class _StatEvent : public Event
|
||||||
Stats::reset();
|
Stats::reset();
|
||||||
|
|
||||||
if (repeat) {
|
if (repeat) {
|
||||||
Event *event = new _StatEvent(dump, reset, repeat);
|
Stats::schedStatEvent(dump, reset, curTick + repeat, repeat);
|
||||||
mainEventQueue.schedule(event, curTick + repeat);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
StatEvent(bool dump, bool reset, Tick when, Tick repeat)
|
schedStatEvent(bool dump, bool reset, Tick when, Tick repeat)
|
||||||
{
|
{
|
||||||
Event *event = new _StatEvent(dump, reset, repeat);
|
Event *event = new StatEvent(dump, reset, repeat);
|
||||||
mainEventQueue.schedule(event, when);
|
mainEventQueue.schedule(event, when);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,8 @@
|
||||||
namespace Stats {
|
namespace Stats {
|
||||||
|
|
||||||
void initSimStats();
|
void initSimStats();
|
||||||
void StatEvent(bool dump, bool reset, Tick when = curTick, Tick repeat = 0);
|
void schedStatEvent(bool dump, bool reset, Tick when = curTick,
|
||||||
|
Tick repeat = 0);
|
||||||
|
|
||||||
} // namespace Stats
|
} // namespace Stats
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue