gem5  v21.0.1.0
Classes | Public Member Functions | Private Attributes | List of all members
Stats::SparseHistStor Class Reference

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

#include <storage.hh>

Classes

struct  Params
 The parameters for a sparse histogram stat. More...
 

Public Member Functions

 SparseHistStor (Info *info)
 
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, SparseHistData &data)
 
void reset (Info *info)
 Reset stat value to default. More...
 

Private Attributes

Counter samples
 Counter for number of samples. More...
 
MCounter cmap
 Counter for each bucket. More...
 

Detailed Description

Templatized storage and interface for a sparse histogram stat.

There is no actual limit on the number of buckets, and each of them has a size of 1, meaning that samples are individually recorded, and there is no need to keep track of the samples that occur in between two distant sampled values.

Definition at line 710 of file storage.hh.

Constructor & Destructor Documentation

◆ SparseHistStor()

Stats::SparseHistStor::SparseHistStor ( Info info)
inline

Definition at line 725 of file storage.hh.

References reset().

Member Function Documentation

◆ prepare()

void Stats::SparseHistStor::prepare ( Info info,
SparseHistData data 
)
inline

Definition at line 759 of file storage.hh.

References cmap, data, and samples.

Referenced by TEST().

◆ reset()

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

Reset stat value to default.

Definition at line 774 of file storage.hh.

References cmap, and samples.

Referenced by SparseHistStor(), and TEST().

◆ sample()

void Stats::SparseHistStor::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 736 of file storage.hh.

References cmap, samples, and X86ISA::val.

Referenced by TEST().

◆ size()

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

Return the number of buckets in this distribution.

Returns
the number of buckets.

Definition at line 746 of file storage.hh.

References cmap.

Referenced by TEST().

◆ zero()

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

Returns true if any calls to sample have been made.

Returns
True if any values have been sampled.

Definition at line 753 of file storage.hh.

References samples.

Referenced by TEST().

Member Data Documentation

◆ cmap

MCounter Stats::SparseHistStor::cmap
private

Counter for each bucket.

Definition at line 716 of file storage.hh.

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

◆ samples

Counter Stats::SparseHistStor::samples
private

Counter for number of samples.

Definition at line 714 of file storage.hh.

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


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

Generated on Tue Jun 22 2021 15:29:13 for gem5 by doxygen 1.8.17