diff options
author | Joel Hestness <hestness@cs.wisc.edu> | 2013-04-09 16:25:29 -0500 |
---|---|---|
committer | Joel Hestness <hestness@cs.wisc.edu> | 2013-04-09 16:25:29 -0500 |
commit | b936619ab44de2ad51376737db9b8c9c6121e8ca (patch) | |
tree | 3b305867cc969a90823df3ff24d5480a094aa5a8 /src | |
parent | 88d34665d0db85d86b1e62388d0f34e296bf191f (diff) | |
download | gem5-b936619ab44de2ad51376737db9b8c9c6121e8ca.tar.xz |
Ruby: Order profilers based on version
When Ruby stats are printed for events and transitions, they include stats
for all of the controllers of the same type, but they are not necessarily
printed in order of the controller ID "version", because of the way the
profilers were added to the profiler vector. This patch fixes the push order
problem so that the stats are printed in ascending order 0->(# controllers),
so statistics parsers may correctly assume the controller to which the stats
belong.
Diffstat (limited to 'src')
-rw-r--r-- | src/mem/slicc/symbols/StateMachine.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py index af1435ae8..f650f5809 100644 --- a/src/mem/slicc/symbols/StateMachine.py +++ b/src/mem/slicc/symbols/StateMachine.py @@ -1346,7 +1346,9 @@ ${ident}_ProfileDumper::${ident}_ProfileDumper() void ${ident}_ProfileDumper::registerProfiler(${ident}_Profiler* profiler) { - m_profilers.push_back(profiler); + if (profiler->getVersion() >= m_profilers.size()) + m_profilers.resize(profiler->getVersion() + 1); + m_profilers[profiler->getVersion()] = profiler; } void @@ -1413,6 +1415,7 @@ class ${ident}_Profiler public: ${ident}_Profiler(); void setVersion(int version); + int getVersion(); void countTransition(${ident}_State state, ${ident}_Event event); void possibleTransition(${ident}_State state, ${ident}_Event event); uint64 getEventCount(${ident}_Event event); @@ -1462,6 +1465,12 @@ ${ident}_Profiler::setVersion(int version) m_version = version; } +int +${ident}_Profiler::getVersion() +{ + return m_version; +} + void ${ident}_Profiler::clearStats() { |