diff options
author | Brandon Potter <brandon.potter@amd.com> | 2015-07-10 16:05:23 -0500 |
---|---|---|
committer | Brandon Potter <brandon.potter@amd.com> | 2015-07-10 16:05:23 -0500 |
commit | f9a370f1728fe5d752fa6962ba23774eec8c883e (patch) | |
tree | a81a0331b75c72ec801d1ecf1ce62a8bc6f3d112 /src/mem/ruby/profiler/AddressProfiler.cc | |
parent | c38f5098b152ea1e1dde96220d3f9e50d3411780 (diff) | |
download | gem5-f9a370f1728fe5d752fa6962ba23774eec8c883e.tar.xz |
ruby: replace global g_system_ptr with per-object pointers
This is another step in the process of removing global variables
from Ruby to enable multiple RubySystem instances in a single simulation.
With possibly multiple RubySystem objects, we can no longer use a global
variable to find "the" RubySystem object. Instead, each Ruby component
has to carry a pointer to the RubySystem object to which it belongs.
Diffstat (limited to 'src/mem/ruby/profiler/AddressProfiler.cc')
-rw-r--r-- | src/mem/ruby/profiler/AddressProfiler.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mem/ruby/profiler/AddressProfiler.cc b/src/mem/ruby/profiler/AddressProfiler.cc index 0d5d135eb..a2e41ee76 100644 --- a/src/mem/ruby/profiler/AddressProfiler.cc +++ b/src/mem/ruby/profiler/AddressProfiler.cc @@ -32,7 +32,6 @@ #include "mem/protocol/RubyRequest.hh" #include "mem/ruby/profiler/AddressProfiler.hh" #include "mem/ruby/profiler/Profiler.hh" -#include "mem/ruby/system/System.hh" using namespace std; typedef AddressProfiler::AddressMap AddressMap; @@ -64,7 +63,7 @@ lookupTraceForAddress(const Address& addr, AddressMap& record_map) void printSorted(ostream& out, int num_of_sequencers, const AddressMap &record_map, - string description) + string description, Profiler *profiler) { const int records_printed = 100; @@ -82,7 +81,7 @@ printSorted(ostream& out, int num_of_sequencers, const AddressMap &record_map, out << "Total_entries_" << description << ": " << record_map.size() << endl; - if (g_system_ptr->getProfiler()->getAllInstructions()) + if (profiler->getAllInstructions()) out << "Total_Instructions_" << description << ": " << misses << endl; else out << "Total_data_misses_" << description << ": " << misses << endl; @@ -143,7 +142,8 @@ printSorted(ostream& out, int num_of_sequencers, const AddressMap &record_map, << endl; } -AddressProfiler::AddressProfiler(int num_of_sequencers) +AddressProfiler::AddressProfiler(int num_of_sequencers, Profiler *profiler) + : m_profiler(profiler) { m_num_of_sequencers = num_of_sequencers; clearStats(); @@ -183,20 +183,20 @@ AddressProfiler::printStats(ostream& out) const out << "---------------" << endl; out << endl; printSorted(out, m_num_of_sequencers, m_dataAccessTrace, - "block_address"); + "block_address", m_profiler); out << endl; out << "Hot MacroData Blocks" << endl; out << "--------------------" << endl; out << endl; printSorted(out, m_num_of_sequencers, m_macroBlockAccessTrace, - "macroblock_address"); + "macroblock_address", m_profiler); out << "Hot Instructions" << endl; out << "----------------" << endl; out << endl; printSorted(out, m_num_of_sequencers, m_programCounterAccessTrace, - "pc_address"); + "pc_address", m_profiler); } if (m_all_instructions) { @@ -205,7 +205,7 @@ AddressProfiler::printStats(ostream& out) const out << "-------------------------" << endl; out << endl; printSorted(out, m_num_of_sequencers, m_programCounterAccessTrace, - "pc_address"); + "pc_address", m_profiler); out << endl; } @@ -222,7 +222,7 @@ AddressProfiler::printStats(ostream& out) const out << endl; printSorted(out, m_num_of_sequencers, m_retryProfileMap, - "block_address"); + "block_address", m_profiler); out << endl; } } |