From 368de4109f9decca72faac1a6eb0909da712f43f Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 9 Dec 2003 13:05:43 -0500 Subject: Sweeping change in the stats package....again... base/statistics.cc: - Merge the m5 display and simplescalar compatible display functions. - Use functors for the stats printing instead of functions. This gets rid of the very long argument lists and improves clarity. - Fix a bug in binning that caused an invalid allocation to occur. base/statistics.hh: - Instead of using a compile time variable to choose whether to print in ss compat mode, we use a runtime variable. This is how we'll choose python output. - There are no more virtual functions in the statistics themselves. All virtual functions have been moved into a secondary helper class. Every stat has an associated helper class that knows how to access certain variables in that stat. There is a hash_map from the stat to it's helper class data. This was done because the helper data is only used during setup, stats reset, and printing. All of which happen rarely, and you want to avoid any performance hit that you can. - To provide the name(), desc(), etc functions to classes so that the user can set various parameters to the stats class, a single class containing all of those functions was created. An odd trick was done to actually make this class derive from the stat class because a base class with no data actually does end up taking up space. - The detail namespace was removed for now. I'll put it back when the package is not in so much flux. - Standard deviation, and mean were added to all distribution stats. - There are several bugfixes and changes that aren't mentioned test/Makefile: Don't test sim_stats foo. test/stattest.cc: Don't test sim_stats foo. Fix bin usage so that it corresponds to the current usage. --HG-- extra : convert_revision : ce8d9a8d485a84d55799f253d851e83650684170 --- test/Makefile | 3 +-- test/stattest.cc | 13 ++++++------- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'test') diff --git a/test/Makefile b/test/Makefile index 1502bca3d..29d252df4 100644 --- a/test/Makefile +++ b/test/Makefile @@ -52,8 +52,7 @@ offtest: offtest.o rangetest: rangetest.o str.o $(CXX) $(LFLAGS) -o $@ $^ -stattest: cprintf.o hostinfo.o misc.o sim_stats.o sim_time.o \ - statistics.o stattest.o str.o +stattest: cprintf.o hostinfo.o misc.o sim_time.o statistics.o stattest.o str.o $(CXX) $(LFLAGS) -o $@ $^ strnumtest: strnumtest.o str.o diff --git a/test/stattest.cc b/test/stattest.cc index 38a15900d..dea5295cc 100644 --- a/test/stattest.cc +++ b/test/stattest.cc @@ -35,7 +35,6 @@ #include "base/misc.hh" #include "base/statistics.hh" #include "sim/host.hh" -#include "sim/sim_stats.hh" using namespace std; using namespace Statistics; @@ -67,8 +66,8 @@ Formula f4; Formula f5; Formula f6; -MainBin bin1; -MainBin bin2; +MainBin bin1("bin1"); +MainBin bin2("bin2"); double testfunc() @@ -256,7 +255,7 @@ main(int argc, char *argv[]) check(); - MainBin::activate(bin1); + bin1.activate(); f1 = s1 + s2; f2 = (-s1) / (-s2) * -s3 + ULL(100) + s4; @@ -452,7 +451,7 @@ main(int argc, char *argv[]) s6.sample(8); s6.sample(9); - MainBin::activate(bin2); + bin2.activate(); s6.sample(10); s6.sample(10); s6.sample(10); @@ -493,12 +492,12 @@ main(int argc, char *argv[]) s12.sample(100); - MainBin::activate(bin1); + bin1.activate(); cout << "dump 1" << endl; dump(cout); cout << endl << endl; - MainBin::activate(bin2); + bin2.activate(); cout << "dump 2" << endl; dump(cout); cout << endl << endl; -- cgit v1.2.3