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/slicc_interface/AbstractController.cc | |
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/slicc_interface/AbstractController.cc')
-rw-r--r-- | src/mem/ruby/slicc_interface/AbstractController.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mem/ruby/slicc_interface/AbstractController.cc b/src/mem/ruby/slicc_interface/AbstractController.cc index adf411f82..bcd09796a 100644 --- a/src/mem/ruby/slicc_interface/AbstractController.cc +++ b/src/mem/ruby/slicc_interface/AbstractController.cc @@ -52,6 +52,14 @@ AbstractController::clearStats() { m_requestProfileMap.clear(); m_request_count = 0; + + m_delayHistogram.clear(); + + uint32_t size = Network::getNumberOfVirtualNetworks(); + m_delayVCHistogram.resize(size); + for (uint32_t i = 0; i < size; i++) { + m_delayVCHistogram[i].clear(); + } } void @@ -63,3 +71,11 @@ AbstractController::profileRequest(const std::string &request) // default value which is 0 m_requestProfileMap[request]++; } + +void +AbstractController::profileMsgDelay(uint32_t virtualNetwork, Time delay) +{ + assert(virtualNetwork < m_delayVCHistogram.size()); + m_delayHistogram.add(delay); + m_delayVCHistogram[virtualNetwork].add(delay); +} |