gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Private Attributes | List of all members
Stats::AvgStor Class Reference

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...
 

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 533 of file statistics.hh.

Constructor & Destructor Documentation

Stats::AvgStor::AvgStor ( Info info)
inline

Build and initializes this stat storage.

Definition at line 552 of file statistics.hh.

Member Function Documentation

void Stats::AvgStor::dec ( Counter  val)
inline

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

Parameters
valThe amount to decrement.

Definition at line 579 of file statistics.hh.

References current, and set().

void Stats::AvgStor::inc ( Counter  val)
inline

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

Parameters
valThe amount to increment.

Definition at line 573 of file statistics.hh.

References current, and set().

void Stats::AvgStor::prepare ( Info info)
inline

Prepare stat data for dumping or serialization.

Definition at line 607 of file statistics.hh.

References current, curTick(), last, and total.

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

Reset stat value to default.

Definition at line 617 of file statistics.hh.

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

Result Stats::AvgStor::result ( ) const
inline

Return the current average.

Returns
The current average.

Definition at line 592 of file statistics.hh.

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

void Stats::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 562 of file statistics.hh.

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

Referenced by dec(), and inc().

Counter Stats::AvgStor::value ( ) const
inline

Return the current count.

Returns
The current count.

Definition at line 585 of file statistics.hh.

References current.

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

Definition at line 601 of file statistics.hh.

References total.

Member Data Documentation

Counter Stats::AvgStor::current
private

The current count.

Definition at line 537 of file statistics.hh.

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

Tick Stats::AvgStor::last
mutableprivate

The tick that current last changed.

Definition at line 543 of file statistics.hh.

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

Tick Stats::AvgStor::lastReset
private

The tick of the last reset.

Definition at line 539 of file statistics.hh.

Referenced by reset(), and result().

Result Stats::AvgStor::total
mutableprivate

The total count for all tick.

Definition at line 541 of file statistics.hh.

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


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

Generated on Fri Jun 9 2017 13:04:38 for gem5 by doxygen 1.8.6