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

Templatized storage and interface for a histogram stat. More...

#include <statistics.hh>

Classes

struct  Params
 The parameters for a distribution stat. More...
 

Public Member Functions

 HistStor (Info *info)
 
void grow_up ()
 
void grow_out ()
 
void grow_convert ()
 
void add (HistStor *)
 
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 buckets in this distribution. More...
 
bool zero () const
 Returns true if any calls to sample have been made. More...
 
void prepare (Info *info, DistData &data)
 
void reset (Info *info)
 Reset stat value to default. More...
 

Private Attributes

Counter min_bucket
 The minimum value to track. More...
 
Counter max_bucket
 The maximum value to track. More...
 
Counter bucket_size
 The number of entries in each bucket. More...
 
Counter sum
 The current sum. More...
 
Counter logs
 The sum of logarithm of each sample, used to compute geometric mean. More...
 
Counter squares
 The sum of squares. More...
 
Counter samples
 The number of samples. More...
 
VCounter cvec
 Counter for each bucket. More...
 

Detailed Description

Templatized storage and interface for a histogram stat.

Definition at line 1571 of file statistics.hh.

Constructor & Destructor Documentation

◆ HistStor()

Stats::HistStor::HistStor ( Info info)
inline

Definition at line 1603 of file statistics.hh.

References reset().

Member Function Documentation

◆ add()

void Stats::HistStor::add ( HistStor hs)

Definition at line 397 of file statistics.cc.

References bucket_size, cvec, grow_up(), ArmISA::i, logs, min_bucket, samples, size(), squares, and sum.

◆ grow_convert()

void Stats::HistStor::grow_convert ( )

Definition at line 353 of file statistics.cc.

References bucket_size, cvec, ArmISA::i, max_bucket, min_bucket, and size().

Referenced by sample().

◆ grow_out()

void Stats::HistStor::grow_out ( )

Definition at line 314 of file statistics.cc.

References bucket_size, cvec, ArmISA::i, max_bucket, min_bucket, size(), and zero().

Referenced by sample().

◆ grow_up()

void Stats::HistStor::grow_up ( )

Definition at line 375 of file statistics.cc.

References bucket_size, cvec, ArmISA::i, max_bucket, and size().

Referenced by add(), and sample().

◆ prepare()

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

◆ reset()

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

Reset stat value to default.

Definition at line 1696 of file statistics.hh.

References bucket_size, Stats::HistStor::Params::buckets, cvec, ArmISA::i, logs, max_bucket, min_bucket, samples, size(), squares, Stats::Info::storageParams, and sum.

Referenced by HistStor().

◆ sample()

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

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

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

Definition at line 1620 of file statistics.hh.

References bucket_size, cvec, grow_convert(), grow_out(), grow_up(), MipsISA::index, logs, max_bucket, min_bucket, samples, size(), squares, sum, and X86ISA::val.

◆ size()

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

Return the number of buckets in this distribution.

Returns
the number of buckets.

Definition at line 1655 of file statistics.hh.

References cvec.

Referenced by add(), grow_convert(), grow_out(), grow_up(), reset(), and sample().

◆ zero()

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

Returns true if any calls to sample have been made.

Returns
True if any values have been sampled.

Definition at line 1662 of file statistics.hh.

References samples.

Referenced by grow_out().

Member Data Documentation

◆ bucket_size

Counter Stats::HistStor::bucket_size
private

The number of entries in each bucket.

Definition at line 1589 of file statistics.hh.

Referenced by add(), grow_convert(), grow_out(), grow_up(), prepare(), reset(), and sample().

◆ cvec

VCounter Stats::HistStor::cvec
private

Counter for each bucket.

Definition at line 1600 of file statistics.hh.

Referenced by add(), grow_convert(), grow_out(), grow_up(), prepare(), reset(), sample(), and size().

◆ logs

Counter Stats::HistStor::logs
private

The sum of logarithm of each sample, used to compute geometric mean.

Definition at line 1594 of file statistics.hh.

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

◆ max_bucket

Counter Stats::HistStor::max_bucket
private

The maximum value to track.

Definition at line 1587 of file statistics.hh.

Referenced by grow_convert(), grow_out(), grow_up(), prepare(), reset(), and sample().

◆ min_bucket

Counter Stats::HistStor::min_bucket
private

The minimum value to track.

Definition at line 1585 of file statistics.hh.

Referenced by add(), grow_convert(), grow_out(), prepare(), reset(), and sample().

◆ samples

Counter Stats::HistStor::samples
private

The number of samples.

Definition at line 1598 of file statistics.hh.

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

◆ squares

Counter Stats::HistStor::squares
private

The sum of squares.

Definition at line 1596 of file statistics.hh.

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

◆ sum

Counter Stats::HistStor::sum
private

The current sum.

Definition at line 1592 of file statistics.hh.

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


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