MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
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 MLMetaProfile * metaProfile () 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 MLCallGraphFunctionSet & usedFunctions () const
 Returns the function map.
 
MLCallGraphFunctionPtr getFunctionForTesting (const std::string &function) const
 Returns the function pointer or NULL.
 

Static Public Member Functions

static MLCallGraphNode & callGraph ()
 Returns the timer tree root.
 
static MLCallGraphNode * callGraphCopy ()
 Returns the timer copy tree root.
 
static void refreshCallGraphCopy ()
 Resets the timer copy tree root.
 
static const MLCallGraphGlobalFunctionMap & globalFunctionMap ()
 Returns the global function map.
 
static const MLCallGraphFunctionList & globalFunctionList ()
 Returns the global function list.
 
static const MLCallGraphFunctionList & globalFunctionListCopy ()
 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 void setAllowParameterEvaluation (bool allowParameterEvaluation)
 Sets whether function parameters should be evaluated.
 
static bool shouldReduceCallGraph ()
 Returns whether the call graph should be reduced.
 
static bool shouldAllowParameterEvaluation ()
 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 91 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 103 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 85 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 97 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 130 of file mlTimeProfile.h.

◆ globalFunctionListCopy()

static const MLCallGraphFunctionList & MLTimeProfile::globalFunctionListCopy ( )
inlinestatic

Returns copy of the global function list.

Definition at line 136 of file mlTimeProfile.h.

◆ globalFunctionMap()

static const MLCallGraphGlobalFunctionMap & MLTimeProfile::globalFunctionMap ( )
inlinestatic

Returns the global function map.

Definition at line 124 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 189 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

◆ setAllowParameterEvaluation()

static void MLTimeProfile::setAllowParameterEvaluation ( bool allowParameterEvaluation)
inlinestatic

Sets whether function parameters should be evaluated.

Definition at line 159 of file mlTimeProfile.h.

References mlrange_cast().

◆ setReduceCallGraph()

static void MLTimeProfile::setReduceCallGraph ( bool reduceCallGraph)
inlinestatic

Sets whether the call graph should be reduced.

Definition at line 153 of file mlTimeProfile.h.

References mlrange_cast().

◆ shouldAllowParameterEvaluation()

static bool MLTimeProfile::shouldAllowParameterEvaluation ( )
inlinestatic

Returns whether the call graph should be reduced.

Definition at line 171 of file mlTimeProfile.h.

◆ shouldReduceCallGraph()

static bool MLTimeProfile::shouldReduceCallGraph ( )
inlinestatic

Returns whether the call graph should be reduced.

Definition at line 165 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 118 of file mlTimeProfile.h.

Friends And Related Symbol Documentation

◆ MLABModuleProfile

friend class MLABModuleProfile
friend

Definition at line 260 of file mlTimeProfile.h.

◆ MLAccumulatedProfile

Definition at line 256 of file mlTimeProfile.h.

◆ MLCallGraphNode

Definition at line 257 of file mlTimeProfile.h.

◆ MLProfilingManager

Definition at line 258 of file mlTimeProfile.h.

Member Data Documentation

◆ mainFunction

MLCallGraphFunctionPtr MLTimeProfile::mainFunction
static

Definition at line 226 of file mlTimeProfile.h.


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