gem5  v20.1.0.0
Classes | Public Member Functions | Private Attributes | List of all members
Stats::AvgSampleStor Class Reference

Templatized storage for distribution that calculates per tick mean and variance. More...

#include <statistics.hh>

Classes

struct  Params
 

Public Member Functions

 AvgSampleStor (Info *info)
 Create and initialize this storage. More...
 
void sample (Counter val, int number)
 Add a value to the distribution for the given number of times. More...
 
size_type size () const
 Return the number of entries, in this case 1. More...
 
bool zero () const
 Return true if no samples have been added. More...
 
void prepare (Info *info, DistData &data)
 
void reset (Info *info)
 Reset stat value to default. More...
 

Private Attributes

Counter sum
 Current total. More...
 
Counter squares
 Current sum of squares. More...
 

Detailed Description

Templatized storage for distribution that calculates per tick mean and variance.

Definition at line 1797 of file statistics.hh.

Constructor & Destructor Documentation

◆ AvgSampleStor()

Stats::AvgSampleStor::AvgSampleStor ( Info info)
inline

Create and initialize this storage.

Definition at line 1815 of file statistics.hh.

Member Function Documentation

◆ prepare()

void Stats::AvgSampleStor::prepare ( Info info,
DistData data 
)
inline

◆ reset()

void Stats::AvgSampleStor::reset ( Info info)
inline

Reset stat value to default.

Definition at line 1860 of file statistics.hh.

References squares, and sum.

◆ sample()

void Stats::AvgSampleStor::sample ( Counter  val,
int  number 
)
inline

Add a value to the distribution for the given number of times.

Update the running sum and sum of squares.

Parameters
valThe value to add.
numberThe number of times to add the value.

Definition at line 1826 of file statistics.hh.

References squares, sum, and X86ISA::val.

◆ size()

size_type Stats::AvgSampleStor::size ( ) const
inline

Return the number of entries, in this case 1.

Returns
1.

Definition at line 1836 of file statistics.hh.

◆ zero()

bool Stats::AvgSampleStor::zero ( ) const
inline

Return true if no samples have been added.

Returns
True if the sum is zero.

Definition at line 1842 of file statistics.hh.

References sum.

Member Data Documentation

◆ squares

Counter Stats::AvgSampleStor::squares
private

Current sum of squares.

Definition at line 1809 of file statistics.hh.

Referenced by prepare(), reset(), and sample().

◆ sum

Counter Stats::AvgSampleStor::sum
private

Current total.

Definition at line 1807 of file statistics.hh.

Referenced by prepare(), reset(), sample(), and zero().


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

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