diff options
author | Nathan Binkert <binkertn@umich.edu> | 2003-11-22 15:07:53 -0500 |
---|---|---|
committer | Nathan Binkert <binkertn@umich.edu> | 2003-11-22 15:07:53 -0500 |
commit | d1e12b57ce06990a0daf9c295c688795bf62f7cf (patch) | |
tree | cbc42c6e5efbef4688c7a87577d7c6e166afebf1 /base/statistics.cc | |
parent | 92348c503ce04a34f2ed5f871f55fae995a71111 (diff) | |
download | gem5-d1e12b57ce06990a0daf9c295c688795bf62f7cf.tar.xz |
We only need to choose that we do want binning, or we don't.
no need for multiple bin classes. If multiple bins are needed, we
can always do it with ini type config instead.
kern/tru64/tru64_events.hh:
sim/system.cc:
sim/system.hh:
No more GenBin always use MainBin
--HG--
extra : convert_revision : 8c466f302324c33b59d47d0da04583b2517fc72c
Diffstat (limited to 'base/statistics.cc')
-rw-r--r-- | base/statistics.cc | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/base/statistics.cc b/base/statistics.cc index b08715162..94b8852f8 100644 --- a/base/statistics.cc +++ b/base/statistics.cc @@ -129,8 +129,8 @@ class Database typedef list<Stat *> list_t; typedef map<const Stat *, StatData *> map_t; - list<GenBin *> bins; - map<const GenBin *, std::string > bin_names; + list<MainBin *> bins; + map<const MainBin *, std::string > bin_names; list_t binnedStats; list_t allStats; @@ -148,7 +148,7 @@ class Database void reset(); void regStat(Stat *stat); StatData *print(Stat *stat); - void regBin(GenBin *bin, std::string name); + void regBin(MainBin *bin, std::string name); }; Database::Database() @@ -171,14 +171,14 @@ Database::dump(ostream &stream) } #endif //FS_MEASURE - list<GenBin *>::iterator j = bins.begin(); - list<GenBin *>::iterator bins_end=bins.end(); + list<MainBin *>::iterator j = bins.begin(); + list<MainBin *>::iterator bins_end=bins.end(); if (!bins.empty()) { ccprintf(stream, "PRINTING BINNED STATS\n"); while (j != bins_end) { (*j)->activate(); - map<const GenBin *, std::string>::const_iterator iter; + map<const MainBin *, std::string>::const_iterator iter; iter = bin_names.find(*j); if (iter == bin_names.end()) panic("a binned stat not found in names map!"); @@ -274,10 +274,10 @@ Database::reset() MainBin *orig = MainBin::curBin(); - list<GenBin *>::iterator bi = bins.begin(); - list<GenBin *>::iterator be = bins.end(); + list<MainBin *>::iterator bi = bins.begin(); + list<MainBin *>::iterator be = bins.end(); while (bi != be) { - GenBin *bin = *bi; + MainBin *bin = *bi; bin->activate(); i = allStats.begin(); @@ -308,7 +308,7 @@ Database::regStat(Stat *stat) } void -Database::regBin(GenBin *bin, std::string name) +Database::regBin(MainBin *bin, std::string name) { if (bin_names.find(bin) != bin_names.end()) panic("shouldn't register bin twice"); @@ -910,36 +910,35 @@ FancyDisplay(ostream &stream, const string &name, const string &desc, PrintOne(stream, total, "**Ignore: " + name + NAMESEP + "TOT", desc, precision, flags); } -BinBase::BinBase() - : mem(NULL), memsize(-1) +} // namespace Detail + +MainBin::MainBin(const std::string &name) + : _name(name), mem(NULL), memsize(-1) { + Detail::StatDB().regBin(this, name); } -BinBase::~BinBase() +MainBin::~MainBin() { if (mem) delete [] mem; } char * -BinBase::memory() +MainBin::memory(off_t off) { if (!mem) { mem = new char[memsize]; memset(mem, 0, memsize); } - return mem; -} + if (memsize == -1) + memsize = CeilPow2((size_t) offset()); -void -GenBin::regBin(GenBin *bin, std::string name) -{ - Detail::StatDB().regBin(bin, name); + assert(offset() <= size()); + return mem + off; } -} // namespace Detail - void check() { |