diff options
author | Nathan Binkert <binkertn@umich.edu> | 2003-12-24 01:45:56 -0500 |
---|---|---|
committer | Nathan Binkert <binkertn@umich.edu> | 2003-12-24 01:45:56 -0500 |
commit | fad8b13adde99c3759b30dc4b16d5031d3e468fa (patch) | |
tree | fecfb044f366c8c1ac338df690721751cf2f4ccc /base/statistics.hh | |
parent | 9908987f1578681d11e1d0e7ea1224faa52fb039 (diff) | |
download | gem5-fad8b13adde99c3759b30dc4b16d5031d3e468fa.tar.xz |
Random cleanup to make things work a bit better
base/statistics.cc:
- give an internal name to statistics that aren't printable
- speed up reset a tad
- Make sure that the original value of the current bin is restored properly
- check for the case where there are no subnames so we don't have an error
- check to make sure that the formula's root is set before accessing it
base/statistics.hh:
- clean up includes a bit
- deal with the case where there are no subnames
- get rid of remnants of FS_MEASURE stuff
--HG--
extra : convert_revision : 1e4338fc2b225647df47641b04c13b7046b2e114
Diffstat (limited to 'base/statistics.hh')
-rw-r--r-- | base/statistics.hh | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/base/statistics.hh b/base/statistics.hh index 2aeae9e7f..6fe14dc7f 100644 --- a/base/statistics.hh +++ b/base/statistics.hh @@ -46,23 +46,20 @@ #define __STATISTICS_HH__ #include <algorithm> +#include <cassert> +#include <cmath> #include <functional> #include <iosfwd> #include <sstream> #include <string> #include <vector> -#include <assert.h> - +#include "base/cprintf.hh" +#include "base/intmath.hh" #include "base/refcnt.hh" #include "base/str.hh" -#include "base/intmath.hh" -#include <math.h> #include "sim/host.hh" -#ifdef FS_MEASURE -#include "base/trace.hh" -#endif // // Un-comment this to enable weirdo-stat debugging // @@ -235,12 +232,14 @@ struct VectorDataBase : public StatData virtual result_t total() const = 0; virtual void update() { - int s = size(); - if (subnames.size() < s) - subnames.resize(s); + if (!subnames.empty()) { + int s = size(); + if (subnames.size() < s) + subnames.resize(s); - if (subdescs.size() < s) - subdescs.resize(s); + if (subdescs.size() < s) + subdescs.resize(s); + } } }; @@ -273,7 +272,6 @@ class VectorData : public VectorDataBase } }; - struct DistDataData { result_t min_val; @@ -2178,9 +2176,6 @@ struct MainBin activate() { setCurBin(this); -#ifdef FS_MEASURE - DPRINTF(TCPIP, "activating %s Bin\n", name()); -#endif } class BinBase |