summaryrefslogtreecommitdiff
path: root/src/mem/ruby/profiler/Profiler.cc
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2015-10-14 00:29:43 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2015-10-14 00:29:43 -0500
commit4453537eadb177bd7fd8c50e68e7b2baefc3e178 (patch)
tree18127bda5e8e2307862aab4b6326278cfa3b9946 /src/mem/ruby/profiler/Profiler.cc
parentf1b6d1913c8816d4817a437176621dd066d9a47e (diff)
downloadgem5-4453537eadb177bd7fd8c50e68e7b2baefc3e178.tar.xz
ruby: profiler: provide the number of vnets through ruby system
The aim is to ultimately do away with the static function Network::getNumberOfVirtualNetworks().
Diffstat (limited to 'src/mem/ruby/profiler/Profiler.cc')
-rw-r--r--src/mem/ruby/profiler/Profiler.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/mem/ruby/profiler/Profiler.cc b/src/mem/ruby/profiler/Profiler.cc
index 7decd497a..b3b37e5a6 100644
--- a/src/mem/ruby/profiler/Profiler.cc
+++ b/src/mem/ruby/profiler/Profiler.cc
@@ -61,11 +61,10 @@ using namespace std;
using m5::stl_helpers::operator<<;
Profiler::Profiler(const RubySystemParams *p, RubySystem *rs)
- : m_ruby_system(rs)
+ : m_ruby_system(rs), m_hot_lines(p->hot_lines),
+ m_all_instructions(p->all_instructions),
+ m_num_vnets(p->number_of_virtual_networks)
{
- m_hot_lines = p->hot_lines;
- m_all_instructions = p->all_instructions;
-
m_address_profiler_ptr = new AddressProfiler(p->num_of_sequencers, this);
m_address_profiler_ptr->setHotLines(m_hot_lines);
m_address_profiler_ptr->setAllInstructions(m_all_instructions);
@@ -98,8 +97,7 @@ Profiler::regStats(const std::string &pName)
.desc("delay histogram for all message")
.flags(Stats::nozero | Stats::pdf | Stats::oneline);
- uint32_t numVNets = Network::getNumberOfVirtualNetworks();
- for (int i = 0; i < numVNets; i++) {
+ for (int i = 0; i < m_num_vnets; i++) {
delayVCHistogram.push_back(new Stats::Histogram());
delayVCHistogram[i]
->init(10)
@@ -251,7 +249,6 @@ Profiler::collateStats()
m_inst_profiler_ptr->collateStats();
}
- uint32_t numVNets = Network::getNumberOfVirtualNetworks();
for (uint32_t i = 0; i < MachineType_NUM; i++) {
for (map<uint32_t, AbstractController*>::iterator it =
m_ruby_system->m_abstract_controls[i].begin();
@@ -260,7 +257,7 @@ Profiler::collateStats()
AbstractController *ctr = (*it).second;
delayHistogram.add(ctr->getDelayHist());
- for (uint32_t i = 0; i < numVNets; i++) {
+ for (uint32_t i = 0; i < m_num_vnets; i++) {
delayVCHistogram[i]->add(ctr->getDelayVCHist(i));
}
}