stat_control.cc (7822:fc475ac7d2a4) stat_control.cc (7823:dac01f14f20f)
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
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;

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

61Time statTime(true);
62Tick startTick;
63
64struct SimTicksReset : public Callback
65{
66 void process()
67 {
68 statTime.set();
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
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;

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

61Time statTime(true);
62Tick startTick;
63
64struct SimTicksReset : public Callback
65{
66 void process()
67 {
68 statTime.set();
69 startTick = curTick;
69 startTick = curTick();
70 }
71};
72
73double
74statElapsedTime()
75{
76 Time now(true);
77 Time elapsed = now - statTime;
78 return elapsed();
79}
80
81Tick
82statElapsedTicks()
83{
70 }
71};
72
73double
74statElapsedTime()
75{
76 Time now(true);
77 Time elapsed = now - statTime;
78 return elapsed();
79}
80
81Tick
82statElapsedTicks()
83{
84 return curTick - startTick;
84 return curTick() - startTick;
85}
86
87SimTicksReset simTicksReset;
88
89struct Global
90{
91 Stats::Formula hostInstRate;
92 Stats::Formula hostTickRate;

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

184 {
185 if (dump)
186 Stats::dump();
187
188 if (reset)
189 Stats::reset();
190
191 if (repeat) {
85}
86
87SimTicksReset simTicksReset;
88
89struct Global
90{
91 Stats::Formula hostInstRate;
92 Stats::Formula hostTickRate;

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

184 {
185 if (dump)
186 Stats::dump();
187
188 if (reset)
189 Stats::reset();
190
191 if (repeat) {
192 Stats::schedStatEvent(dump, reset, curTick + repeat, repeat);
192 Stats::schedStatEvent(dump, reset, curTick() + repeat, repeat);
193 }
194 }
195};
196
197void
198schedStatEvent(bool dump, bool reset, Tick when, Tick repeat)
199{
200 Event *event = new StatEvent(dump, reset, repeat);
201 mainEventQueue.schedule(event, when);
202}
203
204} // namespace Stats
193 }
194 }
195};
196
197void
198schedStatEvent(bool dump, bool reset, Tick when, Tick repeat)
199{
200 Event *event = new StatEvent(dump, reset, repeat);
201 mainEventQueue.schedule(event, when);
202}
203
204} // namespace Stats