Go to the documentation of this file.
43 #include "debug/Stats.hh"
49 : mergedParent(nullptr)
53 }
else if (parent && !
name) {
73 so ?
so->name() :
"?",
90 g.second->resetStats();
100 g.second->preDumpStats();
106 stats.push_back(info);
115 "Stats of the same group share the same name `%s`.\n",
name);
123 auto pos =
name.find(
".");
124 if (pos == std::string::npos) {
126 for (
auto &info :
stats) {
127 if (info->name ==
name) {
133 const std::string gname =
name.substr(0, pos);
135 if (
g.first == gname) {
136 return g.second->resolveStat(
name.substr(pos + 1));
143 auto info =
g->resolveStat(
name);
155 panic_if(!block,
"No stat block provided");
157 "Stat group already merged into another group");
158 panic_if(block ==
this,
"Stat group can't merge with itself");
165 for (
auto &
s : block->
stats)
173 const std::map<std::string, Group *> &
virtual void regStats()
Callback to set stat parameters.
const std::map< std::string, Group * > & getStatGroups() const
Get all child groups associated with this object.
virtual void preDumpStats()
Callback before stats are dumped.
std::vector< Group * > mergedStatGroups
virtual void resetStats()
Callback to reset stats.
const Info * resolveStat(std::string name) const
Resolve a stat by its name within this group.
std::vector< Info * > stats
const std::string & name()
std::map< std::string, Group * > statGroups
Group * mergedParent
Parent pointer if merged into parent.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
void mergeStatGroup(Group *block)
Merge the contents (stats & children) of a block to this block.
const std::vector< Info * > & getStats() const
Get all stats associated with this object.
void addStat(Stats::Info *info)
Register a stat with this group.
void addStatGroup(const char *name, Group *block)
Add a stat block as a child of this block.
Abstract superclass for simulation objects.
Generated on Tue Mar 23 2021 19:41:24 for gem5 by doxygen 1.8.17