AddressProfiler.cc (6285:ce086eca1ede) AddressProfiler.cc (6433:0f0f0fbef977)
1
2/*
3 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

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

49static void printSorted(ostream& out, const Map<Address, AccessTraceForAddress>* record_map, string description);
50
51AddressProfiler::AddressProfiler()
52{
53 m_dataAccessTrace = new Map<Address, AccessTraceForAddress>;
54 m_macroBlockAccessTrace = new Map<Address, AccessTraceForAddress>;
55 m_programCounterAccessTrace = new Map<Address, AccessTraceForAddress>;
56 m_retryProfileMap = new Map<Address, AccessTraceForAddress>;
1
2/*
3 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

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

49static void printSorted(ostream& out, const Map<Address, AccessTraceForAddress>* record_map, string description);
50
51AddressProfiler::AddressProfiler()
52{
53 m_dataAccessTrace = new Map<Address, AccessTraceForAddress>;
54 m_macroBlockAccessTrace = new Map<Address, AccessTraceForAddress>;
55 m_programCounterAccessTrace = new Map<Address, AccessTraceForAddress>;
56 m_retryProfileMap = new Map<Address, AccessTraceForAddress>;
57 m_persistentPredictionProfileMap = new Map<Address, AccessTraceForAddress>;
58 clearStats();
59}
60
61AddressProfiler::~AddressProfiler()
62{
63 delete m_dataAccessTrace;
64 delete m_macroBlockAccessTrace;
65 delete m_programCounterAccessTrace;
66 delete m_retryProfileMap;
57 clearStats();
58}
59
60AddressProfiler::~AddressProfiler()
61{
62 delete m_dataAccessTrace;
63 delete m_macroBlockAccessTrace;
64 delete m_programCounterAccessTrace;
65 delete m_retryProfileMap;
67 delete m_persistentPredictionProfileMap;
68}
69
70void AddressProfiler::setHotLines(bool hot_lines){
71 m_hot_lines = hot_lines;
72}
73void AddressProfiler::setAllInstructions(bool all_instructions){
74 m_all_instructions = all_instructions;
75}

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

120 out << "retry_histogram_absolute: " << m_retryProfileHisto << endl;
121 out << "retry_histogram_write: " << m_retryProfileHistoWrite << endl;
122 out << "retry_histogram_read: " << m_retryProfileHistoRead << endl;
123
124 out << "retry_histogram_percent: ";
125 m_retryProfileHisto.printPercent(out);
126 out << endl;
127
66}
67
68void AddressProfiler::setHotLines(bool hot_lines){
69 m_hot_lines = hot_lines;
70}
71void AddressProfiler::setAllInstructions(bool all_instructions){
72 m_all_instructions = all_instructions;
73}

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

118 out << "retry_histogram_absolute: " << m_retryProfileHisto << endl;
119 out << "retry_histogram_write: " << m_retryProfileHistoWrite << endl;
120 out << "retry_histogram_read: " << m_retryProfileHistoRead << endl;
121
122 out << "retry_histogram_percent: ";
123 m_retryProfileHisto.printPercent(out);
124 out << endl;
125
128 out << "retry_histogram_per_instruction: ";
129 m_retryProfileHisto.printWithMultiplier(out, 1.0 / double(g_system_ptr->getProfiler()->getTotalInstructionsExecuted()));
130 out << endl;
131
132 printSorted(out, m_retryProfileMap, "block_address");
133 out << endl;
134 }
135
126 printSorted(out, m_retryProfileMap, "block_address");
127 out << endl;
128 }
129
136 if (m_persistentPredictionProfileHisto.size() > 0) {
137 out << "Persistent Prediction Profile" << endl;
138 out << "-------------" << endl;
139 out << endl;
140 out << "persistent prediction_histogram: " << m_persistentPredictionProfileHisto << endl;
141
142 out << "persistent prediction_histogram_percent: ";
143 m_persistentPredictionProfileHisto.printPercent(out);
144 out << endl;
145
146 out << "persistentPrediction_histogram_per_instruction: ";
147 m_persistentPredictionProfileHisto.printWithMultiplier(out, 1.0 / double(g_system_ptr->getProfiler()->getTotalInstructionsExecuted()));
148 out << endl;
149
150 printSorted(out, m_persistentPredictionProfileMap, "block_address");
151 out << endl;
152 }
153}
154
155void AddressProfiler::clearStats()
156{
157 // Clear the maps
158 m_sharing_miss_counter = 0;
159 m_dataAccessTrace->clear();
160 m_macroBlockAccessTrace->clear();

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

228 } else {
229 m_retryProfileHistoWrite.add(count);
230 }
231 if (count > 1) {
232 lookupTraceForAddress(data_addr, m_retryProfileMap).addSample(count);
233 }
234}
235
130}
131
132void AddressProfiler::clearStats()
133{
134 // Clear the maps
135 m_sharing_miss_counter = 0;
136 m_dataAccessTrace->clear();
137 m_macroBlockAccessTrace->clear();

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

205 } else {
206 m_retryProfileHistoWrite.add(count);
207 }
208 if (count > 1) {
209 lookupTraceForAddress(data_addr, m_retryProfileMap).addSample(count);
210 }
211}
212
236void AddressProfiler::profilePersistentPrediction(const Address& data_addr, AccessType type)
237{
238 m_persistentPredictionProfileHisto.add(1);
239 lookupTraceForAddress(data_addr, m_persistentPredictionProfileMap).addSample(1);
240}
241
242// ***** Normal Functions ******
243
244static void printSorted(ostream& out, const Map<Address, AccessTraceForAddress>* record_map, string description)
245{
246 const int records_printed = 100;
247
248 uint64 misses = 0;
249 PrioHeap<AccessTraceForAddress*> heap;

--- 68 unchanged lines hidden ---
213// ***** Normal Functions ******
214
215static void printSorted(ostream& out, const Map<Address, AccessTraceForAddress>* record_map, string description)
216{
217 const int records_printed = 100;
218
219 uint64 misses = 0;
220 PrioHeap<AccessTraceForAddress*> heap;

--- 68 unchanged lines hidden ---