Deleted Added
sdiff udiff text old ( 7055:4e24742201d7 ) new ( 7454:3a3e8e8cce1b )
full compact
1/*
2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include "mem/gems_common/Map.hh"
30#include "mem/gems_common/PrioHeap.hh"
31#include "mem/protocol/CacheMsg.hh"
32#include "mem/ruby/profiler/AccessTraceForAddress.hh"
33#include "mem/ruby/profiler/AddressProfiler.hh"
34#include "mem/ruby/profiler/Profiler.hh"
35#include "mem/ruby/system/System.hh"
36
37using namespace std;
38typedef AddressProfiler::AddressMap AddressMap;
39
40// Helper functions
41AccessTraceForAddress&
42lookupTraceForAddress(const Address& addr, AddressMap* record_map)
43{
44 if (!record_map->exist(addr)) {
45 record_map->add(addr, AccessTraceForAddress(addr));
46 }
47 return record_map->lookup(addr);
48}
49
50void
51printSorted(ostream& out, int num_of_sequencers, const AddressMap* record_map,
52 string description)
53{
54 const int records_printed = 100;
55
56 uint64 misses = 0;
57 PrioHeap<AccessTraceForAddress*> heap;
58 Vector<Address> keys = record_map->keys();
59 for (int i = 0; i < keys.size(); i++) {
60 AccessTraceForAddress* record = &(record_map->lookup(keys[i]));
61 misses += record->getTotal();
62 heap.insert(record);
63 }
64
65 out << "Total_entries_" << description << ": " << keys.size() << endl;
66 if (g_system_ptr->getProfiler()->getAllInstructions())

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

72 << endl;
73
74 Histogram remaining_records(1, 100);
75 Histogram all_records(1, 100);
76 Histogram remaining_records_log(-1);
77 Histogram all_records_log(-1);
78
79 // Allows us to track how many lines where touched by n processors
80 Vector<int64> m_touched_vec;
81 Vector<int64> m_touched_weighted_vec;
82 m_touched_vec.setSize(num_of_sequencers+1);
83 m_touched_weighted_vec.setSize(num_of_sequencers+1);
84 for (int i = 0; i < m_touched_vec.size(); i++) {
85 m_touched_vec[i] = 0;
86 m_touched_weighted_vec[i] = 0;
87 }
88
89 int counter = 0;
90 while (heap.size() > 0 && counter < records_printed) {
91 AccessTraceForAddress* record = heap.extractMin();

--- 228 unchanged lines hidden ---