StoreTrace.cc (7055:4e24742201d7) StoreTrace.cc (9171:ae88ecf37145)
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
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/ruby/eventqueue/RubyEventQueue.hh"
30#include "mem/ruby/profiler/StoreTrace.hh"
29#include "mem/ruby/profiler/StoreTrace.hh"
30#include "sim/core.hh"
31
32using namespace std;
33
34bool StoreTrace::s_init = false; // Total number of store lifetimes of
35 // all lines
36int64 StoreTrace::s_total_samples = 0; // Total number of store
37 // lifetimes of all lines
38Histogram* StoreTrace::s_store_count_ptr = NULL;

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

100 s_store_first_to_stolen_ptr->clear();
101 s_store_last_to_stolen_ptr->clear();
102 s_store_first_to_last_ptr->clear();
103}
104
105void
106StoreTrace::store(NodeID node)
107{
31
32using namespace std;
33
34bool StoreTrace::s_init = false; // Total number of store lifetimes of
35 // all lines
36int64 StoreTrace::s_total_samples = 0; // Total number of store
37 // lifetimes of all lines
38Histogram* StoreTrace::s_store_count_ptr = NULL;

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

100 s_store_first_to_stolen_ptr->clear();
101 s_store_last_to_stolen_ptr->clear();
102 s_store_first_to_last_ptr->clear();
103}
104
105void
106StoreTrace::store(NodeID node)
107{
108 Time current = g_eventQueue_ptr->getTime();
108 Tick current = curTick();
109
110 assert((m_last_writer == -1) || (m_last_writer == node));
111
112 m_last_writer = node;
113 if (m_last_writer == -1) {
114 assert(m_stores_this_interval == 0);
115 }
116

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

122 m_last_store = current;
123 m_stores_this_interval++;
124}
125
126void
127StoreTrace::downgrade(NodeID node)
128{
129 if (node == m_last_writer) {
109
110 assert((m_last_writer == -1) || (m_last_writer == node));
111
112 m_last_writer = node;
113 if (m_last_writer == -1) {
114 assert(m_stores_this_interval == 0);
115 }
116

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

122 m_last_store = current;
123 m_stores_this_interval++;
124}
125
126void
127StoreTrace::downgrade(NodeID node)
128{
129 if (node == m_last_writer) {
130 Time current = g_eventQueue_ptr->getTime();
130 Time current = curTick();
131 assert(m_stores_this_interval != 0);
132 assert(m_last_store != 0);
133 assert(m_first_store != 0);
134 assert(m_last_writer != -1);
135
136 // Per line stats
137 m_store_first_to_stolen.add(current - m_first_store);
138 m_store_count.add(m_stores_this_interval);

--- 19 unchanged lines hidden ---
131 assert(m_stores_this_interval != 0);
132 assert(m_last_store != 0);
133 assert(m_first_store != 0);
134 assert(m_last_writer != -1);
135
136 // Per line stats
137 m_store_first_to_stolen.add(current - m_first_store);
138 m_store_count.add(m_stores_this_interval);

--- 19 unchanged lines hidden ---