gem5  v21.1.0.2
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes | List of all members
gem5::statistics::Info Class Referenceabstract

#include <info.hh>

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

Public Member Functions

 Info ()
 
virtual ~Info ()
 
void setName (const std::string &name, bool old_style=true)
 Set the name of this statistic. More...
 
void setSeparator (std::string _sep)
 
StorageParams const * getStorageParams () const
 Getter for the storage params. More...
 
void setStorageParams (const StorageParams *const params)
 Setter for the storage params. More...
 
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...
 
const units::Baseunit = units::Unspecified::get()
 The unit 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
 

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...
 

Private Attributes

std::unique_ptr< const StorageParamsstorageParams
 

Detailed Description

Definition at line 80 of file info.hh.

Constructor & Destructor Documentation

◆ Info()

gem5::statistics::Info::Info ( )

Definition at line 72 of file info.cc.

References gem5::debug::breakpoint(), gem5::statistics::debug_break_id, and id_count.

◆ ~Info()

gem5::statistics::Info::~Info ( )
virtual

Definition at line 80 of file info.cc.

Member Function Documentation

◆ baseCheck()

bool gem5::statistics::Info::baseCheck ( ) const

Definition at line 173 of file info.cc.

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

Referenced by gem5::pybind_init_stats(), and TEST().

◆ check()

virtual bool gem5::statistics::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 TestInfo, and gem5::statistics::ProxyInfo.

Referenced by gem5::pybind_init_stats().

◆ enable()

void gem5::statistics::Info::enable ( )
virtual

Enable the stat for use.

Reimplemented in gem5::statistics::Vector2dInfo, gem5::statistics::VectorDistInfo, and gem5::statistics::VectorInfo.

Definition at line 195 of file info.cc.

Referenced by gem5::pybind_init_stats().

◆ getStorageParams()

StorageParams const * gem5::statistics::Info::getStorageParams ( ) const

◆ less()

bool gem5::statistics::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 147 of file info.cc.

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

Referenced by TEST().

◆ prepare()

virtual void gem5::statistics::Info::prepare ( )
pure virtual

◆ reset()

virtual void gem5::statistics::Info::reset ( )
pure virtual

◆ setName()

void gem5::statistics::Info::setName ( const std::string &  name,
bool  old_style = true 
)

Set the name of this statistic.

Special handling must be done when creating an old-style statistic (i.e., stats without a parent group).

Parameters
nameThe new name.
old_styleWhether we are using the old style.

Definition at line 128 of file info.cc.

References name, gem5::statistics::nameMap(), gem5::MipsISA::p, panic, panic_if, and gem5::statistics::validateStatName().

Referenced by gem5::statistics::DataWrap< Distribution, DistInfoProxy >::name(), and TEST().

◆ setSeparator()

void gem5::statistics::Info::setSeparator ( std::string  _sep)
inline

Definition at line 120 of file info.hh.

References separatorString.

Referenced by TEST().

◆ setStorageParams()

void gem5::statistics::Info::setStorageParams ( const StorageParams *const  params)

Setter for the storage params.

Definition at line 91 of file info.cc.

References storageParams.

Referenced by gem5::statistics::InfoAccess::setParams().

◆ visit()

virtual void gem5::statistics::Info::visit ( Output visitor)
pure virtual

◆ zero()

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

Implemented in TestInfo, and gem5::statistics::ProxyInfo.

Referenced by gem5::statistics::Text::noOutput(), and gem5::pybind_init_stats().

Member Data Documentation

◆ desc

std::string gem5::statistics::Info::desc

◆ flags

Flags gem5::statistics::Info::flags

◆ id

int gem5::statistics::Info::id

Definition at line 102 of file info.hh.

Referenced by gem5::pybind_init_stats(), and TEST().

◆ id_count

int gem5::statistics::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 101 of file info.hh.

Referenced by Info().

◆ name

std::string gem5::statistics::Info::name

◆ precision

int gem5::statistics::Info::precision

The display precision.

Definition at line 94 of file info.hh.

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

◆ prereq

const Info* gem5::statistics::Info::prereq

A pointer to a prerequisite Stat.

Definition at line 96 of file info.hh.

Referenced by gem5::statistics::Text::noOutput().

◆ separatorString

std::string gem5::statistics::Info::separatorString = "::"
static

The separator string used for vectors, dist, etc.

Definition at line 86 of file info.hh.

Referenced by gem5::statistics::DistPrint::init(), gem5::statistics::SparseHistPrint::init(), setSeparator(), TEST(), and gem5::statistics::Text::visit().

◆ storageParams

std::unique_ptr<const StorageParams> gem5::statistics::Info::storageParams
private

Definition at line 105 of file info.hh.

Referenced by getStorageParams(), and setStorageParams().

◆ unit

const units::Base* gem5::statistics::Info::unit = units::Unspecified::get()

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

Generated on Tue Sep 21 2021 12:32:29 for gem5 by doxygen 1.8.17