gem5  v20.1.0.0
Classes | Typedefs | Enumerations | Functions | Variables
Stats Namespace Reference

Classes

class  Average
 A stat that calculates the per tick average of a value. More...
 
class  AverageDeviation
 Calculates the per tick mean and variance of the samples. More...
 
class  AverageVector
 A vector of Average stats. More...
 
class  AvgSampleStor
 Templatized storage for distribution that calculates per tick mean and variance. More...
 
class  AvgStor
 Templatized storage and interface to a per-tick average stat. More...
 
class  BinaryNode
 
class  ConstNode
 
class  ConstVectorNode
 
class  DataWrap
 
class  DataWrapVec
 
class  DataWrapVec2d
 
class  DistBase
 Implementation of a distribution stat. More...
 
struct  DistData
 
class  DistInfo
 
class  DistInfoProxy
 
struct  DistParams
 The parameters for a distribution stat. More...
 
struct  DistPrint
 
class  DistProxy
 
class  Distribution
 A simple distribution stat. More...
 
class  DistStor
 Templatized storage and interface for a distribution stat. More...
 
class  Formula
 A formula for statistics that is calculated when printed. More...
 
class  FormulaInfo
 
class  FormulaInfoProxy
 
class  FormulaNode
 
class  FunctorProxy
 
struct  Global
 
class  Group
 Statistics container. More...
 
class  Hdf5
 
class  Histogram
 A simple histogram stat. More...
 
class  HistStor
 Templatized storage and interface for a histogram stat. More...
 
class  Info
 
class  InfoAccess
 
class  InfoProxy
 
class  MethodProxy
 A proxy similar to the FunctorProxy, but allows calling a method of a bound object, instead of a global free-standing function. More...
 
class  Node
 Base class for formula statistic node. More...
 
struct  OpString
 
struct  OpString< std::divides< Result > >
 
struct  OpString< std::minus< Result > >
 
struct  OpString< std::modulus< Result > >
 
struct  OpString< std::multiplies< Result > >
 
struct  OpString< std::negate< Result > >
 
struct  OpString< std::plus< Result > >
 
struct  Output
 
class  ProxyInfo
 
class  SampleStor
 Templatized storage and interface for a distribution that calculates mean and variance. More...
 
class  Scalar
 This is a simple scalar statistic, like a counter. More...
 
class  ScalarBase
 Implementation of a scalar stat. More...
 
class  ScalarInfo
 
class  ScalarInfoProxy
 
struct  ScalarPrint
 
class  ScalarProxy
 A proxy class to access the stat at a given index in a VectorBase stat. More...
 
class  ScalarProxyNode
 
class  ScalarStatNode
 
class  SparseHistBase
 Implementation of a sparse histogram stat. More...
 
struct  SparseHistData
 Data structure of sparse histogram. More...
 
class  SparseHistInfo
 
class  SparseHistInfoProxy
 
class  SparseHistogram
 
struct  SparseHistPrint
 
class  SparseHistStor
 Templatized storage and interface for a sparse histogram stat. More...
 
class  StandardDeviation
 Calculates the mean and variance of all the samples. More...
 
class  StatEvent
 Event to dump and/or reset the statistics. More...
 
class  StatStor
 Templatized storage and interface for a simple scalar stat. More...
 
struct  StorageParams
 
class  SumNode
 
class  Temp
 Helper class to construct formula node trees. More...
 
class  Text
 
class  UnaryNode
 
class  Value
 
class  ValueBase
 
class  ValueProxy
 
class  Vector
 A vector of scalar stats. More...
 
class  Vector2d
 A 2-Dimensional vecto of scalar stats. More...
 
class  Vector2dBase
 
class  Vector2dInfo
 
class  Vector2dInfoProxy
 
class  VectorAverageDeviation
 This is a vector of AverageDeviation stats. More...
 
class  VectorBase
 Implementation of a vector of stats. More...
 
class  VectorDistBase
 
class  VectorDistInfo
 
class  VectorDistInfoProxy
 
class  VectorDistribution
 A vector of distributions. More...
 
class  VectorInfo
 
class  VectorInfoProxy
 
struct  VectorPrint
 
class  VectorProxy
 
class  VectorStandardDeviation
 This is a vector of StandardDeviation stats. More...
 
class  VectorStatNode
 

Typedefs

typedef std::shared_ptr< NodeNodePtr
 Shared pointer to a function Node. More...
 
typedef void(* Handler) ()
 Register reset and dump handlers. More...
 
typedef std::map< const void *, Info * > MapType
 
typedef std::map< std::string, Info * > NameMapType
 
typedef uint16_t FlagsType
 
typedef ::Flags< FlagsTypeFlags
 
typedef double Counter
 All counters are of 64-bit values. More...
 
typedef std::vector< CounterVCounter
 vector of counters. More...
 
typedef std::map< Counter, int > MCounter
 map of counters More...
 
typedef std::numeric_limits< CounterCounterLimits
 
typedef double Result
 All results are doubles. More...
 
typedef std::vector< ResultVResult
 vector of results. More...
 
typedef unsigned int size_type
 
typedef unsigned int off_type
 

Enumerations

enum  DistType { Deviation, Dist, Hist }
 

Functions

list< Info * > & statsList ()
 
MapTypestatsMap ()
 
NameMapTypenameMap ()
 
bool validateStatName (const string &name)
 
void registerHandlers (Handler reset_handler, Handler dump_handler)
 
void processResetQueue ()
 Process all the callbacks in the reset callbacks queue. More...
 
void processDumpQueue ()
 Process all the callbacks in the dump callbacks queue. More...
 
void registerResetCallback (const std::function< void()> &callback)
 Register a callback that should be called whenever statistics are reset. More...
 
bool enabled ()
 
void enable ()
 
void dump ()
 Dump all statistics data to the registered outputs. More...
 
void reset ()
 
const Inforesolve (const std::string &name)
 
void registerDumpCallback (const std::function< void()> &callback)
 Register a callback that should be called whenever statistics are about to be dumped. More...
 
Temp operator+ (Temp l, Temp r)
 
Temp operator- (Temp l, Temp r)
 
Temp operator* (Temp l, Temp r)
 
Temp operator/ (Temp l, Temp r)
 
Temp operator- (Temp l)
 
template<typename T >
Temp constant (T val)
 
template<typename T >
Temp constantVector (T val)
 
Temp sum (Temp val)
 
bool validateStatName (const std::string &name)
 
std::unique_ptr< OutputinitHDF5 (const std::string &filename, unsigned chunking, bool desc, bool formulas)
 
string ValueToString (Result value, int precision)
 
OutputinitText (const string &filename, bool desc, bool spaces)
 
OutputinitText (const std::string &filename, bool desc, bool spaces)
 
void pythonDump ()
 
void pythonReset ()
 
double statElapsedTime ()
 
Tick statElapsedTicks ()
 
Tick statFinalTick ()
 
void initSimStats ()
 
void schedStatEvent (bool dump, bool reset, Tick when=curTick(), Tick repeat=0)
 Schedule statistics dumping. More...
 
void periodicStatDump (Tick period=0)
 Schedule periodic statistics dumping. More...
 
void updateEvents ()
 Update the events after resuming from a checkpoint. More...
 
void registerPythonStatsHandlers ()
 Register py_... More...
 

Variables

int debug_break_id = -1
 
Handler resetHandler = NULL
 
Handler dumpHandler = NULL
 
CallbackQueue dumpQueue
 
CallbackQueue resetQueue
 
bool _enabled = false
 
const FlagsType none = 0x0000
 Nothing extra to print. More...
 
const FlagsType init = 0x0001
 This Stat is Initialized. More...
 
const FlagsType display = 0x0002
 Print this stat. More...
 
const FlagsType total = 0x0010
 Print the total. More...
 
const FlagsType pdf = 0x0020
 Print the percent of the total that this entry represents. More...
 
const FlagsType cdf = 0x0040
 Print the cumulative percentage of total upto this entry. More...
 
const FlagsType dist = 0x0080
 Print the distribution. More...
 
const FlagsType nozero = 0x0100
 Don't print if this is zero. More...
 
const FlagsType nonan = 0x0200
 Don't print if this is NAN. More...
 
const FlagsType oneline = 0x0400
 Print all values on a single line. More...
 
const FlagsType __reserved = init | display
 Mask of flags that can't be set directly. More...
 
Time statTime (true)
 
Tick startTick
 
GlobalEventdumpEvent
 

Typedef Documentation

◆ Counter

typedef double Stats::Counter

All counters are of 64-bit values.

Definition at line 41 of file types.hh.

◆ CounterLimits

typedef std::numeric_limits<Counter> Stats::CounterLimits

Definition at line 47 of file types.hh.

◆ Flags

Definition at line 40 of file info.hh.

◆ FlagsType

typedef uint16_t Stats::FlagsType

Definition at line 37 of file info.hh.

◆ Handler

typedef void(* Stats::Handler) ()

Register reset and dump handlers.

These are the functions which will actually perform the whole statistics reset/dump actions including processing the reset/dump callbacks

Definition at line 3387 of file statistics.hh.

◆ MapType

typedef std::map<const void *, Info *> Stats::MapType

Definition at line 3415 of file statistics.hh.

◆ MCounter

typedef std::map<Counter, int> Stats::MCounter

map of counters

Definition at line 45 of file types.hh.

◆ NameMapType

typedef std::map<std::string, Info *> Stats::NameMapType

Definition at line 3418 of file statistics.hh.

◆ NodePtr

typedef std::shared_ptr<Node> Stats::NodePtr

Shared pointer to a function Node.

Definition at line 2154 of file statistics.hh.

◆ off_type

typedef unsigned int Stats::off_type

Definition at line 55 of file types.hh.

◆ Result

typedef double Stats::Result

All results are doubles.

Definition at line 50 of file types.hh.

◆ size_type

typedef unsigned int Stats::size_type

Definition at line 54 of file types.hh.

◆ VCounter

vector of counters.

Definition at line 43 of file types.hh.

◆ VResult

vector of results.

Definition at line 52 of file types.hh.

Enumeration Type Documentation

◆ DistType

Enumerator
Deviation 
Dist 
Hist 

Definition at line 173 of file info.hh.

Function Documentation

◆ constant()

template<typename T >
Temp Stats::constant ( val)
inline

◆ constantVector()

template<typename T >
Temp Stats::constantVector ( val)
inline

Definition at line 3364 of file statistics.hh.

References X86ISA::val.

◆ dump()

void Stats::dump ( )

◆ enable()

void Stats::enable ( )

Definition at line 551 of file statistics.cc.

References _enabled, and fatal.

Referenced by pybind_init_stats().

◆ enabled()

bool Stats::enabled ( )

◆ initHDF5()

std::unique_ptr< Output > Stats::initHDF5 ( const std::string &  filename,
unsigned  chunking,
bool  desc,
bool  formulas 
)

Definition at line 316 of file hdf5.cc.

References OutputDirectory::resolve(), and simout.

Referenced by pybind_init_stats().

◆ initSimStats()

void Stats::initSimStats ( )

Definition at line 197 of file stat_control.cc.

Referenced by pybind_init_stats().

◆ initText() [1/2]

Output* Stats::initText ( const std::string &  filename,
bool  desc,
bool  spaces 
)

◆ initText() [2/2]

Output* Stats::initText ( const string &  filename,
bool  desc,
bool  spaces 
)

◆ nameMap()

NameMapType & Stats::nameMap ( )

Definition at line 149 of file statistics.cc.

Referenced by Loader::SymbolTable::clear(), Loader::SymbolTable::insert(), and resolve().

◆ operator*()

Temp Stats::operator* ( Temp  l,
Temp  r 
)
inline

Definition at line 3338 of file statistics.hh.

References MipsISA::l, and MipsISA::r.

◆ operator+()

Temp Stats::operator+ ( Temp  l,
Temp  r 
)
inline

Definition at line 3326 of file statistics.hh.

References MipsISA::l, and MipsISA::r.

◆ operator-() [1/2]

Temp Stats::operator- ( Temp  l)
inline

Definition at line 3350 of file statistics.hh.

References MipsISA::l.

◆ operator-() [2/2]

Temp Stats::operator- ( Temp  l,
Temp  r 
)
inline

Definition at line 3332 of file statistics.hh.

References MipsISA::l, and MipsISA::r.

◆ operator/()

Temp Stats::operator/ ( Temp  l,
Temp  r 
)
inline

Definition at line 3344 of file statistics.hh.

References MipsISA::l, and MipsISA::r.

◆ periodicStatDump()

void Stats::periodicStatDump ( Tick  period = 0)

Schedule periodic statistics dumping.

This allows you to dump and reset the built-in statistics on a regular basis, thereby allowing the extraction of temporal trends in the data.

Parameters
periodThe period at which the dumping should occur.

Definition at line 247 of file stat_control.cc.

References curTick(), BaseGlobalEvent::deschedule(), dumpEvent, schedStatEvent(), and BaseGlobalEvent::scheduled().

Referenced by pybind_init_stats().

◆ processDumpQueue()

void Stats::processDumpQueue ( )

Process all the callbacks in the dump callbacks queue.

Definition at line 531 of file statistics.cc.

References dumpQueue, and CallbackQueue::process().

Referenced by pybind_init_stats().

◆ processResetQueue()

void Stats::processResetQueue ( )

Process all the callbacks in the reset callbacks queue.

Definition at line 525 of file statistics.cc.

References CallbackQueue::process(), and resetQueue.

Referenced by pybind_init_stats().

◆ pythonDump()

void Stats::pythonDump ( )

Definition at line 79 of file stats.cc.

References ArmISA::m.

Referenced by registerPythonStatsHandlers().

◆ pythonReset()

void Stats::pythonReset ( )

Definition at line 86 of file stats.cc.

References ArmISA::m.

Referenced by registerPythonStatsHandlers().

◆ registerDumpCallback()

void Stats::registerDumpCallback ( const std::function< void()> &  callback)

Register a callback that should be called whenever statistics are about to be dumped.

Definition at line 589 of file statistics.cc.

References dumpQueue.

Referenced by AbstractController::AbstractController(), Network::Network(), and RubySystem::RubySystem().

◆ registerHandlers()

void Stats::registerHandlers ( Handler  reset_handler,
Handler  dump_handler 
)

Definition at line 515 of file statistics.cc.

References dumpHandler, and resetHandler.

Referenced by registerPythonStatsHandlers().

◆ registerPythonStatsHandlers()

void Stats::registerPythonStatsHandlers ( )

Register py_...

functions as the statistics handlers

Definition at line 48 of file stat_register.cc.

References pythonDump(), pythonReset(), and registerHandlers().

Referenced by pybind_init_stats().

◆ registerResetCallback()

void Stats::registerResetCallback ( const std::function< void()> &  callback)

Register a callback that should be called whenever statistics are reset.

Definition at line 537 of file statistics.cc.

References resetQueue.

Referenced by FunctionProfile::FunctionProfile(), Stats::Global::Global(), and MemFootprintProbe::regStats().

◆ reset()

void Stats::reset ( )

◆ resolve()

const Info * Stats::resolve ( const std::string &  name)

Definition at line 578 of file statistics.cc.

References name(), nameMap(), Stats::Group::resolveStat(), and Root::root().

Referenced by MathExprPowerModel::startup().

◆ schedStatEvent()

void Stats::schedStatEvent ( bool  dump,
bool  reset,
Tick  when = curTick(),
Tick  repeat = 0 
)

Schedule statistics dumping.

This allows you to dump and/or reset the built-in statistics. This can either be done once, or it can be done on a regular basis.

Parameters
dumpSet true to dump the statistics.
resetSet true to reset the statistics.
whenWhen the dump and/or reset should occur.
repeatHow often the event should repeat. Set 0 to disable repeating.

Definition at line 237 of file stat_control.cc.

References dump(), dumpEvent, reset(), and simQuantum.

Referenced by doSimLoop(), PseudoInst::dumpresetstats(), PseudoInst::dumpstats(), periodicStatDump(), ArmISA::DumpStats::process(), Stats::StatEvent::process(), pybind_init_stats(), and PseudoInst::resetstats().

◆ statElapsedTicks()

Tick Stats::statElapsedTicks ( )

Definition at line 84 of file stat_control.cc.

References curTick(), and startTick.

Referenced by Stats::Global::Global().

◆ statElapsedTime()

double Stats::statElapsedTime ( )

Definition at line 74 of file stat_control.cc.

References Time::setTimer(), and statTime.

Referenced by Stats::Global::Global().

◆ statFinalTick()

Tick Stats::statFinalTick ( )

Definition at line 90 of file stat_control.cc.

References curTick().

Referenced by Stats::Global::Global().

◆ statsList()

std::list< Info * > & Stats::statsList ( )

Definition at line 67 of file statistics.cc.

Referenced by pybind_init_stats(), and Stats::InfoAccess::setInfo().

◆ statsMap()

MapType & Stats::statsMap ( )

Definition at line 74 of file statistics.cc.

Referenced by Stats::InfoAccess::info(), and Stats::InfoAccess::setInfo().

◆ sum()

Temp Stats::sum ( Temp  val)
inline

Definition at line 3370 of file statistics.hh.

References X86ISA::val.

◆ updateEvents()

void Stats::updateEvents ( )

Update the events after resuming from a checkpoint.

When resuming from a checkpoint, curTick will be updated, and any already scheduled events can end up scheduled in the past. This function checks if the dumpEvent is scheduled in the past, and reschedules it appropriately.

Definition at line 277 of file stat_control.cc.

References curTick(), dumpEvent, BaseGlobalEvent::reschedule(), BaseGlobalEvent::scheduled(), and BaseGlobalEvent::when().

Referenced by pybind_init_stats().

◆ validateStatName() [1/2]

bool Stats::validateStatName ( const std::string &  name)

◆ validateStatName() [2/2]

bool Stats::validateStatName ( const string &  name)

Definition at line 172 of file statistics.cc.

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

◆ ValueToString()

std::string Stats::ValueToString ( Result  value,
int  precision 
)

Definition at line 203 of file text.cc.

References X86ISA::val.

Referenced by Stats::ScalarPrint::operator()().

Variable Documentation

◆ __reserved

const FlagsType Stats::__reserved = init | display

Mask of flags that can't be set directly.

Definition at line 64 of file info.hh.

◆ _enabled

bool Stats::_enabled = false

Definition at line 542 of file statistics.cc.

Referenced by enable(), and enabled().

◆ cdf

const FlagsType Stats::cdf = 0x0040

Print the cumulative percentage of total upto this entry.

Definition at line 53 of file info.hh.

Referenced by Stats::VectorPrint::operator()().

◆ debug_break_id

int Stats::debug_break_id = -1

Definition at line 157 of file statistics.cc.

Referenced by Stats::Info::Info().

◆ display

const FlagsType Stats::display = 0x0002

◆ dist

const FlagsType Stats::dist = 0x0080

◆ dumpEvent

GlobalEvent* Stats::dumpEvent

Definition at line 71 of file stat_control.cc.

Referenced by periodicStatDump(), schedStatEvent(), and updateEvents().

◆ dumpHandler

Handler Stats::dumpHandler = NULL

Definition at line 512 of file statistics.cc.

Referenced by dump(), and registerHandlers().

◆ dumpQueue

CallbackQueue Stats::dumpQueue

Definition at line 521 of file statistics.cc.

Referenced by processDumpQueue(), and registerDumpCallback().

◆ init

const FlagsType Stats::init = 0x0001

◆ nonan

const FlagsType Stats::nonan = 0x0200

◆ none

const FlagsType Stats::none = 0x0000

◆ nozero

const FlagsType Stats::nozero = 0x0100

◆ oneline

const FlagsType Stats::oneline = 0x0400

Print all values on a single line.

Useful only for histograms.

Definition at line 61 of file info.hh.

Referenced by Stats::VectorPrint::operator()(), Stats::DistPrint::operator()(), Profiler::regStats(), GarnetNetwork::regStats(), Shader::regStats(), and ComputeUnit::regStats().

◆ pdf

const FlagsType Stats::pdf = 0x0020

◆ resetHandler

Handler Stats::resetHandler = NULL

Definition at line 511 of file statistics.cc.

Referenced by registerHandlers(), and reset().

◆ resetQueue

CallbackQueue Stats::resetQueue

Definition at line 522 of file statistics.cc.

Referenced by processResetQueue(), and registerResetCallback().

◆ startTick

Tick Stats::startTick

Definition at line 69 of file stat_control.cc.

Referenced by Stats::Global::Global(), and statElapsedTicks().

◆ statTime

Time Stats::statTime(true)

◆ total

const FlagsType Stats::total = 0x0010

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