gem5  v22.1.0.0
Classes | Public Member Functions | Private Attributes | List of all members
gem5::statistics::DistStor Class Reference

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

#include <storage.hh>

Classes

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

Public Member Functions

 DistStor (const StorageParams *const storage_params)
 
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 (const StorageParams *const storage_params, DistData &data)
 
void reset (const StorageParams *const storage_params)
 Reset stat value to default. More...
 

Private Attributes

Counter min_track
 The minimum value to track. More...
 
Counter max_track
 The maximum value to track. More...
 
Counter bucket_size
 The number of entries in each bucket. More...
 
Counter min_val
 The smallest value sampled. More...
 
Counter max_val
 The largest value sampled. More...
 
Counter underflow
 The number of values sampled less than min. More...
 
Counter overflow
 The number of values sampled more than max. More...
 
Counter sum
 The current sum. 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 distribution stat.

A distribution uses buckets to keep track of values within a given range. All other values, although accounted for on the overall calculations, are not tracked in buckets themselves; two special counters, underflow and overflow store the number of occurrences of such values.

Definition at line 233 of file storage.hh.

Constructor & Destructor Documentation

◆ DistStor()

gem5::statistics::DistStor::DistStor ( const StorageParams *const  storage_params)
inline

Definition at line 288 of file storage.hh.

References reset().

Member Function Documentation

◆ prepare()

void gem5::statistics::DistStor::prepare ( const StorageParams *const  storage_params,
DistData data 
)
inline

◆ reset()

void gem5::statistics::DistStor::reset ( const StorageParams *const  storage_params)
inline

◆ sample()

void gem5::statistics::DistStor::sample ( Counter  val,
int  number 
)

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 54 of file storage.cc.

References bucket_size, cvec, max_track, max_val, min_track, min_val, overflow, samples, squares, sum, underflow, and gem5::X86ISA::val.

Referenced by prepareCheckDistStor(), and TEST().

◆ size()

size_type gem5::statistics::DistStor::size ( ) const
inline

Return the number of buckets in this distribution.

Returns
the number of buckets.

Definition at line 305 of file storage.hh.

References cvec.

Referenced by reset(), and TEST().

◆ zero()

bool gem5::statistics::DistStor::zero ( ) const
inline

Returns true if any calls to sample have been made.

Returns
True if any values have been sampled.

Definition at line 312 of file storage.hh.

References samples.

Referenced by TEST().

Member Data Documentation

◆ bucket_size

Counter gem5::statistics::DistStor::bucket_size
private

The number of entries in each bucket.

Definition at line 241 of file storage.hh.

Referenced by reset(), and sample().

◆ cvec

VCounter gem5::statistics::DistStor::cvec
private

Counter for each bucket.

Definition at line 258 of file storage.hh.

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

◆ max_track

Counter gem5::statistics::DistStor::max_track
private

The maximum value to track.

Definition at line 239 of file storage.hh.

Referenced by reset(), and sample().

◆ max_val

Counter gem5::statistics::DistStor::max_val
private

The largest value sampled.

Definition at line 246 of file storage.hh.

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

◆ min_track

Counter gem5::statistics::DistStor::min_track
private

The minimum value to track.

Definition at line 237 of file storage.hh.

Referenced by reset(), and sample().

◆ min_val

Counter gem5::statistics::DistStor::min_val
private

The smallest value sampled.

Definition at line 244 of file storage.hh.

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

◆ overflow

Counter gem5::statistics::DistStor::overflow
private

The number of values sampled more than max.

Definition at line 250 of file storage.hh.

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

◆ samples

Counter gem5::statistics::DistStor::samples
private

The number of samples.

Definition at line 256 of file storage.hh.

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

◆ squares

Counter gem5::statistics::DistStor::squares
private

The sum of squares.

Definition at line 254 of file storage.hh.

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

◆ sum

Counter gem5::statistics::DistStor::sum
private

The current sum.

Definition at line 252 of file storage.hh.

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

◆ underflow

Counter gem5::statistics::DistStor::underflow
private

The number of values sampled less than min.

Definition at line 248 of file storage.hh.

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


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

Generated on Wed Dec 21 2022 10:24:27 for gem5 by doxygen 1.9.1