stats: Fixing regStats function for some SimObjects
authorDavid Guillen Fandos <david.guillen@arm.com>
Mon, 6 Jun 2016 16:16:43 +0000 (17:16 +0100)
committerDavid Guillen Fandos <david.guillen@arm.com>
Mon, 6 Jun 2016 16:16:43 +0000 (17:16 +0100)
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>
30 files changed:
src/arch/alpha/tlb.cc
src/arch/mips/tlb.cc
src/arch/power/tlb.cc
src/cpu/o3/probe/elastic_trace.cc
src/cpu/pred/bpred_unit.cc
src/cpu/testers/memtest/memtest.cc
src/dev/arm/flash_device.cc
src/dev/arm/hdlcd.cc
src/dev/arm/ufs_device.cc
src/gpu-compute/compute_unit.cc
src/gpu-compute/gpu_tlb.cc
src/gpu-compute/lds_state.cc
src/gpu-compute/lds_state.hh
src/gpu-compute/tlb_coalescer.cc
src/gpu-compute/wavefront.cc
src/mem/probes/stack_dist.cc
src/mem/ruby/network/garnet/BaseGarnetNetwork.cc
src/mem/ruby/network/garnet/fixed-pipeline/Router_d.cc
src/mem/ruby/network/simple/SimpleNetwork.cc
src/mem/ruby/network/simple/Switch.cc
src/mem/ruby/slicc_interface/AbstractController.cc
src/mem/ruby/structures/CacheMemory.cc
src/mem/ruby/structures/Prefetcher.cc
src/mem/ruby/system/GPUCoalescer.cc
src/mem/ruby/system/RubySystem.hh
src/mem/ruby/system/Sequencer.cc
src/mem/snoop_filter.cc
src/sim/clock_domain.cc
src/sim/power/thermal_domain.cc
src/sim/voltage_domain.cc

index 3360b34c563ba17f4d233023b4da1c9b26e58542..fcd2b518b71605a6f6c33f67c7f8319782e18150 100644 (file)
@@ -76,6 +76,8 @@ TLB::~TLB()
 void
 TLB::regStats()
 {
+    BaseTLB::regStats();
+
     fetch_hits
         .name(name() + ".fetch_hits")
         .desc("ITB hits");
index d2aa5ad709fb9900c002ea3cac037dd6cd2c6958..340c830216603cc406ec6c525004600786ce0587 100644 (file)
@@ -226,6 +226,8 @@ TLB::unserialize(CheckpointIn &cp)
 void
 TLB::regStats()
 {
+    BaseTLB::regStats();
+
     read_hits
         .name(name() + ".read_hits")
         .desc("DTB read hits")
index edfb4f453dd4983c5ef94d2c87f1b0a3c00d4ab2..90a341d857a9ce06fb1b93cd360003c898be6982 100644 (file)
@@ -223,6 +223,8 @@ TLB::unserialize(CheckpointIn &cp)
 void
 TLB::regStats()
 {
+    BaseTLB::regStats();
+
     read_hits
         .name(name() + ".read_hits")
         .desc("DTB read hits")
index 3332816cad1238f0fee248d94342ab6e9132210f..bf6b6f0024ac640e4395176eaf5b98fea7869900 100644 (file)
@@ -870,6 +870,8 @@ ElasticTrace::writeDepTrace(uint32_t num_to_write)
 
 void
 ElasticTrace::regStats() {
+    ProbeListenerObject::regStats();
+
     using namespace Stats;
     numRegDep
         .name(name() + ".numRegDep")
index 91e43f50e110ffacd25e787fd697e912fc0f7dc8..523697ff6c68c4f2f7b8f0f6d1197ddfd7941083 100644 (file)
@@ -80,6 +80,8 @@ BPredUnit::BPredUnit(const Params *params)
 void
 BPredUnit::regStats()
 {
+    SimObject::regStats();
+
     lookups
         .name(name() + ".lookups")
         .desc("Number of BP lookups")
index 3e0d67c3223871219b41fede9c441ef96709a110..c2c721bcfbb343abb82dfaec20775673f8896da8 100644 (file)
@@ -197,6 +197,8 @@ MemTest::completeRequest(PacketPtr pkt, bool functional)
 void
 MemTest::regStats()
 {
+    MemObject::regStats();
+
     using namespace Stats;
 
     numReadsStat
index 112a94186a79a0a6511e3f244e9429078e6b748a..63d232e8097234e2503f1234ea23c68b6c1442d2 100644 (file)
@@ -471,6 +471,8 @@ FlashDevice::getUnknownPages(uint32_t index)
 void
 FlashDevice::regStats()
 {
+    AbstractNVM::regStats();
+
     using namespace Stats;
 
     std::string fd_name = name() + ".FlashDevice";
index b04de21bfcb648286a4a73fec5b4b688ea128e3c..0f63f23fc0aae6df3326e79a4b43af6ee37e694b 100644 (file)
@@ -97,6 +97,8 @@ HDLcd::~HDLcd()
 void
 HDLcd::regStats()
 {
+    AmbaDmaDevice::regStats();
+
     using namespace Stats;
 
     stats.underruns
index 07d50903b1987a1a3ede3c96160f41cdb4587659..fe05b3279a72c674edcc8da352262c71775cdad9 100644 (file)
@@ -774,6 +774,8 @@ UFSHostDeviceParams::create()
 void
 UFSHostDevice::regStats()
 {
+    DmaDevice::regStats();
+
     using namespace Stats;
 
     std::string UFSHost_name = name() + ".UFSDiskHost";
index 49029f815f4ac490db1e97f4fc8102fd56efbac2..b3a99b1829ee0146811ac82ac123a11ea3245477 100644 (file)
@@ -1447,6 +1447,8 @@ ComputeUnit::ITLBPort::recvReqRetry()
 void
 ComputeUnit::regStats()
 {
+    MemObject::regStats();
+
     tlbCycles
         .name(name() + ".tlb_cycles")
         .desc("total number of cycles for all uncoalesced requests")
index 7a4f883f6c430c960ad5b3c12416a6f9267220b2..2021af9a92bce813f30c4c01afaf11524f1b6c37 100644 (file)
@@ -958,6 +958,8 @@ namespace X86ISA
     void
     GpuTLB::regStats()
     {
+        MemObject::regStats();
+
         localNumTLBAccesses
             .name(name() + ".local_TLB_accesses")
             .desc("Number of TLB accesses")
index 91ee8009ad841c27d6f77987c2827ae05e11f8f6..d4a27318a9a1726db03998f0e2c321796cd873b6 100644 (file)
@@ -331,11 +331,3 @@ LdsState::TickEvent::process()
 {
     ldsState->process();
 }
-
-/**
- *
- */
-void
-LdsState::regStats()
-{
-}
index 89f08a1d379e29c0312dbcf239d5e763172c5b27..58d109493e706ad84bf842f3777bbf0e4909486c 100644 (file)
@@ -390,9 +390,6 @@ class LdsState: public MemObject
     void
     setParent(ComputeUnit *x_parent);
 
-    void
-    regStats();
-
     // accessors
     ComputeUnit *
     getParent() const
index 835d7b7401071785772620f358ad82b9951f5c24..c9b888d5fd41fe7e297853e0ddff3c64f24ad0e5 100644 (file)
@@ -546,6 +546,8 @@ TLBCoalescer::CleanupEvent::process()
 void
 TLBCoalescer::regStats()
 {
+    MemObject::regStats();
+
     uncoalescedAccesses
         .name(name() + ".uncoalesced_accesses")
         .desc("Number of uncoalesced TLB accesses")
index ed13b22c7da1435b9448d9cfff456c1c95548af0..7cdec53e573f46c17e2d4dff139095cd9ed56a10 100644 (file)
@@ -88,6 +88,8 @@ Wavefront::Wavefront(const Params *p)
 void
 Wavefront::regStats()
 {
+    SimObject::regStats();
+
     srcRegOpDist
         .init(0, 4, 2)
         .name(name() + ".src_reg_operand_dist")
index a447f49e5ed8f8c519849a9b12e9fcfc19607f3b..b12c81e2ce4051eeb84c1f36dede98e05c95d79f 100644 (file)
@@ -57,6 +57,8 @@ StackDistProbe::StackDistProbe(StackDistProbeParams *p)
 void
 StackDistProbe::regStats()
 {
+    BaseMemProbe::regStats();
+
     const StackDistProbeParams *p(
         dynamic_cast<const StackDistProbeParams *>(params()));
     assert(p);
index 1213073e949b48786043a2b244a7821be0fb8bb2..2bd2acb9ff27c3e4c6e8fda80718a48dde7af4a8 100644 (file)
@@ -69,6 +69,8 @@ BaseGarnetNetwork::init()
 void
 BaseGarnetNetwork::regStats()
 {
+    Network::regStats();
+
     m_flits_received
         .init(m_virtual_networks)
         .name(name() + ".flits_received")
index 97bc1abdd3d9e987158383714710fbed3c4f85fe..dab9b7dda4ac569c8255c6e70692b18f068962e0 100644 (file)
@@ -158,6 +158,8 @@ Router_d::update_sw_winner(int inport, flit_d *t_flit)
 void
 Router_d::regStats()
 {
+    BasicRouter::regStats();
+
     m_buffer_reads
         .name(name() + ".buffer_reads")
         .flags(Stats::nozero)
index 25d0b6f4bd16f84162556a8b7a27ff23d5c9245e..2fc7b6440b0c40e2d47d4c54f06434bed7b758be 100644 (file)
@@ -132,6 +132,8 @@ SimpleNetwork::makeInternalLink(SwitchID src, SwitchID dest, BasicLink* link,
 void
 SimpleNetwork::regStats()
 {
+    Network::regStats();
+
     for (MessageSizeType type = MessageSizeType_FIRST;
          type < MessageSizeType_NUM; ++type) {
         m_msg_counts[(unsigned int) type]
index 747884f165024146fa86ca60786ca2aa08304186..78f5b609c5c8a26a7c0cdce609d4b7b556daa150 100644 (file)
@@ -112,6 +112,8 @@ Switch::getThrottle(LinkID link_number) const
 void
 Switch::regStats()
 {
+    BasicRouter::regStats();
+
     for (int link = 0; link < m_throttles.size(); link++) {
         m_throttles[link]->regStats(name());
     }
index 5d8b6eeea19df7830098982367f534cdc49a84a4..b4576f87e649d5a3c977019f21fe96ebd54d641e 100644 (file)
@@ -76,6 +76,8 @@ AbstractController::resetStats()
 void
 AbstractController::regStats()
 {
+    MemObject::regStats();
+
     m_fully_busy_cycles
         .name(name() + ".fully_busy_cycles")
         .desc("cycles for which number of transistions == max transitions")
index f7c1961195886ed68d1ae91e7ddf479ef242a404..36d109769914ebaaf2b0c6b6eec6cfa1e922393f 100644 (file)
@@ -488,6 +488,8 @@ CacheMemory::isLocked(Addr address, int context)
 void
 CacheMemory::regStats()
 {
+    SimObject::regStats();
+
     m_demand_hits
         .name(name() + ".demand_hits")
         .desc("Number of cache demand hits")
index ce6d36c048f26295c4f7fae5fbda8114a80f6811..eef51dcf7dbd73af75524c15014323a2edca58f5 100644 (file)
@@ -86,6 +86,8 @@ Prefetcher::~Prefetcher()
 void
 Prefetcher::regStats()
 {
+    SimObject::regStats();
+
     numMissObserved
         .name(name() + ".miss_observed")
         .desc("number of misses observed")
index 69f79187ac6bc7fad4131ddb368c87d6ffb96b27..1c57f6c4d8c8d0ca5d70daf82b9438bc0ce684f0 100644 (file)
@@ -1284,6 +1284,8 @@ GPUCoalescer::recordMissLatency(GPUCoalescerRequest* srequest,
 void
 GPUCoalescer::regStats()
 {
+    RubyPort::regStats();
+
     // These statistical variables are not for display.
     // The profiler will collate these across different
     // coalescers and display those collated statistics.
index 62330e19da8fb8848337ba5b2cb6d4b919a93386..8ebd3494ab63fe731e7844ca811e6e7fd17bbaf7 100644 (file)
@@ -89,7 +89,10 @@ class RubySystem : public ClockedObject
         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 resetStats() override;
 
index f1f6ddadbc2a51a79319f052c3d7d4b2609080a6..cf3edb904e98aa338b73a557a9283859bf9ad02a 100644 (file)
@@ -721,6 +721,8 @@ Sequencer::evictionCallback(Addr address)
 void
 Sequencer::regStats()
 {
+    RubyPort::regStats();
+
     m_store_waiting_on_load
         .name(name() + ".store_waiting_on_load")
         .desc("Number of times a store aliased with a pending load")
index 9d02ed249023d4ffb7c2fd8e2316ac835e9e0424..9e8f8afb87dab5484ec4c419ac54aa510d4a0c99 100755 (executable)
@@ -351,6 +351,8 @@ SnoopFilter::updateResponse(const Packet* cpkt, const SlavePort& slave_port)
 void
 SnoopFilter::regStats()
 {
+    SimObject::regStats();
+
     totRequests
         .name(name() + ".tot_requests")
         .desc("Total number of requests made to the snoop filter.");
index 1ccee7f1da5f774615e92f4b81c9c749131334e6..9865c4d116df110d2d650c3d026b6e7f10d079f0 100644 (file)
@@ -56,6 +56,8 @@
 void
 ClockDomain::regStats()
 {
+    SimObject::regStats();
+
     using namespace Stats;
 
     // Expose the current clock period as a stat for observability in
index 4b840670d85e20424ca6ccded46bc3aace43556c..208c5bab455d3590e2534e7682625a2e443f92f5 100644 (file)
@@ -72,6 +72,8 @@ ThermalDomain::setSubSystem(SubSystem * ss)
 void
 ThermalDomain::regStats()
 {
+    SimObject::regStats();
+
     currentTemp
         .method(this, &ThermalDomain::currentTemperature)
         .name(params()->name + ".temp")
index b82efda33012d3d01854ef624364de639c0ae011..61715dfbcc9f4297e6a6a27c31b6ad4e4a1d98f7 100644 (file)
@@ -128,6 +128,8 @@ VoltageDomain::startup() {
 void
 VoltageDomain::regStats()
 {
+    SimObject::regStats();
+
     currentVoltage
         .method(this, &VoltageDomain::voltage)
         .name(params()->name + ".voltage")