stat_control.cc (4078:3f73f808bbd4) stat_control.cc (5606:6da7a58b0bc8)
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;

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

149class _StatEvent : public Event
150{
151 private:
152 bool dump;
153 bool reset;
154 Tick repeat;
155
156 public:
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;

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

149class _StatEvent : public Event
150{
151 private:
152 bool dump;
153 bool reset;
154 Tick repeat;
155
156 public:
157 _StatEvent(bool _dump, bool _reset, Tick _when, Tick _repeat)
158 : Event(&mainEventQueue, Stat_Event_Pri), dump(_dump), reset(_reset),
159 repeat(_repeat)
157 _StatEvent(bool _dump, bool _reset, Tick _repeat)
158 : Event(Stat_Event_Pri), dump(_dump), reset(_reset), repeat(_repeat)
160 {
161 setFlags(AutoDelete);
159 {
160 setFlags(AutoDelete);
162 schedule(_when);
163 }
164
165 virtual void
166 process()
167 {
168 if (dump)
169 Stats::dump();
170
171 if (reset)
172 Stats::reset();
173
161 }
162
163 virtual void
164 process()
165 {
166 if (dump)
167 Stats::dump();
168
169 if (reset)
170 Stats::reset();
171
174 if (repeat)
175 new _StatEvent(dump, reset, curTick + repeat, repeat);
172 if (repeat) {
173 Event *event = new _StatEvent(dump, reset, repeat);
174 mainEventQueue.schedule(event, curTick + repeat);
175 }
176 }
177};
178
179void
180StatEvent(bool dump, bool reset, Tick when, Tick repeat)
181{
176 }
177};
178
179void
180StatEvent(bool dump, bool reset, Tick when, Tick repeat)
181{
182 new _StatEvent(dump, reset, when, repeat);
182 Event *event = new _StatEvent(dump, reset, repeat);
183 mainEventQueue.schedule(event, when);
183}
184
185/* namespace Stats */ }
184}
185
186/* namespace Stats */ }