stats: Fixing regStats function for some SimObjects

Fixing an issue with regStats not calling the parent class method
for most SimObjects in Gem5. This causes issues if one adds new
stats in the base class (since they are never initialized properly!).

Change-Id: Iebc5aa66f58816ef4295dc8e48a357558d76a77c
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
This commit is contained in:
David Guillen Fandos 2016-06-06 17:16:43 +01:00
parent 589033c94c
commit 70798b1ba0
30 changed files with 58 additions and 12 deletions

View file

@ -76,6 +76,8 @@ TLB::~TLB()
void void
TLB::regStats() TLB::regStats()
{ {
BaseTLB::regStats();
fetch_hits fetch_hits
.name(name() + ".fetch_hits") .name(name() + ".fetch_hits")
.desc("ITB hits"); .desc("ITB hits");

View file

@ -226,6 +226,8 @@ TLB::unserialize(CheckpointIn &cp)
void void
TLB::regStats() TLB::regStats()
{ {
BaseTLB::regStats();
read_hits read_hits
.name(name() + ".read_hits") .name(name() + ".read_hits")
.desc("DTB read hits") .desc("DTB read hits")

View file

@ -223,6 +223,8 @@ TLB::unserialize(CheckpointIn &cp)
void void
TLB::regStats() TLB::regStats()
{ {
BaseTLB::regStats();
read_hits read_hits
.name(name() + ".read_hits") .name(name() + ".read_hits")
.desc("DTB read hits") .desc("DTB read hits")

View file

@ -870,6 +870,8 @@ ElasticTrace::writeDepTrace(uint32_t num_to_write)
void void
ElasticTrace::regStats() { ElasticTrace::regStats() {
ProbeListenerObject::regStats();
using namespace Stats; using namespace Stats;
numRegDep numRegDep
.name(name() + ".numRegDep") .name(name() + ".numRegDep")

View file

@ -80,6 +80,8 @@ BPredUnit::BPredUnit(const Params *params)
void void
BPredUnit::regStats() BPredUnit::regStats()
{ {
SimObject::regStats();
lookups lookups
.name(name() + ".lookups") .name(name() + ".lookups")
.desc("Number of BP lookups") .desc("Number of BP lookups")

View file

@ -197,6 +197,8 @@ MemTest::completeRequest(PacketPtr pkt, bool functional)
void void
MemTest::regStats() MemTest::regStats()
{ {
MemObject::regStats();
using namespace Stats; using namespace Stats;
numReadsStat numReadsStat

View file

@ -471,6 +471,8 @@ FlashDevice::getUnknownPages(uint32_t index)
void void
FlashDevice::regStats() FlashDevice::regStats()
{ {
AbstractNVM::regStats();
using namespace Stats; using namespace Stats;
std::string fd_name = name() + ".FlashDevice"; std::string fd_name = name() + ".FlashDevice";

View file

@ -97,6 +97,8 @@ HDLcd::~HDLcd()
void void
HDLcd::regStats() HDLcd::regStats()
{ {
AmbaDmaDevice::regStats();
using namespace Stats; using namespace Stats;
stats.underruns stats.underruns

View file

@ -774,6 +774,8 @@ UFSHostDeviceParams::create()
void void
UFSHostDevice::regStats() UFSHostDevice::regStats()
{ {
DmaDevice::regStats();
using namespace Stats; using namespace Stats;
std::string UFSHost_name = name() + ".UFSDiskHost"; std::string UFSHost_name = name() + ".UFSDiskHost";

View file

@ -1447,6 +1447,8 @@ ComputeUnit::ITLBPort::recvReqRetry()
void void
ComputeUnit::regStats() ComputeUnit::regStats()
{ {
MemObject::regStats();
tlbCycles tlbCycles
.name(name() + ".tlb_cycles") .name(name() + ".tlb_cycles")
.desc("total number of cycles for all uncoalesced requests") .desc("total number of cycles for all uncoalesced requests")

View file

@ -958,6 +958,8 @@ namespace X86ISA
void void
GpuTLB::regStats() GpuTLB::regStats()
{ {
MemObject::regStats();
localNumTLBAccesses localNumTLBAccesses
.name(name() + ".local_TLB_accesses") .name(name() + ".local_TLB_accesses")
.desc("Number of TLB accesses") .desc("Number of TLB accesses")

View file

@ -331,11 +331,3 @@ LdsState::TickEvent::process()
{ {
ldsState->process(); ldsState->process();
} }
/**
*
*/
void
LdsState::regStats()
{
}

View file

@ -390,9 +390,6 @@ class LdsState: public MemObject
void void
setParent(ComputeUnit *x_parent); setParent(ComputeUnit *x_parent);
void
regStats();
// accessors // accessors
ComputeUnit * ComputeUnit *
getParent() const getParent() const

View file

@ -546,6 +546,8 @@ TLBCoalescer::CleanupEvent::process()
void void
TLBCoalescer::regStats() TLBCoalescer::regStats()
{ {
MemObject::regStats();
uncoalescedAccesses uncoalescedAccesses
.name(name() + ".uncoalesced_accesses") .name(name() + ".uncoalesced_accesses")
.desc("Number of uncoalesced TLB accesses") .desc("Number of uncoalesced TLB accesses")

View file

@ -88,6 +88,8 @@ Wavefront::Wavefront(const Params *p)
void void
Wavefront::regStats() Wavefront::regStats()
{ {
SimObject::regStats();
srcRegOpDist srcRegOpDist
.init(0, 4, 2) .init(0, 4, 2)
.name(name() + ".src_reg_operand_dist") .name(name() + ".src_reg_operand_dist")

View file

@ -57,6 +57,8 @@ StackDistProbe::StackDistProbe(StackDistProbeParams *p)
void void
StackDistProbe::regStats() StackDistProbe::regStats()
{ {
BaseMemProbe::regStats();
const StackDistProbeParams *p( const StackDistProbeParams *p(
dynamic_cast<const StackDistProbeParams *>(params())); dynamic_cast<const StackDistProbeParams *>(params()));
assert(p); assert(p);

View file

@ -69,6 +69,8 @@ BaseGarnetNetwork::init()
void void
BaseGarnetNetwork::regStats() BaseGarnetNetwork::regStats()
{ {
Network::regStats();
m_flits_received m_flits_received
.init(m_virtual_networks) .init(m_virtual_networks)
.name(name() + ".flits_received") .name(name() + ".flits_received")

View file

@ -158,6 +158,8 @@ Router_d::update_sw_winner(int inport, flit_d *t_flit)
void void
Router_d::regStats() Router_d::regStats()
{ {
BasicRouter::regStats();
m_buffer_reads m_buffer_reads
.name(name() + ".buffer_reads") .name(name() + ".buffer_reads")
.flags(Stats::nozero) .flags(Stats::nozero)

View file

@ -132,6 +132,8 @@ SimpleNetwork::makeInternalLink(SwitchID src, SwitchID dest, BasicLink* link,
void void
SimpleNetwork::regStats() SimpleNetwork::regStats()
{ {
Network::regStats();
for (MessageSizeType type = MessageSizeType_FIRST; for (MessageSizeType type = MessageSizeType_FIRST;
type < MessageSizeType_NUM; ++type) { type < MessageSizeType_NUM; ++type) {
m_msg_counts[(unsigned int) type] m_msg_counts[(unsigned int) type]

View file

@ -112,6 +112,8 @@ Switch::getThrottle(LinkID link_number) const
void void
Switch::regStats() Switch::regStats()
{ {
BasicRouter::regStats();
for (int link = 0; link < m_throttles.size(); link++) { for (int link = 0; link < m_throttles.size(); link++) {
m_throttles[link]->regStats(name()); m_throttles[link]->regStats(name());
} }

View file

@ -76,6 +76,8 @@ AbstractController::resetStats()
void void
AbstractController::regStats() AbstractController::regStats()
{ {
MemObject::regStats();
m_fully_busy_cycles m_fully_busy_cycles
.name(name() + ".fully_busy_cycles") .name(name() + ".fully_busy_cycles")
.desc("cycles for which number of transistions == max transitions") .desc("cycles for which number of transistions == max transitions")

View file

@ -488,6 +488,8 @@ CacheMemory::isLocked(Addr address, int context)
void void
CacheMemory::regStats() CacheMemory::regStats()
{ {
SimObject::regStats();
m_demand_hits m_demand_hits
.name(name() + ".demand_hits") .name(name() + ".demand_hits")
.desc("Number of cache demand hits") .desc("Number of cache demand hits")

View file

@ -86,6 +86,8 @@ Prefetcher::~Prefetcher()
void void
Prefetcher::regStats() Prefetcher::regStats()
{ {
SimObject::regStats();
numMissObserved numMissObserved
.name(name() + ".miss_observed") .name(name() + ".miss_observed")
.desc("number of misses observed") .desc("number of misses observed")

View file

@ -1284,6 +1284,8 @@ GPUCoalescer::recordMissLatency(GPUCoalescerRequest* srequest,
void void
GPUCoalescer::regStats() GPUCoalescer::regStats()
{ {
RubyPort::regStats();
// These statistical variables are not for display. // These statistical variables are not for display.
// The profiler will collate these across different // The profiler will collate these across different
// coalescers and display those collated statistics. // coalescers and display those collated statistics.

View file

@ -89,7 +89,10 @@ class RubySystem : public ClockedObject
return m_profiler; return m_profiler;
} }
void regStats() override { m_profiler->regStats(name()); } void regStats() override {
ClockedObject::regStats();
m_profiler->regStats(name());
}
void collateStats() { m_profiler->collateStats(); } void collateStats() { m_profiler->collateStats(); }
void resetStats() override; void resetStats() override;

View file

@ -721,6 +721,8 @@ Sequencer::evictionCallback(Addr address)
void void
Sequencer::regStats() Sequencer::regStats()
{ {
RubyPort::regStats();
m_store_waiting_on_load m_store_waiting_on_load
.name(name() + ".store_waiting_on_load") .name(name() + ".store_waiting_on_load")
.desc("Number of times a store aliased with a pending load") .desc("Number of times a store aliased with a pending load")

View file

@ -351,6 +351,8 @@ SnoopFilter::updateResponse(const Packet* cpkt, const SlavePort& slave_port)
void void
SnoopFilter::regStats() SnoopFilter::regStats()
{ {
SimObject::regStats();
totRequests totRequests
.name(name() + ".tot_requests") .name(name() + ".tot_requests")
.desc("Total number of requests made to the snoop filter."); .desc("Total number of requests made to the snoop filter.");

View file

@ -56,6 +56,8 @@
void void
ClockDomain::regStats() ClockDomain::regStats()
{ {
SimObject::regStats();
using namespace Stats; using namespace Stats;
// Expose the current clock period as a stat for observability in // Expose the current clock period as a stat for observability in

View file

@ -72,6 +72,8 @@ ThermalDomain::setSubSystem(SubSystem * ss)
void void
ThermalDomain::regStats() ThermalDomain::regStats()
{ {
SimObject::regStats();
currentTemp currentTemp
.method(this, &ThermalDomain::currentTemperature) .method(this, &ThermalDomain::currentTemperature)
.name(params()->name + ".temp") .name(params()->name + ".temp")

View file

@ -128,6 +128,8 @@ VoltageDomain::startup() {
void void
VoltageDomain::regStats() VoltageDomain::regStats()
{ {
SimObject::regStats();
currentVoltage currentVoltage
.method(this, &VoltageDomain::voltage) .method(this, &VoltageDomain::voltage)
.name(params()->name + ".voltage") .name(params()->name + ".voltage")