gem5
|
Templatized storage and interface to a per-tick average stat. More...
#include <statistics.hh>
Classes | |
struct | Params |
Public Member Functions | |
AvgStor (Info *info) | |
Build and initializes this stat storage. More... | |
void | set (Counter val) |
Set the current count to the one provided, update the total and last set values. More... | |
void | inc (Counter val) |
Increment the current count by the provided value, calls set. More... | |
void | dec (Counter val) |
Deccrement the current count by the provided value, calls set. More... | |
Counter | value () const |
Return the current count. More... | |
Result | result () const |
Return the current average. More... | |
bool | zero () const |
void | prepare (Info *info) |
Prepare stat data for dumping or serialization. More... | |
void | reset (Info *info) |
Reset stat value to default. More... | |
Private Attributes | |
Counter | current |
The current count. More... | |
Tick | lastReset |
The tick of the last reset. More... | |
Result | total |
The total count for all tick. More... | |
Tick | last |
The tick that current last changed. More... | |
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 533 of file statistics.hh.
|
inline |
Build and initializes this stat storage.
Definition at line 552 of file statistics.hh.
|
inline |
Deccrement the current count by the provided value, calls set.
val | The amount to decrement. |
Definition at line 579 of file statistics.hh.
|
inline |
Increment the current count by the provided value, calls set.
val | The amount to increment. |
Definition at line 573 of file statistics.hh.
|
inline |
|
inline |
|
inline |
|
inline |
Set the current count to the one provided, update the total and last set values.
val | The new count. |
Definition at line 562 of file statistics.hh.
References current, curTick(), last, total, and X86ISA::val.
|
inline |
Return the current count.
Definition at line 585 of file statistics.hh.
References current.
|
inline |
|
private |
|
mutableprivate |
|
private |
The tick of the last reset.
Definition at line 539 of file statistics.hh.
|
mutableprivate |