gem5 v24.0.0.0
|
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. | |
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.
|
inline |
Definition at line 287 of file storage.hh.
References gem5::statistics::reset().
|
inline |
Definition at line 317 of file storage.hh.
References gem5::statistics::DistStor::Params::bucket_size, gem5::statistics::DistStor::Params::buckets, cvec, data, gem5::statistics::Dist, gem5::ArmISA::i, gem5::statistics::DistStor::Params::max, max_val, gem5::statistics::DistStor::Params::min, min_val, overflow, gem5::safe_cast(), samples, squares, sum, gem5::statistics::DistParams::type, and underflow.
Referenced by prepareCheckDistStor(), TEST(), and TEST().
|
inline |
Reset stat value to default.
Definition at line 345 of file storage.hh.
References bucket_size, gem5::statistics::DistStor::Params::bucket_size, cvec, gem5::ArmISA::i, gem5::statistics::DistStor::Params::max, max_track, max_val, gem5::statistics::DistStor::Params::min, min_track, min_val, overflow, gem5::safe_cast(), samples, size(), squares, sum, and underflow.
void gem5::statistics::DistStor::sample | ( | Counter | val, |
int | number ) |
Add a value to the distribution for the given number of times.
val | The value to add. |
number | The 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().
|
inline |
Return the number of buckets in this distribution.
Definition at line 304 of file storage.hh.
References cvec.
|
inline |
Returns true if any calls to sample have been made.
Definition at line 311 of file storage.hh.
References samples.
|
private |
The number of entries in each bucket.
Definition at line 240 of file storage.hh.
|
private |
|
private |
The maximum value to track.
Definition at line 238 of file storage.hh.
|
private |
The largest value sampled.
Definition at line 245 of file storage.hh.
|
private |
The minimum value to track.
Definition at line 236 of file storage.hh.
|
private |
The smallest value sampled.
Definition at line 243 of file storage.hh.
|
private |
The number of values sampled more than max.
Definition at line 249 of file storage.hh.
|
private |
|
private |
The sum of squares.
Definition at line 253 of file storage.hh.
|
private |
The current sum.
Definition at line 251 of file storage.hh.
|
private |
The number of values sampled less than min.
Definition at line 247 of file storage.hh.