Profiler.cc (11049:dfb0aa3f0649) Profiler.cc (11172:9261e98e4501)
1/*
2 * Copyright (c) 1999-2013 Mark D. Hill and David A. Wood
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 47 unchanged lines hidden (view full) ---

56#include "mem/ruby/profiler/AddressProfiler.hh"
57#include "mem/ruby/profiler/Profiler.hh"
58#include "mem/ruby/system/Sequencer.hh"
59
60using namespace std;
61using m5::stl_helpers::operator<<;
62
63Profiler::Profiler(const RubySystemParams *p, RubySystem *rs)
1/*
2 * Copyright (c) 1999-2013 Mark D. Hill and David A. Wood
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 47 unchanged lines hidden (view full) ---

56#include "mem/ruby/profiler/AddressProfiler.hh"
57#include "mem/ruby/profiler/Profiler.hh"
58#include "mem/ruby/system/Sequencer.hh"
59
60using namespace std;
61using m5::stl_helpers::operator<<;
62
63Profiler::Profiler(const RubySystemParams *p, RubySystem *rs)
64 : m_ruby_system(rs)
64 : m_ruby_system(rs), m_hot_lines(p->hot_lines),
65 m_all_instructions(p->all_instructions),
66 m_num_vnets(p->number_of_virtual_networks)
65{
67{
66 m_hot_lines = p->hot_lines;
67 m_all_instructions = p->all_instructions;
68
69 m_address_profiler_ptr = new AddressProfiler(p->num_of_sequencers, this);
70 m_address_profiler_ptr->setHotLines(m_hot_lines);
71 m_address_profiler_ptr->setAllInstructions(m_all_instructions);
72
73 if (m_all_instructions) {
74 m_inst_profiler_ptr = new AddressProfiler(p->num_of_sequencers, this);
75 m_inst_profiler_ptr->setHotLines(m_hot_lines);
76 m_inst_profiler_ptr->setAllInstructions(m_all_instructions);

--- 16 unchanged lines hidden (view full) ---

93 }
94
95 delayHistogram
96 .init(10)
97 .name(pName + ".delayHist")
98 .desc("delay histogram for all message")
99 .flags(Stats::nozero | Stats::pdf | Stats::oneline);
100
68 m_address_profiler_ptr = new AddressProfiler(p->num_of_sequencers, this);
69 m_address_profiler_ptr->setHotLines(m_hot_lines);
70 m_address_profiler_ptr->setAllInstructions(m_all_instructions);
71
72 if (m_all_instructions) {
73 m_inst_profiler_ptr = new AddressProfiler(p->num_of_sequencers, this);
74 m_inst_profiler_ptr->setHotLines(m_hot_lines);
75 m_inst_profiler_ptr->setAllInstructions(m_all_instructions);

--- 16 unchanged lines hidden (view full) ---

92 }
93
94 delayHistogram
95 .init(10)
96 .name(pName + ".delayHist")
97 .desc("delay histogram for all message")
98 .flags(Stats::nozero | Stats::pdf | Stats::oneline);
99
101 uint32_t numVNets = Network::getNumberOfVirtualNetworks();
102 for (int i = 0; i < numVNets; i++) {
100 for (int i = 0; i < m_num_vnets; i++) {
103 delayVCHistogram.push_back(new Stats::Histogram());
104 delayVCHistogram[i]
105 ->init(10)
106 .name(pName + csprintf(".delayVCHist.vnet_%i", i))
107 .desc(csprintf("delay histogram for vnet_%i", i))
108 .flags(Stats::nozero | Stats::pdf | Stats::oneline);
109 }
110

--- 135 unchanged lines hidden (view full) ---

246 if (!m_all_instructions) {
247 m_address_profiler_ptr->collateStats();
248 }
249
250 if (m_all_instructions) {
251 m_inst_profiler_ptr->collateStats();
252 }
253
101 delayVCHistogram.push_back(new Stats::Histogram());
102 delayVCHistogram[i]
103 ->init(10)
104 .name(pName + csprintf(".delayVCHist.vnet_%i", i))
105 .desc(csprintf("delay histogram for vnet_%i", i))
106 .flags(Stats::nozero | Stats::pdf | Stats::oneline);
107 }
108

--- 135 unchanged lines hidden (view full) ---

244 if (!m_all_instructions) {
245 m_address_profiler_ptr->collateStats();
246 }
247
248 if (m_all_instructions) {
249 m_inst_profiler_ptr->collateStats();
250 }
251
254 uint32_t numVNets = Network::getNumberOfVirtualNetworks();
255 for (uint32_t i = 0; i < MachineType_NUM; i++) {
256 for (map<uint32_t, AbstractController*>::iterator it =
257 m_ruby_system->m_abstract_controls[i].begin();
258 it != m_ruby_system->m_abstract_controls[i].end(); ++it) {
259
260 AbstractController *ctr = (*it).second;
261 delayHistogram.add(ctr->getDelayHist());
262
252 for (uint32_t i = 0; i < MachineType_NUM; i++) {
253 for (map<uint32_t, AbstractController*>::iterator it =
254 m_ruby_system->m_abstract_controls[i].begin();
255 it != m_ruby_system->m_abstract_controls[i].end(); ++it) {
256
257 AbstractController *ctr = (*it).second;
258 delayHistogram.add(ctr->getDelayHist());
259
263 for (uint32_t i = 0; i < numVNets; i++) {
260 for (uint32_t i = 0; i < m_num_vnets; i++) {
264 delayVCHistogram[i]->add(ctr->getDelayVCHist(i));
265 }
266 }
267 }
268
269 for (uint32_t i = 0; i < MachineType_NUM; i++) {
270 for (map<uint32_t, AbstractController*>::iterator it =
271 m_ruby_system->m_abstract_controls[i].begin();

--- 84 unchanged lines hidden ---
261 delayVCHistogram[i]->add(ctr->getDelayVCHist(i));
262 }
263 }
264 }
265
266 for (uint32_t i = 0; i < MachineType_NUM; i++) {
267 for (map<uint32_t, AbstractController*>::iterator it =
268 m_ruby_system->m_abstract_controls[i].begin();

--- 84 unchanged lines hidden ---