gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::statistics::AvgStor Class Reference

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ AvgStor()

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

Build and initializes this stat storage.

Definition at line 144 of file storage.hh.

Member Function Documentation

◆ dec()

void gem5::statistics::AvgStor::dec ( Counter val)
inline

Deccrement the current count by the provided value, calls set.

Parameters
valThe amount to decrement.

Definition at line 171 of file storage.hh.

References current, gem5::ArmISA::set, and gem5::X86ISA::val.

Referenced by TEST().

◆ inc()

void gem5::statistics::AvgStor::inc ( Counter val)
inline

Increment the current count by the provided value, calls set.

Parameters
valThe amount to increment.

Definition at line 165 of file storage.hh.

References current, gem5::ArmISA::set, and gem5::X86ISA::val.

Referenced by TEST(), and TEST().

◆ prepare()

void gem5::statistics::AvgStor::prepare ( const StorageParams *const storage_params)
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().

◆ reset()

void gem5::statistics::AvgStor::reset ( const StorageParams *const storage_params)
inline

Reset stat value to default.

Definition at line 209 of file storage.hh.

References gem5::curTick(), last, lastReset, and total.

Referenced by TEST().

◆ result()

Result gem5::statistics::AvgStor::result ( ) const
inline

Return the current average.

Returns
The current average.

Definition at line 184 of file storage.hh.

References current, gem5::curTick(), last, lastReset, and total.

Referenced by TEST(), and TEST().

◆ set()

void gem5::statistics::AvgStor::set ( Counter val)
inline

Set the current count to the one provided, update the total and last set values.

Parameters
valThe new count.

Definition at line 154 of file storage.hh.

References current, gem5::curTick(), last, total, and gem5::X86ISA::val.

Referenced by TEST(), TEST(), and TEST().

◆ value()

Counter gem5::statistics::AvgStor::value ( ) const
inline

Return the current count.

Returns
The current count.

Definition at line 177 of file storage.hh.

References current.

Referenced by TEST(), TEST(), and TEST().

◆ zero()

bool gem5::statistics::AvgStor::zero ( ) const
inline
Returns
true if zero value

Definition at line 193 of file storage.hh.

References total.

Referenced by TEST().

Member Data Documentation

◆ current

Counter gem5::statistics::AvgStor::current
private

The current count.

Definition at line 130 of file storage.hh.

Referenced by dec(), inc(), prepare(), result(), set(), and value().

◆ last

Tick gem5::statistics::AvgStor::last
mutableprivate

The tick that current last changed.

Definition at line 136 of file storage.hh.

Referenced by prepare(), reset(), result(), and set().

◆ lastReset

Tick gem5::statistics::AvgStor::lastReset
private

The tick of the last reset.

Definition at line 132 of file storage.hh.

Referenced by reset(), and result().

◆ total

Result gem5::statistics::AvgStor::total
mutableprivate

The total count for all tick.

Definition at line 134 of file storage.hh.

Referenced by prepare(), reset(), result(), set(), and zero().


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

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