stats: organize and clarify resettable stats
Review Request #3235 - Created Nov. 23, 2015 and updated
| Information | |
|---|---|
| Lena Olson | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 11230:374d79447577 --------------------------- stats: organize and clarify resettable stats Some stats (e.g. sim_insts) were traditionally not reset, because they were intended for simulator-level measurement. However, some other stats (e.g. sim_ticks) WERE reset. In addition, some derived stats used both reset and unreset stats in the calculation, resulting in nonsense values. This patch creates two sets of overall stats: one set that respects reset, and is useful for measuring the simulated program, and one set that does not reset, useful for studying the simulator itself. The non-resettable stats are prefixed with "simulator_", as they behave different from other stats.
Issue Summary
| Description | From | Last Updated | Status |
|---|---|---|---|
| We should probably check with Andreas Sandberg on this one. It looks like ctrInsts is already a cummulative stat for ... | Joel Hestness | Jan. 11, 2016, 3:52 p.m. | Open |
| I'm hoping that we could use stat names that are a little more self-evident for these. Maybe instead of 'simulatorXxxx'/'simulator_xxxx' ... | Joel Hestness | Jan. 11, 2016, 3:52 p.m. | Open |
Traditionally, it's not reset, as it accounting for all instructions executed. Perhaps hostSeconds shouldn't be reset as well and then the calculation would be correct? sim_insts isn't supposed to be used for anything other than simulator level measurement. If you want instructions executed on a cpu you should look at cpu.numInsts.
Change Summary:
Here's an attempt at duplicating and splitting up the stats. I had trouble deciding what to call things or how to make it clear which stats were which, so if anyone has better ideas of how to do that, I'd be happy to hear them.
Summary: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 2 (+238 -12) |
The implementation here looks good. Thanks for putting this together!
Just a couple small requests below.
-
src/cpu/kvm/base.cc (Diff revision 2) -
We should probably check with Andreas Sandberg on this one. It looks like ctrInsts is already a cummulative stat for the KVM CPU. This might be required by the KVM CPU for fast-forwarding correctness? This could cause changes in KVM correctness and/or regressions (if any are maintained). Hopefully, it is harmless to allow the stat to reset, though?
-
src/cpu/minor/cpu.cc (Diff revision 2) -
Just a note that this is interesting... looks like this fixes an inconsistency: MinorCPU appears to collect inst stats cummulatively, while the other CPUs use resettable stats (another indicator that this patch will help with clarity!)
-
src/sim/stat_control.cc (Diff revision 2) -
I'm hoping that we could use stat names that are a little more self-evident for these. Maybe instead of 'simulatorXxxx'/'simulator_xxxx' we could use something like 'cummulativeSimXxxx'/'cumm_sim_xxxx'? That way the names more clearly indicate that the stats are accumulated throughout the whole simulation time rather than just the current stats period.
I do like that the descriptions say "not reset" also.
I'm glad you've taken the time to figure out what all these stats actually do. I like the direction, but a couple of comments.
First, can you add more comments to the code. Similar to what's in o3/cpu.hh. It would be good if this was at least in all of the .hh files, maybe in the .cc files too. Related to my next comment, but if the names aren't obvious, they should at least be very well commented.
Second, these names make no sense to me. Why are "sim*" reset and "simulator*" not reset? Isn't "sim" short for "simulator" or "simulation"?
My suggestion: For statitics that are reset every time, have no prefix at all so there would be
ticks,instructions, etc. We already know the came from a simulator/simulation.
For the statistics that don't reset you could call them "total*" (i.e.,totalTicks,totalInsts).
And I thinkfinalTicksis fine as it is with its extra comments.
