Hi Everyone

I have for a while been thinking about a few changes to the stat system. There 
are a couple of high-level goals I'd like to achieve:

  *   Make the SimObject hierarchy explicit in the stat system (i.e., get rid 
of name() + ".foo"). This makes stats less fragile and makes  it easier to 
enable hierarchical formats like XML/HDF5/JSON.
  *   Make it more convenient to split stats into a separate structure that can 
be bound to a SimObject. This makes the namespace cleaner and makes stat 
accesses a bit more obvious.
  *   Make it possible to build groups of stats in C++ that can be used in 
subcomponents in a SimObject (similar to what we do for checkpoint sections). 
This makes it easier to structure large components.
  *   Enable partial stat dumps. Some of our internal users have been asking 
for this since a full stat dump can be large.
  *   Enable better stat access from Python.

I have posted a proposal [1] that implements the first 3 points by introducing 
a new Stat::Group class. SimObjects inherit from Stat::Group and become their 
own statistic group. To avoid breaking every single SimObject, stats aren't 
required to live in a Stat::Group. Legacy stats live in a global namespace, 
legacy, namespace.

Based on the hierarchical stats, it's reasonably easy to implement partial stat 
dumps. I have posted a [2] proposal that adds an optional 'root' keyword 
argument to m5.stats.dump(). The biggest problem that can lead to surprising 
behaviour is that m5.stats.dump() can normally only be called once per tick.

The remaining 2 changes [3, 4] showcase the new features in the CommMonitor and 
TraceCPU. The CommMonitor is good example of a component where there is a 
significant reduction of boilerplate code (regStats() completely disappeared) 
due to the way new stats can be instantiated and bound in the constructor.

Looking forward to hearing you comments!

Cheers,
Andreas

[1] https://gem5-review.googlesource.com/c/public/gem5/+/19368
[2] https://gem5-review.googlesource.com/c/public/gem5/+/19369
[3] https://gem5-review.googlesource.com/c/public/gem5/+/19370
[4] https://gem5-review.googlesource.com/c/public/gem5/+/19371


IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to