summaryrefslogtreecommitdiff
path: root/base/stats
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2004-07-22 21:31:35 -0400
committerNathan Binkert <binkertn@umich.edu>2004-07-22 21:31:35 -0400
commit552b9541808a76c8da570e918c14b1435570c6fb (patch)
treef32b2c90d8cbd4f1e832157304de6138fd09a92a /base/stats
parent2f973954ca9d55dd958571256b5b0d189d0eee5c (diff)
downloadgem5-552b9541808a76c8da570e918c14b1435570c6fb.tar.xz
more initial checking of stats
base/statistics.cc: add more checking to the stats stuff to make sure that things are set up correctly base/stats/statdb.cc: Check that bins are only registered once. --HG-- extra : convert_revision : b0eafe4f584a8587dc3bf48812c632531ca28cb6
Diffstat (limited to 'base/stats')
-rw-r--r--base/stats/statdb.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/base/stats/statdb.cc b/base/stats/statdb.cc
index eed3d6296..66871b9f7 100644
--- a/base/stats/statdb.cc
+++ b/base/stats/statdb.cc
@@ -51,6 +51,10 @@ find(void *stat)
void
regBin(MainBin *bin, const std::string &_name)
{
+ bin_list_t::iterator i, end = bins().end();
+ for (i = bins().begin(); i != end; ++i)
+ if ((*i)->name() == _name)
+ panic("re-registering bin %s", _name);
bins().push_back(bin);
DPRINTF(Stats, "registering %s\n", _name);
}