From: Nathan Binkert Date: Thu, 6 Nov 2003 02:17:13 +0000 (-0500) Subject: Ok, actually call resetStats on all stats X-Git-Tag: m5_1.0_beta2~286 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f2881c752e29390dd99e5b685505494a72776f7e;p=gem5.git 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 --- diff --git a/base/statistics.hh b/base/statistics.hh index fc3252782..f71e24672 100644 --- a/base/statistics.hh +++ b/base/statistics.hh @@ -528,7 +528,6 @@ struct AvgStor */ void reset() { - current = T(); total = 0; last = curTick; } diff --git a/sim/sim_object.cc b/sim/sim_object.cc index 5c8e3eb9b..b524d6075 100644 --- a/sim/sim_object.cc +++ b/sim/sim_object.cc @@ -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); } }