MeVisLab Toolbox Reference
MLTimeProfile Class Reference

#include <mlTimeProfile.h>

Public Member Functions

 MLTimeProfile (const MLMetaProfile *metaProfile=nullptr)
 
 ~MLTimeProfile ()
 
MLTimeProfileHandle startMeasuring (const std::string &function, int userId, void *userData, const std::string &filename, int linenumber, const std::string &nodeInfo="")
 Starts measuring time.
 
void stopMeasuring (MLTimeProfileHandle &handle, bool ignoreIfEmpty=false)
 Stops measuring time and associates the elapsed time.
 
void addTimeToFunction (const std::string &function, int userId, const std::string &filename, int linenumber, MLProfilingTimeType time, int callCount)
 Adds time to the given function, without measuring and without putting the function onto the call stack.
 
void reset ()
 Resets the time profile.
 
void makeSnapshot ()
 
const MLMetaProfilemetaProfile () const
 Returns the metaprofile. Do not assume that the pointer is valid!
 
MLProfilingTimeType allElapsedTime () const
 Returns the sum of the elapsed time of all functions in seconds.
 
MLProfilingTimeType allConsumedTime () const
 Returns the sum of the consumed time of all functions in seconds.
 
MLProfilingTimeType allElapsedTimeSnapshot () const
 Returns snapshot of the sum of the elapsed time of all functions in seconds.
 
MLProfilingTimeType allConsumedTimeSnapshot () const
 Returns snapshot of the sum of the consumed time of all functions in seconds.
 
const MLCallGraphFunctionSetusedFunctions () const
 Returns the function map.
 
MLCallGraphFunctionPtr getFunctionForTesting (const std::string &function) const
 Returns the function pointer or NULL.
 

Static Public Member Functions

static MLCallGraphNodecallGraph ()
 Returns the timer tree root.
 
static MLCallGraphNodecallGraphCopy ()
 Returns the timer copy tree root.
 
static void refreshCallGraphCopy ()
 Resets the timer copy tree root.
 
static const MLCallGraphGlobalFunctionMapglobalFunctionMap ()
 Returns the global function map.
 
static const MLCallGraphFunctionListglobalFunctionList ()
 Returns the global function list.
 
static const MLCallGraphFunctionListglobalFunctionListCopy ()
 Returns copy of the global function list.
 
static MLCallGraphFunctionPtr getFunctionGlobal (const std::string &function, const std::string &filename, int linenumber)
 Returns the function pointer or NULL.
 
static MLProfilingTimeType globalElapsedTime ()
 Returns the global elapsed time in seconds.
 
static void setReduceCallGraph (bool reduceCallGraph)
 Sets whether the call graph should be reduced.
 
static bool shouldReduceCallGraph ()
 Returns whether the call graph should be reduced.
 
static void initialize ()
 Static initialization, is called by the profiling manager.
 
static void deinitialize ()
 Static deinitialization, is called by the profiling manager.
 
static void enableTracing (const char *filename)
 Enables call tracing and set the trace filname.
 
static void disableTracing ()
 Disables call tracing.
 
static bool isTracingEnabled ()
 Returns whether call tracing is enabled.
 
static void resetGlobalFunctionListCopy ()
 

Static Public Attributes

static MLCallGraphFunctionPtr mainFunction
 

Friends

class MLAccumulatedProfile
 
class MLCallGraphNode
 
class MLProfilingManager
 
class MLABModuleProfile
 

Detailed Description

Definition at line 54 of file mlTimeProfile.h.

Constructor & Destructor Documentation

◆ MLTimeProfile()

MLTimeProfile::MLTimeProfile ( const MLMetaProfile metaProfile = nullptr)

◆ ~MLTimeProfile()

MLTimeProfile::~MLTimeProfile ( )

Member Function Documentation

◆ addTimeToFunction()

void MLTimeProfile::addTimeToFunction ( const std::string &  function,
int  userId,
const std::string &  filename,
int  linenumber,
MLProfilingTimeType  time,
int  callCount 
)

Adds time to the given function, without measuring and without putting the function onto the call stack.

This can be used to integrate times from other threads.

◆ allConsumedTime()

MLProfilingTimeType MLTimeProfile::allConsumedTime ( ) const
inline

Returns the sum of the consumed time of all functions in seconds.

Definition at line 95 of file mlTimeProfile.h.

◆ allConsumedTimeSnapshot()

MLProfilingTimeType MLTimeProfile::allConsumedTimeSnapshot ( ) const
inline

Returns snapshot of the sum of the consumed time of all functions in seconds.

Definition at line 104 of file mlTimeProfile.h.

◆ allElapsedTime()

MLProfilingTimeType MLTimeProfile::allElapsedTime ( ) const
inline

Returns the sum of the elapsed time of all functions in seconds.

Definition at line 92 of file mlTimeProfile.h.

◆ allElapsedTimeSnapshot()

MLProfilingTimeType MLTimeProfile::allElapsedTimeSnapshot ( ) const
inline

Returns snapshot of the sum of the elapsed time of all functions in seconds.

Definition at line 98 of file mlTimeProfile.h.

◆ callGraph()

static MLCallGraphNode & MLTimeProfile::callGraph ( )
static

Returns the timer tree root.

◆ callGraphCopy()

static MLCallGraphNode * MLTimeProfile::callGraphCopy ( )
static

Returns the timer copy tree root.

◆ deinitialize()

static void MLTimeProfile::deinitialize ( )
static

Static deinitialization, is called by the profiling manager.

◆ disableTracing()

static void MLTimeProfile::disableTracing ( )
static

Disables call tracing.

◆ enableTracing()

static void MLTimeProfile::enableTracing ( const char *  filename)
static

Enables call tracing and set the trace filname.

◆ getFunctionForTesting()

MLCallGraphFunctionPtr MLTimeProfile::getFunctionForTesting ( const std::string &  function) const

Returns the function pointer or NULL.

◆ getFunctionGlobal()

static MLCallGraphFunctionPtr MLTimeProfile::getFunctionGlobal ( const std::string &  function,
const std::string &  filename,
int  linenumber 
)
static

Returns the function pointer or NULL.

◆ globalElapsedTime()

static MLProfilingTimeType MLTimeProfile::globalElapsedTime ( )
static

Returns the global elapsed time in seconds.

◆ globalFunctionList()

static const MLCallGraphFunctionList & MLTimeProfile::globalFunctionList ( )
inlinestatic

Returns the global function list.

Definition at line 125 of file mlTimeProfile.h.

◆ globalFunctionListCopy()

static const MLCallGraphFunctionList & MLTimeProfile::globalFunctionListCopy ( )
inlinestatic

Returns copy of the global function list.

Definition at line 128 of file mlTimeProfile.h.

◆ globalFunctionMap()

static const MLCallGraphGlobalFunctionMap & MLTimeProfile::globalFunctionMap ( )
inlinestatic

Returns the global function map.

Definition at line 122 of file mlTimeProfile.h.

◆ initialize()

static void MLTimeProfile::initialize ( )
static

Static initialization, is called by the profiling manager.

◆ isTracingEnabled()

static bool MLTimeProfile::isTracingEnabled ( )
inlinestatic

Returns whether call tracing is enabled.

Definition at line 159 of file mlTimeProfile.h.

◆ makeSnapshot()

void MLTimeProfile::makeSnapshot ( )

◆ metaProfile()

const MLMetaProfile * MLTimeProfile::metaProfile ( ) const

Returns the metaprofile. Do not assume that the pointer is valid!

◆ refreshCallGraphCopy()

static void MLTimeProfile::refreshCallGraphCopy ( )
static

Resets the timer copy tree root.

◆ reset()

void MLTimeProfile::reset ( )

Resets the time profile.

◆ resetGlobalFunctionListCopy()

static void MLTimeProfile::resetGlobalFunctionListCopy ( )
static

◆ setReduceCallGraph()

static void MLTimeProfile::setReduceCallGraph ( bool  reduceCallGraph)
inlinestatic

Sets whether the call graph should be reduced.

Definition at line 141 of file mlTimeProfile.h.

◆ shouldReduceCallGraph()

static bool MLTimeProfile::shouldReduceCallGraph ( )
inlinestatic

Returns whether the call graph should be reduced.

Definition at line 144 of file mlTimeProfile.h.

◆ startMeasuring()

MLTimeProfileHandle MLTimeProfile::startMeasuring ( const std::string &  function,
int  userId,
void *  userData,
const std::string &  filename,
int  linenumber,
const std::string &  nodeInfo = "" 
)

Starts measuring time.

Parameters
idThe ID identifies the function.
Returns
The MLTimeProfileHandle that is required to stop the measurement.

◆ stopMeasuring()

void MLTimeProfile::stopMeasuring ( MLTimeProfileHandle handle,
bool  ignoreIfEmpty = false 
)

Stops measuring time and associates the elapsed time.

Parameters
handleThe MLTimeProfileHandle returned by startMeasuring() must be given.

◆ usedFunctions()

const MLCallGraphFunctionSet & MLTimeProfile::usedFunctions ( ) const
inline

Returns the function map.

Definition at line 119 of file mlTimeProfile.h.

Friends And Related Symbol Documentation

◆ MLABModuleProfile

friend class MLABModuleProfile
friend

Definition at line 228 of file mlTimeProfile.h.

◆ MLAccumulatedProfile

friend class MLAccumulatedProfile
friend

Definition at line 224 of file mlTimeProfile.h.

◆ MLCallGraphNode

friend class MLCallGraphNode
friend

Definition at line 225 of file mlTimeProfile.h.

◆ MLProfilingManager

friend class MLProfilingManager
friend

Definition at line 226 of file mlTimeProfile.h.

Member Data Documentation

◆ mainFunction

MLCallGraphFunctionPtr MLTimeProfile::mainFunction
static

Definition at line 195 of file mlTimeProfile.h.


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