36 #include "mem/ruby/protocol/RubyRequest.hh"
41 using m5::stl_helpers::operator<<;
54 record_map.insert(make_pair(
addr, dflt));
55 AddressMap::iterator
i =
r.first;
68 string description,
Profiler *profiler)
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 << endl;
89 out <<
"Total_data_misses_" << description <<
": " << misses << endl;
91 out <<
"total | load store atomic | user supervisor | sharing | touched-by"
102 m_touched_vec.resize(num_of_sequencers+1);
103 m_touched_weighted_vec.resize(num_of_sequencers+1);
104 for (
int j = 0;
j < m_touched_vec.size();
j++) {
105 m_touched_vec[
j] = 0;
106 m_touched_weighted_vec[
j] = 0;
110 int max = sorted.size();
111 while (counter < max && counter < records_printed) {
113 double percent = 100.0 * (record->
getTotal() / double(misses));
114 out << description <<
" | " << percent <<
" % " << *record << endl;
122 while (counter < max) {
132 out <<
"all_records_" << description <<
": "
133 << all_records << endl
134 <<
"all_records_log_" << description <<
": "
135 << all_records_log << endl
136 <<
"remaining_records_" << description <<
": "
137 << remaining_records << endl
138 <<
"remaining_records_log_" << description <<
": "
139 << remaining_records_log << endl
140 <<
"touched_by_" << description <<
": "
141 << m_touched_vec << endl
142 <<
"touched_by_weighted_" << description <<
": "
143 << m_touched_weighted_vec << endl
148 : m_profiler(profiler)
175 out <<
"AddressProfiler Stats" << endl;
176 out <<
"---------------------" << endl;
184 out <<
"Hot Data Blocks" << endl;
185 out <<
"---------------" << endl;
191 out <<
"Hot MacroData Blocks" << endl;
192 out <<
"--------------------" << endl;
197 out <<
"Hot Instructions" << endl;
198 out <<
"----------------" << endl;
206 out <<
"All Instructions Profile:" << endl;
207 out <<
"-------------------------" << endl;
215 out <<
"Retry Profile" << endl;
216 out <<
"-------------" << endl;
222 out <<
"retry_histogram_percent: ";
250 const Set& owner,
const Set& sharers,
254 indirection_set.
addSet(sharers);
255 indirection_set.
addSet(owner);
256 indirection_set.
remove(requestor);
257 int num_indirections = indirection_set.
count();
260 bool indirection_miss = (num_indirections > 0);
262 addTraceSample(datablock, PC, RubyRequestType_ST, RubyAccessMode(0),
263 requestor, indirection_miss);
268 const Set& owner,
const Set& sharers,
272 indirection_set.
addSet(owner);
273 indirection_set.
remove(requestor);
274 int num_indirections = indirection_set.
count();
277 bool indirection_miss = (num_indirections > 0);
279 addTraceSample(datablock, PC, RubyRequestType_LD, RubyAccessMode(0),
280 requestor, indirection_miss);
285 RubyRequestType
type,
286 RubyAccessMode access_mode,
NodeID id,
297 update(
type, access_mode,
id, sharing_miss);
302 Addr macro_addr = mbits<Addr>(data_addr, 63, 10);
304 update(
type, access_mode,
id, sharing_miss);
308 update(
type, access_mode,
id, sharing_miss);
316 update(
type, access_mode,
id, sharing_miss);
324 if (
type == AccessType_Read) {