147 class CounterBehaviorDetailed
165 const InstrumentationNode::MetadataPairs & meta_data) :
167 meta_data_(meta_data)
174 const InstrumentationNode::MetadataPairs &
getMetadata()
const {
180 const InstrumentationNode::MetadataPairs meta_data_;
202 const std::string& name,
203 const std::string& group,
205 const std::string& desc,
206 CounterBehaviorDetailed behave,
220 ensureParentIsValid_(parent);
226 behave.getMetadata().begin(),
227 behave.getMetadata().end());
233 const std::string& name,
234 const std::string& group,
236 const std::string& desc,
237 CounterBehaviorDetailed behave) :
251 const std::string& name,
252 const std::string& desc,
253 CounterBehaviorDetailed behave) :
334 virtual std::string
stringize(
bool pretty=
false)
const = 0;
375 void ensureParentIsValid_(
TreeNode* parent);
380 const CounterBehaviorDetailed behave_;
Byte order types and byte-swapping routines.
Virtual interface node for simulator instrumentation (e.g. counters, stats, nontifications).
Set of macros for Sparta assertions. Caught by the framework.
Exception class for all of Sparta.
Basic Node framework in sparta device tree composite pattern.
Wrapper class to add meta information to a counter definition.
CounterBehaviorDetailed(CounterBehavior behavior)
Construct a CounterBehaviorDetailed without meta data.
const InstrumentationNode::MetadataPairs & getMetadata() const
Get the meta data provided by the user.
The base class for all Counters.
virtual ~CounterBase()
Destructor.
virtual void onAddingChild_(TreeNode *child)
React to child registration.
virtual counter_type get() const =0
Gets the value of this counter.
virtual bool supportsCompression() const
CounterBase(TreeNode *parent, const std::string &name, const std::string &group, TreeNode::group_idx_type group_idx, const std::string &desc, CounterBehaviorDetailed behave, visibility_t visibility)
CounterBase constructor.
static std::string getBehaviorName(CounterBehaviorDetailed behave)
Returns a string containing the name of the given behavior.
uint64_t counter_type
Counter value type.
CounterBehavior
Behavior of this counter.
@ COUNT_INTEGRAL
Counter intended to increase each cycle by some variable X.
@ COUNT_LATEST
Counter holds the latest value (from most recent activity) and can increase or decrease at any time.
@ COUNT_NORMAL
Counter counts the number of times something happens like one would expect. This is a weakly monotoni...
virtual std::string stringize(bool pretty=false) const =0
Create a string representation of this node.
CounterBehavior getBehavior() const
Gets the behavior for this counter specified at construction.
InstrumentationNode()=delete
Not default-constructable.
@ TYPE_COUNTER
Counter (of any subclass)
static constexpr visibility_t DEFAULT_VISIBILITY
Default node visibility.
uint32_t visibility_t
Continuous visibility level. Several key points along continum are indicated within Visibility.
MetadataPairs meta_data_
Add any arbitrary metadata as strings to this object. Used to add extra information to statistics rep...
Used to construct and throw a standard C++ exception. Inherits from std::exception.
Node in a composite tree representing a sparta Tree item.
static const group_idx_type GROUP_IDX_NONE
GroupIndex indicating that a node has no group index because it belongs to no group.
static constexpr char GROUP_NAME_NONE[]
Group name indicating that a node belongs to no group.
TreeNode()=delete
Not default-constructable.
void addChild(TreeNode *child, bool inherit_phase=true)
Adds a TreeNode to this node as a child.
uint32_t group_idx_type
Index within a group.
void setExpectedParent_(const TreeNode *parent)
Tracks a node as an expected parent without actually adding this node as a child. This is used almost...
Macros for handling exponential backoff.