Deleted Added
sdiff udiff text old ( 4078:3f73f808bbd4 ) new ( 5606:6da7a58b0bc8 )
full compact
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)
160 {
161 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
174 if (repeat)
175 new _StatEvent(dump, reset, curTick + repeat, repeat);
176 }
177};
178
179void
180StatEvent(bool dump, bool reset, Tick when, Tick repeat)
181{
182 new _StatEvent(dump, reset, when, repeat);
183}
184
185/* namespace Stats */ }