stats: Fix some bugs in the python based stats system
Review Request #1676 - Created Jan. 28, 2013 and updated
| Information | |
|---|---|
| Andreas Hansson | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 9705:bfac87aa5771 --------------------------- stats: Fix some bugs in the python based stats system This patch fixes assorted bugs in the python stats system. The following bugs are addressed: The text-based stats output now overwrites the output stats file if it exists on the first stats dump. If it does not exist, it is created. The file is appended to on subsequent stats dumps. This mimics the operation of the C++ based stats system. The total for a vector stat was not being calculated correctly as it was calculating the sum of values including NaN and therefore any vector which included a NaN summed to NaN. This operatino was not desited as the old C++ based stats system ignored NaN values when calculating the total. The total function in info now checks to see if the stat is a scalar or a vector, and returns the corresponding total. Scalars and ScalarValues now have a length, mimicing the functionality already found in Vector stats. This patch also addresses a typo in the code for VectorDist, and a typo in the definition of a Value.
Posted (Feb. 5, 2013, 7:07 a.m.)
-
src/python/m5/stats/__init__.py (Diff revision 1) -
You only need global if you write dumpCount
-
src/python/m5/stats/__init__.py (Diff revision 1) -
I'd much prefer to see only the mode inside the if statement mode = 'w' if dumpCount == 0 else 'a' f = m5.core.openOutputFile(self.filename, mode)
-
src/python/m5/stats/display.py (Diff revision 1) -
Get rid of this import
-
src/python/m5/stats/info.py (Diff revision 1) -
Seems like this doesn't belong.
-
src/python/m5/stats/info.py (Diff revision 1) -
might be faster/cleaner to do something like this: val = value(stat) try: return sum(val) except TypeError: return val -
src/python/m5/stats/info.py (Diff revision 1) -
return is not a function
Review request changed
Updated (April 23, 2013, 8:20 p.m.)
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+38 -8) |
