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. More...
 
void stopMeasuring (MLTimeProfileHandle &handle, bool ignoreIfEmpty=false)
 Stops measuring time and associates the elapsed time. More...
 
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. More...
 
void reset ()
 Resets the time profile. More...
 
const MLMetaProfilemetaProfile () const
 Returns the meta profile. Don't assume that the pointer is valid! More...
 
MLProfilingTimeType allElapsedTime () const
 Returns the sum of the elapsed time of all functions in seconds. More...
 
MLProfilingTimeType allConsumedTime () const
 Returns the sum of the consumed time of all functions in seconds. More...
 
const MLCallGraphFunctionMapfunctionMap () const
 Returns the function map. More...
 
MLCallGraphFunctionPtr getFunctionForTesting (const std::string &function) const
 Returns the function pointer or NULL. More...
 

Static Public Member Functions

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

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 93 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 90 of file mlTimeProfile.h.

◆ callGraph()

static MLCallGraphNode& MLTimeProfile::callGraph ( )
static

Returns the timer 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

Enable call tracing and set the trace filname.

◆ functionMap()

const MLCallGraphFunctionMap& MLTimeProfile::functionMap ( ) const
inline

Returns the function map.

Definition at line 99 of file mlTimeProfile.h.

◆ 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 105 of file mlTimeProfile.h.

◆ globalFunctionMap()

static const MLCallGraphGlobalFunctionMap& MLTimeProfile::globalFunctionMap ( )
inlinestatic

Returns the global function map.

Definition at line 102 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 if call tracing is enabled.

Definition at line 135 of file mlTimeProfile.h.

◆ metaProfile()

const MLMetaProfile* MLTimeProfile::metaProfile ( ) const

Returns the meta profile. Don't assume that the pointer is valid!

◆ reset()

void MLTimeProfile::reset ( )

Resets the time profile.

◆ setReduceCallGraph()

static void MLTimeProfile::setReduceCallGraph ( bool  reduceCallGraph)
inlinestatic

Sets if the call graph should be reduced.

Definition at line 117 of file mlTimeProfile.h.

◆ shouldReduceCallGraph()

static bool MLTimeProfile::shouldReduceCallGraph ( )
inlinestatic

Gets if the call graph should be reduced.

Definition at line 120 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
Returns the MLTimeProfileHandle, which 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.

Friends And Related Function Documentation

◆ MLABModuleProfile

friend class MLABModuleProfile
friend

Definition at line 196 of file mlTimeProfile.h.

◆ MLAccumulatedProfile

friend class MLAccumulatedProfile
friend

Definition at line 192 of file mlTimeProfile.h.

◆ MLCallGraphNode

friend class MLCallGraphNode
friend

Definition at line 193 of file mlTimeProfile.h.

◆ MLProfilingManager

friend class MLProfilingManager
friend

Definition at line 194 of file mlTimeProfile.h.

Member Data Documentation

◆ mainFunction

MLCallGraphFunctionPtr MLTimeProfile::mainFunction
static

Definition at line 169 of file mlTimeProfile.h.


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