Profiler.cc (9171:ae88ecf37145) Profiler.cc (9206:f6483789d23a)
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;

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

132
133 out << endl;
134
135 if (m_all_instructions) {
136 m_inst_profiler_ptr->printStats(out);
137 }
138
139 //g_system_ptr->getNetwork()->printStats(out);
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;

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

132
133 out << endl;
134
135 if (m_all_instructions) {
136 m_inst_profiler_ptr->printStats(out);
137 }
138
139 //g_system_ptr->getNetwork()->printStats(out);
140 schedule(m_event, curTick() + m_stats_period * g_system_ptr->getClock());
140 schedule(m_event, g_system_ptr->clockEdge(Cycles(m_stats_period )));
141}
142
143void
144Profiler::setPeriodicStatsFile(const string& filename)
145{
146 cout << "Recording periodic statistics to file '" << filename << "' every "
147 << m_stats_period << " Ruby cycles" << endl;
148
149 if (m_periodic_output_file_ptr != &cerr) {
150 delete m_periodic_output_file_ptr;
151 }
152
153 m_periodic_output_file_ptr = new ofstream(filename.c_str());
141}
142
143void
144Profiler::setPeriodicStatsFile(const string& filename)
145{
146 cout << "Recording periodic statistics to file '" << filename << "' every "
147 << m_stats_period << " Ruby cycles" << endl;
148
149 if (m_periodic_output_file_ptr != &cerr) {
150 delete m_periodic_output_file_ptr;
151 }
152
153 m_periodic_output_file_ptr = new ofstream(filename.c_str());
154 schedule(m_event, curTick() + g_system_ptr->getClock());
154 schedule(m_event, g_system_ptr->clockEdge(Cycles(1)));
155}
156
157void
158Profiler::setPeriodicStatsInterval(integer_t period)
159{
160 cout << "Recording periodic statistics every " << m_stats_period
161 << " Ruby cycles" << endl;
162
163 m_stats_period = period;
155}
156
157void
158Profiler::setPeriodicStatsInterval(integer_t period)
159{
160 cout << "Recording periodic statistics every " << m_stats_period
161 << " Ruby cycles" << endl;
162
163 m_stats_period = period;
164 schedule(m_event, curTick() + g_system_ptr->getClock());
164 schedule(m_event, g_system_ptr->clockEdge(Cycles(1)));
165}
166
167void
168Profiler::print(ostream& out) const
169{
170 out << "[Profiler]";
171}
172

--- 571 unchanged lines hidden ---
165}
166
167void
168Profiler::print(ostream& out) const
169{
170 out << "[Profiler]";
171}
172

--- 571 unchanged lines hidden ---