gem5 v24.0.0.0
|
Statistics container. More...
#include <group.hh>
Public Member Functions | |
Group (Group *parent, const char *name=nullptr) | |
Construct a new statistics group. | |
virtual | ~Group () |
virtual void | regStats () |
Callback to set stat parameters. | |
virtual void | resetStats () |
Callback to reset stats. | |
virtual void | preDumpStats () |
Callback before stats are dumped. | |
void | addStat (statistics::Info *info) |
Register a stat with this group. | |
const std::map< std::string, Group * > & | getStatGroups () const |
Get all child groups associated with this object. | |
const std::vector< Info * > & | getStats () const |
Get all stats associated with this object. | |
void | addStatGroup (const char *name, Group *block) |
Add a stat block as a child of this block. | |
const Info * | resolveStat (std::string name) const |
Resolve a stat by its name within this group. | |
void | mergeStatGroup (Group *block) |
Merge the contents (stats & children) of a block to this block. | |
Group ()=delete | |
Group (const Group &)=delete | |
Group & | operator= (const Group &)=delete |
Private Attributes | |
Group * | mergedParent |
Parent pointer if merged into parent. | |
std::map< std::string, Group * > | statGroups |
std::vector< Group * > | mergedStatGroups |
std::vector< Info * > | stats |
Statistics container.
A stat group is a hierarchical structure that contain statistics and other groups. Groups are used by the stat system to reflect gem5's SimObject hierarchy and to expose internal hierarchy within an object. They can also be used to conveniently group stats into their own class/struct and then be merged into the parent group (typically a SimObject).
void gem5::statistics::Group::mergeStatGroup | ( | Group * | block | ) |
Merge the contents (stats & children) of a block to this block.
This is called on a parent group by the child when it is being merged into the parent.
Definition at line 160 of file group.cc.
References addStat(), mergedParent, mergedStatGroups, panic_if, gem5::ArmISA::s, and stats.
Referenced by Group(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
const Info * gem5::statistics::Group::resolveStat | ( | std::string | name | ) | const |
Resolve a stat by its name within this group.
This method goes through the stats in this group and sub-groups and returns a pointer to the the stat that matches the provided name. The input name has to be relative to the name of this group. For example, if this group is the SimObject system.bigCluster.cpus and we want the stat system.bigCluster.cpus.ipc, the input param should be the string "ipc".
name | Name of the desired stat |
Definition at line 128 of file group.cc.
References gem5::MipsISA::g, mergedStatGroups, name(), statGroups, and stats.
Referenced by gem5::pybind_init_stats(), gem5::statistics::resolve(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
private |
Parent pointer if merged into parent.
Definition at line 216 of file group.hh.
Referenced by addStat(), and mergeStatGroup().
|
private |
Definition at line 219 of file group.hh.
Referenced by mergeStatGroup(), preDumpStats(), regStats(), resetStats(), and resolveStat().
|
private |
Definition at line 218 of file group.hh.
Referenced by addStatGroup(), getStatGroups(), preDumpStats(), regStats(), resetStats(), and resolveStat().
|
private |
Definition at line 220 of file group.hh.
Referenced by addStat(), getStats(), mergeStatGroup(), resetStats(), and resolveStat().