gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 1517 of file statistics.hh.

Constructor & Destructor Documentation

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

Definition at line 1549 of file statistics.hh.

References reset().

Member Function Documentation

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

Definition at line 359 of file statistics.cc.

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

void Stats::HistStor::grow_convert ( )

Definition at line 315 of file statistics.cc.

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

Referenced by sample().

void Stats::HistStor::grow_out ( )

Definition at line 276 of file statistics.cc.

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

Referenced by sample().

void Stats::HistStor::grow_up ( )

Definition at line 337 of file statistics.cc.

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

Referenced by add(), and sample().

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

Reset stat value to default.

Definition at line 1642 of file statistics.hh.

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

Referenced by HistStor().

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 1566 of file statistics.hh.

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

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

Return the number of buckets in this distribution.

Returns
the number of buckets.

Definition at line 1601 of file statistics.hh.

References cvec.

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

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 1608 of file statistics.hh.

References samples.

Referenced by grow_out().

Member Data Documentation

Counter Stats::HistStor::bucket_size
private

The number of entries in each bucket.

Definition at line 1535 of file statistics.hh.

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

VCounter Stats::HistStor::cvec
private

Counter for each bucket.

Definition at line 1546 of file statistics.hh.

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

Counter Stats::HistStor::logs
private

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

Definition at line 1540 of file statistics.hh.

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

Counter Stats::HistStor::max_bucket
private

The maximum value to track.

Definition at line 1533 of file statistics.hh.

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

Counter Stats::HistStor::min_bucket
private

The minimum value to track.

Definition at line 1531 of file statistics.hh.

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

Counter Stats::HistStor::samples
private

The number of samples.

Definition at line 1544 of file statistics.hh.

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

Counter Stats::HistStor::squares
private

The sum of squares.

Definition at line 1542 of file statistics.hh.

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

Counter Stats::HistStor::sum
private

The current sum.

Definition at line 1538 of file statistics.hh.

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


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

Generated on Fri Jun 9 2017 13:04:39 for gem5 by doxygen 1.8.6