gem5  v20.1.0.0
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Stats::Info Class Referenceabstract

#include <info.hh>

Inheritance diagram for Stats::Info:
Stats::DistInfo Stats::ScalarInfo Stats::SparseHistInfo Stats::Vector2dInfo Stats::VectorDistInfo Stats::VectorInfo Stats::InfoProxy< Stat, DistInfo > Stats::InfoProxy< Stat, ScalarInfo > Stats::ProxyInfo Stats::InfoProxy< Stat, SparseHistInfo > Stats::InfoProxy< Stat, Vector2dInfo > Stats::InfoProxy< Stat, VectorDistInfo > Stats::InfoProxy< Stat, VectorInfo > Stats::FormulaInfo

Public Member Functions

 Info ()
 
virtual ~Info ()
 
void setName (const std::string &name)
 Set the name of this statistic. More...
 
void setName (const Group *parent, const std::string &name)
 
void setSeparator (std::string _sep)
 
virtual bool check () const =0
 Check that this stat has been set up properly and is ready for use. More...
 
bool baseCheck () const
 
virtual void enable ()
 Enable the stat for use. More...
 
virtual void prepare ()=0
 Prepare the stat for dumping. More...
 
virtual void reset ()=0
 Reset the stat to the default state. More...
 
virtual bool zero () const =0
 
virtual void visit (Output &visitor)=0
 Visitor entry for outputing statistics data. More...
 

Static Public Member Functions

static bool less (Info *stat1, Info *stat2)
 Checks if the first stat's name is alphabetically less than the second. More...
 

Public Attributes

std::string name
 The name of the stat. More...
 
std::string desc
 The description of the stat. More...
 
Flags flags
 The formatting flags. More...
 
int precision
 The display precision. More...
 
const Infoprereq
 A pointer to a prerequisite Stat. More...
 
int id
 
const StorageParamsstorageParams
 

Static Public Attributes

static std::string separatorString = "::"
 The separator string used for vectors, dist, etc. More...
 
static int id_count = 0
 A unique stat ID for each stat in the simulator. More...
 

Detailed Description

Definition at line 69 of file info.hh.

Constructor & Destructor Documentation

◆ Info()

Stats::Info::Info ( )

Definition at line 159 of file statistics.cc.

References Debug::breakpoint(), Stats::debug_break_id, and id_count.

◆ ~Info()

Stats::Info::~Info ( )
virtual

Definition at line 167 of file statistics.cc.

Member Function Documentation

◆ baseCheck()

bool Stats::Info::baseCheck ( ) const

Definition at line 256 of file statistics.cc.

References cprintf(), Stats::display, flags, Stats::init, name, and panic.

Referenced by pybind_init_stats().

◆ check()

virtual bool Stats::Info::check ( ) const
pure virtual

Check that this stat has been set up properly and is ready for use.

Returns
true for success

Implemented in Stats::ProxyInfo.

Referenced by pybind_init_stats().

◆ enable()

void Stats::Info::enable ( )
virtual

Enable the stat for use.

Reimplemented in Stats::Vector2dInfo, Stats::VectorDistInfo, and Stats::VectorInfo.

Definition at line 278 of file statistics.cc.

Referenced by pybind_init_stats().

◆ less()

bool Stats::Info::less ( Info stat1,
Info stat2 
)
static

Checks if the first stat's name is alphabetically less than the second.

This function breaks names up at periods and considers each subname separately.

Parameters
stat1The first stat.
stat2The second stat.
Returns
stat1's name is alphabetically before stat2's

Definition at line 230 of file statistics.cc.

References ArmISA::i, name, and tokenize().

◆ prepare()

virtual void Stats::Info::prepare ( )
pure virtual

◆ reset()

virtual void Stats::Info::reset ( )
pure virtual

◆ setName() [1/2]

void Stats::Info::setName ( const Group parent,
const std::string &  name 
)

◆ setName() [2/2]

void Stats::Info::setName ( const std::string &  name)

Set the name of this statistic.

Referenced by Stats::DataWrap< SparseHistogram, SparseHistInfoProxy >::name().

◆ setSeparator()

void Stats::Info::setSeparator ( std::string  _sep)
inline

Definition at line 101 of file info.hh.

References separatorString.

◆ visit()

virtual void Stats::Info::visit ( Output visitor)
pure virtual

◆ zero()

virtual bool Stats::Info::zero ( ) const
pure virtual
Returns
true if this stat has a value and satisfies its requirement as a prereq

Implemented in Stats::ProxyInfo.

Referenced by Stats::Text::noOutput(), and pybind_init_stats().

Member Data Documentation

◆ desc

std::string Stats::Info::desc

The description of the stat.

Definition at line 77 of file info.hh.

Referenced by Stats::Hdf5::appendStat(), Stats::DistPrint::init(), Stats::SparseHistPrint::init(), pybind_init_stats(), and Stats::Text::visit().

◆ flags

Flags Stats::Info::flags

◆ id

int Stats::Info::id

Definition at line 89 of file info.hh.

Referenced by pybind_init_stats().

◆ id_count

int Stats::Info::id_count = 0
static

A unique stat ID for each stat in the simulator.

Can be used externally for lookups as well as for debugging.

Definition at line 88 of file info.hh.

Referenced by Info().

◆ name

std::string Stats::Info::name

◆ precision

int Stats::Info::precision

The display precision.

Definition at line 81 of file info.hh.

Referenced by Stats::DistPrint::init(), Stats::SparseHistPrint::init(), and Stats::Text::visit().

◆ prereq

const Info* Stats::Info::prereq

A pointer to a prerequisite Stat.

Definition at line 83 of file info.hh.

Referenced by Stats::Text::noOutput().

◆ separatorString

std::string Stats::Info::separatorString = "::"
static

The separator string used for vectors, dist, etc.

Definition at line 75 of file info.hh.

Referenced by Stats::DistPrint::init(), Stats::SparseHistPrint::init(), setSeparator(), and Stats::Text::visit().

◆ storageParams

const StorageParams* Stats::Info::storageParams

The documentation for this class was generated from the following files:

Generated on Wed Sep 30 2020 14:03:12 for gem5 by doxygen 1.8.17