36 #include "mem/ruby/protocol/RubyRequest.hh"
40 using m5::stl_helpers::operator<<;
53 record_map.insert(std::make_pair(
addr, dflt));
54 AddressMap::iterator
i =
r.first;
67 const AddressMap &record_map, std::string description,
70 const int records_printed = 100;
75 AddressMap::const_iterator
i = record_map.begin();
76 AddressMap::const_iterator end = record_map.end();
77 for (;
i != end; ++
i) {
80 sorted.push_back(record);
84 out <<
"Total_entries_" << description <<
": " << record_map.size()
87 out <<
"Total_Instructions_" << description <<
": " << misses
90 out <<
"Total_data_misses_" << description <<
": " << misses
94 out <<
"total | load store atomic | user supervisor | sharing | touched-by"
105 m_touched_vec.resize(num_of_sequencers+1);
106 m_touched_weighted_vec.resize(num_of_sequencers+1);
107 for (
int j = 0;
j < m_touched_vec.size();
j++) {
108 m_touched_vec[
j] = 0;
109 m_touched_weighted_vec[
j] = 0;
113 int max = sorted.size();
114 while (counter < max && counter < records_printed) {
116 double percent = 100.0 * (record->
getTotal() / double(misses));
117 out << description <<
" | " << percent <<
" % " << *record
126 while (counter < max) {
136 out <<
"all_records_" << description <<
": "
137 << all_records << std::endl
138 <<
"all_records_log_" << description <<
": "
139 << all_records_log << std::endl
140 <<
"remaining_records_" << description <<
": "
141 << remaining_records << std::endl
142 <<
"remaining_records_log_" << description <<
": "
143 << remaining_records_log << std::endl
144 <<
"touched_by_" << description <<
": "
145 << m_touched_vec << std::endl
146 <<
"touched_by_weighted_" << description <<
": "
147 << m_touched_weighted_vec << std::endl
152 : m_profiler(profiler)
179 out <<
"AddressProfiler Stats" << std::endl;
180 out <<
"---------------------" << std::endl;
190 out <<
"Hot Data Blocks" << std::endl;
191 out <<
"---------------" << std::endl;
197 out <<
"Hot MacroData Blocks" << std::endl;
198 out <<
"--------------------" << std::endl;
203 out <<
"Hot Instructions" << std::endl;
204 out <<
"----------------" << std::endl;
212 out <<
"All Instructions Profile:" << std::endl;
213 out <<
"-------------------------" << std::endl;
221 out <<
"Retry Profile" << std::endl;
222 out <<
"-------------" << std::endl;
231 out <<
"retry_histogram_percent: ";
259 const Set& owner,
const Set& sharers,
263 indirection_set.
addSet(sharers);
264 indirection_set.
addSet(owner);
265 indirection_set.
remove(requestor);
266 int num_indirections = indirection_set.
count();
269 bool indirection_miss = (num_indirections > 0);
271 addTraceSample(datablock, PC, RubyRequestType_ST, RubyAccessMode(0),
272 requestor, indirection_miss);
277 const Set& owner,
const Set& sharers,
281 indirection_set.
addSet(owner);
282 indirection_set.
remove(requestor);
283 int num_indirections = indirection_set.
count();
286 bool indirection_miss = (num_indirections > 0);
288 addTraceSample(datablock, PC, RubyRequestType_LD, RubyAccessMode(0),
289 requestor, indirection_miss);
294 RubyRequestType
type,
295 RubyAccessMode access_mode,
NodeID id,
306 update(
type, access_mode,
id, sharing_miss);
311 Addr macro_addr = mbits<Addr>(data_addr, 63, 10);
313 update(
type, access_mode,
id, sharing_miss);
317 update(
type, access_mode,
id, sharing_miss);
325 update(
type, access_mode,
id, sharing_miss);
333 if (
type == AccessType_Read) {