HDK
|
#include <reporter.h>
Public Types | |
using | This = TraceReporter |
using | ThisPtr = TraceReporterPtr |
using | ThisRefPtr = TraceReporterRefPtr |
using | Event = TraceEvent |
using | TimeStamp = TraceEvent::TimeStamp |
using | CounterMap = TfHashMap< TfToken, double, TfToken::HashFunctor > |
Public Types inherited from TraceReporterBase | |
using | This = TraceReporterBase |
using | ThisPtr = TraceReporterBasePtr |
using | ThisRefPtr = TraceReporterBaseRefPtr |
using | CollectionPtr = std::shared_ptr< TraceCollection > |
using | DataSourcePtr = std::unique_ptr< TraceReporterDataSourceBase > |
Public Types inherited from TfRefBase | |
typedef void(* | UniqueChangedFuncPtr )(TfRefBase const *, bool) |
Public Member Functions | |
TF_MALLOC_TAG_NEW ("Trace","TraceReporter") | |
virtual TRACE_API | ~TraceReporter () |
Destructor. More... | |
const std::string & | GetLabel () |
Return the label associated with this reporter. More... | |
TRACE_API TraceAggregateNodePtr | GetAggregateTreeRoot () |
Returns the root node of the aggregated call tree. More... | |
TRACE_API TraceEventNodeRefPtr | GetEventRoot () |
Returns the root node of the call tree. More... | |
TRACE_API TraceEventTreeRefPtr | GetEventTree () |
Returns the event call tree. More... | |
TRACE_API void | UpdateTraceTrees () |
TRACE_API void | ClearTree () |
Clears event tree and counters. More... | |
Report Generation. | |
TRACE_API void | Report (std::ostream &s, int iterationCount=1) |
TRACE_API void | ReportTimes (std::ostream &s) |
Generates a report of the times to the ostream s. More... | |
TRACE_API void | ReportChromeTracing (std::ostream &s) |
Counters | |
TRACE_API const CounterMap & | GetCounters () const |
TRACE_API int | GetCounterIndex (const TfToken &key) const |
TRACE_API bool | AddCounter (const TfToken &key, int index, double totalValue) |
Report options. | |
TRACE_API void | SetGroupByFunction (bool) |
TRACE_API bool | GetGroupByFunction () const |
Returns the current group-by-function state. More... | |
TRACE_API void | SetFoldRecursiveCalls (bool) |
TRACE_API bool | GetFoldRecursiveCalls () const |
TRACE_API void | SetShouldAdjustForOverheadAndNoise (bool adjust) |
TRACE_API bool | ShouldAdjustForOverheadAndNoise () const |
Public Member Functions inherited from TraceReporterBase | |
TRACE_API | TraceReporterBase (DataSourcePtr dataSource) |
Constructor taking ownership of dataSource . More... | |
virtual TRACE_API | ~TraceReporterBase () |
Destructor. More... | |
TRACE_API bool | SerializeProcessedCollections (std::ostream &ostr) const |
Write all collections that were processed by this reporter to ostr . More... | |
Public Member Functions inherited from TfRefBase | |
TfRefBase () | |
TfRefBase (TfRefBase const &) | |
TfRefBase & | operator= (TfRefBase const &) |
size_t | GetCurrentCount () const |
Return the current reference count of this object. More... | |
bool | IsUnique () const |
Return true if only one TfRefPtr points to this object. More... | |
void | SetShouldInvokeUniqueChangedListener (bool shouldCall) |
Public Member Functions inherited from TfWeakBase | |
TfWeakBase () | |
TfWeakBase (const TfWeakBase &) | |
const TfWeakBase & | __GetTfWeakBase__ () const |
const TfWeakBase & | operator= (const TfWeakBase &) |
void | EnableNotification2 () const |
TF_API void const * | GetUniqueIdentifier () const |
Static Public Member Functions | |
static ThisRefPtr | New (const std::string &label, DataSourcePtr dataSource) |
Create a new reporter with label and dataSource. More... | |
static ThisRefPtr | New (const std::string &label) |
Create a new reporter with label and no data source. More... | |
static TRACE_API TraceReporterPtr | GetGlobalReporter () |
Returns the global reporter. More... | |
static TRACE_API TraceAggregateNode::Id | CreateValidEventId () |
Static Public Member Functions inherited from TfRefBase | |
static TF_API void | SetUniqueChangedListener (UniqueChangedListener listener) |
Protected Member Functions | |
TRACE_API | TraceReporter (const std::string &label, DataSourcePtr dataSource) |
Protected Member Functions inherited from TraceReporterBase | |
TRACE_API void | _Clear () |
Removes all references to TraceCollections. More... | |
TRACE_API void | _Update () |
Protected Member Functions inherited from TfRefBase | |
virtual TF_API | ~TfRefBase () |
Protected Member Functions inherited from TfWeakBase | |
~TfWeakBase () | |
TfRefPtr< Tf_Remnant > | _Register () const |
template<class T > | |
TfRefPtr< Tf_Remnant > | _Register (T *tempRmnt) const |
bool | _HasRemnant () const |
This class converts streams of TraceEvent objects into call trees which can then be used as a data source to a GUI or written out to a file.
Definition at line 64 of file reporter.h.
using TraceReporter::CounterMap = TfHashMap<TfToken, double, TfToken::HashFunctor> |
Definition at line 76 of file reporter.h.
using TraceReporter::Event = TraceEvent |
Definition at line 74 of file reporter.h.
using TraceReporter::This = TraceReporter |
Definition at line 70 of file reporter.h.
using TraceReporter::ThisPtr = TraceReporterPtr |
Definition at line 71 of file reporter.h.
using TraceReporter::ThisRefPtr = TraceReporterRefPtr |
Definition at line 72 of file reporter.h.
Definition at line 75 of file reporter.h.
|
virtual |
Destructor.
|
protected |
Add a counter to the reporter. This method can be used to restore a previous trace state and tree. Note, that the counter being added must have a unique key and index. The method will return false if a key or index already exists.
|
static |
Creates a valid TraceAggregateNode::Id object. This should be used by very few clients for certain special cases. For most cases, the TraceAggregateNode::Id object should be created and populated internally within the Reporter object itself.
TRACE_API TraceAggregateNodePtr TraceReporter::GetAggregateTreeRoot | ( | ) |
Returns the root node of the aggregated call tree.
Returns the numeric index associated with a counter key. Counter values on the event nodes will have to be looked up by the numeric index.
TRACE_API const CounterMap& TraceReporter::GetCounters | ( | ) | const |
Returns a map of counters (counter keys), associated with their total accumulated value. Each individual event node in the tree may also hold on to an inclusive and exclusive value for the given counter.
TRACE_API TraceEventNodeRefPtr TraceReporter::GetEventRoot | ( | ) |
Returns the root node of the call tree.
TRACE_API TraceEventTreeRefPtr TraceReporter::GetEventTree | ( | ) |
Returns the event call tree.
TRACE_API bool TraceReporter::GetFoldRecursiveCalls | ( | ) | const |
Returns the current setting for recursion folding for stack trace event reporting.
|
static |
Returns the global reporter.
TRACE_API bool TraceReporter::GetGroupByFunction | ( | ) | const |
Returns the current group-by-function state.
|
inline |
Return the label associated with this reporter.
Definition at line 96 of file reporter.h.
|
inlinestatic |
Create a new reporter with label and dataSource.
Definition at line 79 of file reporter.h.
|
inlinestatic |
Create a new reporter with label and no data source.
Definition at line 85 of file reporter.h.
Generates a report to the ostream s, dividing all times by iterationCount.
Generates a timeline trace report suitable for viewing in Chrome's trace viewer.
Generates a report of the times to the ostream s.
When stack trace event reporting, this sets whether or not recursive calls are folded in the output. Recursion folding is useful when the stacks contain deep recursive structures.
This affects only stack trace event reporting. If true
then all events in a function are grouped together otherwise events are split out by address.
Set whether or not the reporter should adjust scope times for overhead and noise.
TRACE_API bool TraceReporter::ShouldAdjustForOverheadAndNoise | ( | ) | const |
Returns the current setting for addjusting scope times for overhead and noise.
TraceReporter::TF_MALLOC_TAG_NEW | ( | "Trace" | , |
"TraceReporter" | |||
) |
This fully re-builds the event and aggregate trees from whatever the current collection holds. It is ok to call this multiple times in case the collection gets appended on inbetween.
If we want to have multiple reporters per collector, this will need to be changed so that all reporters reporting on a collector update their respective trees.