diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2013-02-10 21:26:22 -0600 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2013-02-10 21:26:22 -0600 |
commit | bc1daae7fd528ca72ba14d669a0d00243f553be5 (patch) | |
tree | fbf754546eb68c2944feda809d664e687c5dbb08 /src/mem/ruby/profiler | |
parent | a49b1df3f0d1e1c9ce46675d9fce7787d98caca7 (diff) | |
download | gem5-bc1daae7fd528ca72ba14d669a0d00243f553be5.tar.xz |
ruby: modifies histogram add() function
This patch modifies the Histogram class' add() function so that it can add
linear histograms as well. The function assumes that the left end point of
the ranges of the two histograms are the same. It also assumes that when
the ranges of the two histogram are changed to accomodate an element not in
the range, the factor used in changing the range is same for both the
histograms.
This function is then used in removing one of the calls to the global
profiler*. The histograms for recording the delays incurred in processing
different requests are now maintained by the controllers. The profiler
adds these histograms when it needs to print the stats.
Diffstat (limited to 'src/mem/ruby/profiler')
-rw-r--r-- | src/mem/ruby/profiler/Profiler.cc | 62 | ||||
-rw-r--r-- | src/mem/ruby/profiler/Profiler.hh | 7 |
2 files changed, 34 insertions, 35 deletions
diff --git a/src/mem/ruby/profiler/Profiler.cc b/src/mem/ruby/profiler/Profiler.cc index 546934d52..165561fe8 100644 --- a/src/mem/ruby/profiler/Profiler.cc +++ b/src/mem/ruby/profiler/Profiler.cc @@ -224,6 +224,38 @@ Profiler::printRequestProfile(ostream &out) } void +Profiler::printDelayProfile(ostream &out) +{ + out << "Message Delayed Cycles" << endl; + out << "----------------------" << endl; + + uint32_t numVNets = Network::getNumberOfVirtualNetworks(); + Histogram delayHistogram; + std::vector<Histogram> delayVCHistogram(numVNets); + + for (uint32_t i = 0; i < MachineType_NUM; i++) { + for (map<uint32_t, AbstractController*>::iterator it = + g_abs_controls[i].begin(); + it != g_abs_controls[i].end(); ++it) { + + AbstractController *ctr = (*it).second; + delayHistogram.add(ctr->getDelayHist()); + + for (uint32_t i = 0; i < numVNets; i++) { + delayVCHistogram[i].add(ctr->getDelayVCHist(i)); + } + } + } + + out << "Total_delay_cycles: " << delayHistogram << endl; + + for (int i = 0; i < numVNets; i++) { + out << " virtual_network_" << i << "_delay_cycles: " + << delayVCHistogram[i] << endl; + } +} + +void Profiler::printStats(ostream& out, bool short_stats) { out << endl; @@ -435,16 +467,7 @@ Profiler::printStats(ostream& out, bool short_stats) } out << endl; - out << "Message Delayed Cycles" << endl; - out << "----------------------" << endl; - out << "Total_delay_cycles: " << m_delayedCyclesHistogram << endl; - out << "Total_nonPF_delay_cycles: " - << m_delayedCyclesNonPFHistogram << endl; - for (int i = 0; i < m_delayedCyclesVCHistograms.size(); i++) { - out << " virtual_network_" << i << "_delay_cycles: " - << m_delayedCyclesVCHistograms[i] << endl; - } - + printDelayProfile(out); printResourceUsage(out); } } @@ -488,14 +511,6 @@ Profiler::clearStats() m_busyBankCount = 0; - m_delayedCyclesHistogram.clear(); - m_delayedCyclesNonPFHistogram.clear(); - int size = Network::getNumberOfVirtualNetworks(); - m_delayedCyclesVCHistograms.resize(size); - for (int i = 0; i < size; i++) { - m_delayedCyclesVCHistograms[i].clear(); - } - m_missLatencyHistograms.resize(RubyRequestType_NUM); for (int i = 0; i < m_missLatencyHistograms.size(); i++) { m_missLatencyHistograms[i].clear(200); @@ -594,17 +609,6 @@ Profiler::profileSharing(const Address& addr, AccessType type, } void -Profiler::profileMsgDelay(uint32_t virtualNetwork, Time delayCycles) -{ - assert(virtualNetwork < m_delayedCyclesVCHistograms.size()); - m_delayedCyclesHistogram.add(delayCycles); - m_delayedCyclesVCHistograms[virtualNetwork].add(delayCycles); - if (virtualNetwork != 0) { - m_delayedCyclesNonPFHistogram.add(delayCycles); - } -} - -void Profiler::profilePFWait(Time waitTime) { m_prefetchWaitHistogram.add(waitTime); diff --git a/src/mem/ruby/profiler/Profiler.hh b/src/mem/ruby/profiler/Profiler.hh index 5b370de54..ecd57c035 100644 --- a/src/mem/ruby/profiler/Profiler.hh +++ b/src/mem/ruby/profiler/Profiler.hh @@ -152,8 +152,6 @@ class Profiler : public SimObject void sequencerRequests(int num) { m_sequencer_requests.add(num); } - void profileMsgDelay(uint32_t virtualNetwork, Time delayCycles); - void print(std::ostream& out) const; void rubyWatch(int proc); @@ -172,6 +170,7 @@ class Profiler : public SimObject private: void printRequestProfile(std::ostream &out); + void printDelayProfile(std::ostream &out); private: // Private copy constructor and assignment operator @@ -226,10 +225,6 @@ class Profiler : public SimObject std::vector<Histogram> m_SWPrefetchLatencyHistograms; std::vector<Histogram> m_SWPrefetchMachLatencyHistograms; - Histogram m_delayedCyclesHistogram; - Histogram m_delayedCyclesNonPFHistogram; - std::vector<Histogram> m_delayedCyclesVCHistograms; - Histogram m_outstanding_requests; Histogram m_outstanding_persistent_requests; |