gem5 v24.0.0.0
Loading...
Searching...
No Matches
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.
 
size_type size () const
 Return the number of buckets in this distribution.
 
bool zero () const
 Returns true if any calls to sample have been made.
 
void prepare (const StorageParams *const storage_params, DistData &data)
 
void reset (const StorageParams *const storage_params)
 Reset stat value to default.
 

Private Attributes

Counter min_track
 The minimum value to track.
 
Counter max_track
 The maximum value to track.
 
Counter bucket_size
 The number of entries in each bucket.
 
Counter min_val
 The smallest value sampled.
 
Counter max_val
 The largest value sampled.
 
Counter underflow
 The number of values sampled less than min.
 
Counter overflow
 The number of values sampled more than max.
 
Counter sum
 The current sum.
 
Counter squares
 The sum of squares.
 
Counter samples
 The number of samples.
 
VCounter cvec
 Counter for each bucket.
 

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 232 of file storage.hh.

Constructor & Destructor Documentation

◆ DistStor()

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

Definition at line 287 of file storage.hh.

References gem5::statistics::reset().

Member Function Documentation

◆ prepare()

◆ 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 53 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(), TEST(), TEST(), 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 304 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 311 of file storage.hh.

References samples.

Referenced by TEST(), and TEST().

Member Data Documentation

◆ bucket_size

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

The number of entries in each bucket.

Definition at line 240 of file storage.hh.

Referenced by reset(), and sample().

◆ cvec

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

Counter for each bucket.

Definition at line 257 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 238 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 245 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 236 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 243 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 249 of file storage.hh.

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

◆ samples

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

The number of samples.

Definition at line 255 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 253 of file storage.hh.

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

◆ sum

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

The current sum.

Definition at line 251 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 247 of file storage.hh.

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


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

Generated on Tue Jun 18 2024 16:24:23 for gem5 by doxygen 1.11.0