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.
 
const MLMetaProfilemetaProfile () const
 Returns the meta profile. Don't 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.
 
const MLCallGraphFunctionMapfunctionMap () 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 const MLCallGraphGlobalFunctionMapglobalFunctionMap ()
 Returns the global function map.
 
static const MLCallGraphFunctionListglobalFunctionList ()
 Returns 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 if the call graph should be reduced.
 
static bool shouldReduceCallGraph ()
 Gets if 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)
 Enable call tracing and set the trace filname.
 
static void disableTracing ()
 Disables call tracing.
 
static bool isTracingEnabled ()
 Returns if call tracing is enabled.
 

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.

References mlrange_cast().

◆ 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 Symbol Documentation

◆ MLABModuleProfile

friend class MLABModuleProfile
friend

Definition at line 196 of file mlTimeProfile.h.

◆ MLAccumulatedProfile

Definition at line 192 of file mlTimeProfile.h.

◆ MLCallGraphNode

Definition at line 193 of file mlTimeProfile.h.

◆ MLProfilingManager

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: