34 #include "mem/protocol/RubyRequest.hh"
40 using m5::stl_helpers::operator<<;
53 record_map.insert(make_pair(addr, dflt));
54 AddressMap::iterator
i = r.first;
67 string description,
Profiler *profiler)
69 const int records_printed = 100;
74 AddressMap::const_iterator
i = record_map.begin();
75 AddressMap::const_iterator end = record_map.end();
76 for (; i != end; ++
i) {
79 sorted.push_back(record);
83 out <<
"Total_entries_" << description <<
": " << record_map.size()
86 out <<
"Total_Instructions_" << description <<
": " << misses << endl;
88 out <<
"Total_data_misses_" << description <<
": " << misses << endl;
90 out <<
"total | load store atomic | user supervisor | sharing | touched-by"
101 m_touched_vec.resize(num_of_sequencers+1);
102 m_touched_weighted_vec.resize(num_of_sequencers+1);
103 for (
int j = 0;
j < m_touched_vec.size();
j++) {
104 m_touched_vec[
j] = 0;
105 m_touched_weighted_vec[
j] = 0;
109 int max = sorted.size();
110 while (counter < max && counter < records_printed) {
112 double percent = 100.0 * (record->
getTotal() / double(misses));
113 out << description <<
" | " << percent <<
" % " << *record << endl;
121 while (counter < max) {
131 out <<
"all_records_" << description <<
": "
132 << all_records << endl
133 <<
"all_records_log_" << description <<
": "
134 << all_records_log << endl
135 <<
"remaining_records_" << description <<
": "
136 << remaining_records << endl
137 <<
"remaining_records_log_" << description <<
": "
138 << remaining_records_log << endl
139 <<
"touched_by_" << description <<
": "
140 << m_touched_vec << endl
141 <<
"touched_by_weighted_" << description <<
": "
142 << m_touched_weighted_vec << endl
147 : m_profiler(profiler)
174 out <<
"AddressProfiler Stats" << endl;
175 out <<
"---------------------" << endl;
183 out <<
"Hot Data Blocks" << endl;
184 out <<
"---------------" << endl;
190 out <<
"Hot MacroData Blocks" << endl;
191 out <<
"--------------------" << endl;
196 out <<
"Hot Instructions" << endl;
197 out <<
"----------------" << endl;
205 out <<
"All Instructions Profile:" << endl;
206 out <<
"-------------------------" << endl;
214 out <<
"Retry Profile" << endl;
215 out <<
"-------------" << endl;
221 out <<
"retry_histogram_percent: ";
249 const Set& owner,
const Set& sharers,
253 indirection_set.
addSet(sharers);
254 indirection_set.
addSet(owner);
255 indirection_set.
remove(requestor);
256 int num_indirections = indirection_set.
count();
259 bool indirection_miss = (num_indirections > 0);
261 addTraceSample(datablock, PC, RubyRequestType_ST, RubyAccessMode(0),
262 requestor, indirection_miss);
267 const Set& owner,
const Set& sharers,
271 indirection_set.
addSet(owner);
272 indirection_set.
remove(requestor);
273 int num_indirections = indirection_set.
count();
276 bool indirection_miss = (num_indirections > 0);
278 addTraceSample(datablock, PC, RubyRequestType_LD, RubyAccessMode(0),
279 requestor, indirection_miss);
284 RubyRequestType
type,
285 RubyAccessMode access_mode,
NodeID id,
296 update(type, access_mode,
id, sharing_miss);
303 update(type, access_mode,
id, sharing_miss);
307 update(type, access_mode,
id, sharing_miss);
315 update(type, access_mode,
id, sharing_miss);
323 if (type == AccessType_Read) {
Histogram m_gets_sharing_histogram
std::unordered_map< Addr, AccessTraceForAddress > AddressMap
AddressMap m_dataAccessTrace
Histogram m_retryProfileHisto
void remove(NodeID index)
void setHotLines(bool hot_lines)
Histogram m_retryProfileHistoWrite
AddressProfiler(int num_of_sequencers, Profiler *profiler)
void setAddress(Addr addr)
void profileGetX(Addr datablock, Addr PC, const Set &owner, const Set &sharers, NodeID requestor)
void addTraceSample(Addr data_addr, Addr pc_addr, RubyRequestType type, RubyAccessMode access_mode, NodeID id, bool sharing_miss)
int64_t m_sharing_miss_counter
void printStats(std::ostream &out) const
AccessTraceForAddress & lookupTraceForAddress(Addr addr, AddressMap &record_map)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Addr makeLineAddress(Addr addr)
AddressProfiler::AddressMap AddressMap
void addSet(const Set &obj)
void addSample(int value)
Histogram m_getx_sharing_histogram
void setAllInstructions(bool all_instructions)
void profileRetry(Addr data_addr, AccessType type, int count)
AddressMap m_programCounterAccessTrace
void printSorted(ostream &out, int num_of_sequencers, const AddressMap &record_map, string description, Profiler *profiler)
void printPercent(std::ostream &out) const
void profileGetS(Addr datablock, Addr PC, const Set &owner, const Set &sharers, NodeID requestor)
Histogram m_retryProfileHistoRead
AddressMap m_macroBlockAccessTrace
static bool less_equal(const AccessTraceForAddress *n1, const AccessTraceForAddress *n2)
Addr maskLowOrderBits(Addr addr, unsigned int number)
AddressMap m_retryProfileMap
bool getAllInstructions() const