gem5 v24.0.0.0
|
Templatized storage and interface to a per-tick average stat. More...
#include <storage.hh>
Classes | |
struct | Params |
Public Member Functions | |
AvgStor (const StorageParams *const storage_params) | |
Build and initializes this stat storage. | |
void | set (Counter val) |
Set the current count to the one provided, update the total and last set values. | |
void | inc (Counter val) |
Increment the current count by the provided value, calls set. | |
void | dec (Counter val) |
Deccrement the current count by the provided value, calls set. | |
Counter | value () const |
Return the current count. | |
Result | result () const |
Return the current average. | |
bool | zero () const |
void | prepare (const StorageParams *const storage_params) |
Prepare stat data for dumping or serialization. | |
void | reset (const StorageParams *const storage_params) |
Reset stat value to default. | |
Private Attributes | |
Counter | current |
The current count. | |
Tick | lastReset |
The tick of the last reset. | |
Result | total |
The total count for all tick. | |
Tick | last |
The tick that current last changed. | |
Templatized storage and interface to a per-tick average stat.
This keeps a current count and updates a total (count * ticks) when this count changes. This allows the quick calculation of a per tick count of the item being watched. This is good for keeping track of residencies in structures among other things.
Definition at line 126 of file storage.hh.
|
inline |
Build and initializes this stat storage.
Definition at line 144 of file storage.hh.
|
inline |
Deccrement the current count by the provided value, calls set.
val | The amount to decrement. |
Definition at line 171 of file storage.hh.
References current, gem5::ArmISA::set, and gem5::X86ISA::val.
Referenced by TEST().
|
inline |
Increment the current count by the provided value, calls set.
val | The amount to increment. |
Definition at line 165 of file storage.hh.
References current, gem5::ArmISA::set, and gem5::X86ISA::val.
|
inline |
Prepare stat data for dumping or serialization.
Definition at line 199 of file storage.hh.
References current, gem5::curTick(), last, and total.
Referenced by TEST().
|
inline |
Reset stat value to default.
Definition at line 209 of file storage.hh.
References gem5::curTick(), last, lastReset, and total.
Referenced by TEST().
|
inline |
Return the current average.
Definition at line 184 of file storage.hh.
References current, gem5::curTick(), last, lastReset, and total.
|
inline |
Set the current count to the one provided, update the total and last set values.
val | The new count. |
Definition at line 154 of file storage.hh.
References current, gem5::curTick(), last, total, and gem5::X86ISA::val.
|
inline |
|
inline |
Definition at line 193 of file storage.hh.
References total.
Referenced by TEST().
|
private |
|
mutableprivate |
|
private |
The tick of the last reset.
Definition at line 132 of file storage.hh.
|
mutableprivate |