Ok, actually call resetStats on all stats

minor gratuitous cleanup in printAllExtraOutput.
(only create one end iterator)

Fix average stats reset

base/statistics.hh:
    Shouldn't reset average stats this way.  The current stat value
    should stay the same.
sim/sim_object.cc:
    Ok, actually call resetStats on all stats
    minor gratuitous cleanup in printAllExtraOutput.
    (only create one end iterator)

--HG--
extra : convert_revision : 13090ebe490a93757b8eb7d7c6a9697983095e41
This commit is contained in:
Nathan Binkert
2003-11-05 21:17:13 -05:00
parent b064b8a6fd
commit f2881c752e
2 changed files with 12 additions and 4 deletions

View File

@@ -528,7 +528,6 @@ struct AvgStor
*/
void reset()
{
current = T();
total = 0;
last = curTick;
}

View File

@@ -131,6 +131,13 @@ SimObject::regAllStats()
void
SimObject::resetAllStats()
{
SimObjectList::iterator i = simObjectList.begin();
SimObjectList::iterator end = simObjectList.end();
for (; i != end; ++i) {
SimObject *obj = *i;
obj->resetStats();
}
}
//
@@ -139,9 +146,11 @@ SimObject::resetAllStats()
void
SimObject::printAllExtraOutput(ostream &os)
{
SimObjectList::iterator i;
SimObjectList::iterator i = simObjectList.begin();
SimObjectList::iterator end = simObjectList.end();
for (i = simObjectList.begin(); i != simObjectList.end(); ++i) {
(*i)->printExtraOutput(os);
for (; i != end; ++i) {
SimObject *obj = *i;
obj->printExtraOutput(os);
}
}