◆
NullValueRef()
static const
Profiler
& NullValueRef
|
(
|
|
)
|
|
|
static
|
◆
GetSampleCount()
Gets the count of captured samples.
-
返回
-
Captured sample count.
◆
Reset()
Resets the profiler.
◆
GetDebugDumpEnabled()
Gets the profiler debug dump enabled state.
-
返回
-
True if enabled, false otherwise.
◆
SetDebugDumpEnabled()
Sets the profiler debug dump enabled state.
-
参数
-
[in]
|
state
|
True if enabled, false otherwise.
|
◆
GetEnableState()
[1/2]
Gets the profiler state.
-
返回
-
State: DISABLED, ENABLED_METHOD_SCOPE, ENABLED_ALL
◆
SetEnableState()
Sets the profiler state.
-
参数
-
[in]
|
state
|
State: DISABLED, ENABLED_METHOD_SCOPE, ENABLED_ALL
|
◆
GetEnableState()
[2/2]
Gets the enabled state of a profiling point.
-
返回
-
True if enabled.
◆
GetMacroTime()
Gets the current time. Used by the calling macro to capture the time before arguments for the call to AddPointSample or AddSample methods are evaluated.
◆
IsFirstTime()
Indicates if a profiling point is visited for the first time in the current scope.
-
参数
-
-
返回
-
True or false.
◆
AddSample()
Adds a sample to a profiling point in the current scope.
A profiling point may be visited multiple times during execution, e.g. within a loop. Every encounter records a time measurement sample, which is added to the scope point, and is used to calculate the total and average time for all captured samples. Points of METHOD_ENTER or SCOPE_ENTER types capture the total scope time for every sample, allowing to report the average scope time as well.
-
参数
-
◆
AddPointSample()
[1/2]
Adds a profiling point to the current scope and registers a sample.
A profiling point is declared by using a PROFILER macro with an optional output string to be printed with the trace report. If present, the string is recorded the first time a profiling point is visited per scope.
The following example gets the global profiler, configures it to use a simulated clock (to force the captured time values to be constant) and defines profiling points to run the following sequence:
ME 5ms SE loop5x{ 10ms D } 5ms SL ML
where:
-
ME = METHOD_ENTER
-
#ms = time delta in milliseconds
-
SE = SCOPE_ENTER
-
D = DELTA
-
SL = SCOPE_LEAVE
-
ML = METHOD_LEAVE
static
void
MyMethod()
{
maxon::Profiler
& profiler = *maxon::ProfilerInstance();
// capture all profiling point types
profiler.
SetEnableState
(
maxon::PROFILER_STATE::ENABLED_ALL
);
// use simulated clock
profiler.
SetClockMode
(
maxon::PROFILER_CLOCK_MODE::SIMULATED
);
// set sample processing simulated time (in milliseconds)
profiler.
SetClockSampleProcessTime
(5);
// set the time filtering threshold
profiler.
SetTimeFilter
(0);
PROFILER_METHOD
();
profiler.
AddClockMilliseconds
(5);
PROFILER_SCOPE_ENTER
(
"Number of loops: 5"
_s);
for
(
Int32
index = 0; index < 5; index++)
{
profiler.
AddClockMilliseconds
(10);
PROFILER_DELTA
();
}
profiler.
AddClockMilliseconds
(5);
PROFILER_SCOPE_LEAVE
();
profiler.
OutputStringReport
(
"MyMethod - Profile trace dump"
_s);
}
Produces the following output:
MyMethod - Profile trace dump (8 samples in 4 points) [>] 60.0 ms (100.00%), 0.00 ns (0.00% profiler) : METHOD_ENTER: MyMethod (line 304) [0] 5.0 ms (8.33%) [0] 55.0 ms (91.67%), 80.00 ms (31.25% profiler): SCOPE_ENTER: MyMethod (line 308) - Number of loops: 5 [1] 50.0 ms (90.91%) avg: 10.0 ms (5 samples): DELTA: MyMethod (line 314) [1] 5.0 ms (9.09%): SCOPE_LEAVE: MyMethod (line 319)
-
参数
-
[in]
|
profilingPoint
|
ProfilingPoint
reference.
|
[in]
|
outputString
|
Optional string to be printed when outputting a report.
|
◆
AddPointSample()
[2/2]
◆
OutputString()
Outputs a string to the debugger output and the C4D console profiler logger.
-
参数
-
◆
OutputStringReport()
Outputs a profiling trace to the debugger output and the C4D console profiler logger.
-
参数
-
[in]
|
headerString
|
Header string to output first.
|
◆
GetClockMode()
Gets the profiler clock mode.
-
返回
-
State: NORMAL, SIMULATED
◆
SetClockMode()
Sets the profiler clock mode.
-
参数
-
[in]
|
clockMode
|
State: NORMAL, SIMULATED
|
◆
SetClock()
Sets the profiler simulated clock time value.
◆
SetClockMilliseconds()
Sets the profiler simulated clock to a time value in milliseconds.
◆
GetClockSampleProcessTime()
Gets the profiler simulated clock time to process a sample in milliseconds.
-
返回
-
Sample process time
◆
SetClockSampleProcessTime()
Sets the profiler simulated clock time to process a sample.
◆
GetClockAutoIncrementTime()
Gets the profiler simulated clock automatic time increment.
-
返回
-
Clock automatic time increment value
◆
SetClockAutoIncrementTime()
Sets the profiler simulated clock automatic time increment.
◆
AddClock()
Adds a time value to the profiler simulated clock.
◆
AddClockMilliseconds()
Adds a time delta in milliseconds to the profiler simulated clock.
◆
GetTimeFilter()
Gets the time filter threshold value in milliseconds.
-
返回
-
Time filter threshold value.
◆
SetTimeFilter()
Sets the time filter threshold value in milliseconds.
-
参数
-
◆
GetLock()
Get a lock on the profiler.
◆
ReleaseLock()
Releases a lock on the profiler.
#define PROFILER_SCOPE_LEAVE(...)
定义:
profiler.h:423
MAXON_METHOD void SetClockSampleProcessTime(UInt32 milliseconds)
Sets the profiler simulated clock time to process a sample.
#define PROFILER_SCOPE_ENTER(...)
定义:
profiler.h:422
@ ENABLED_ALL
Enabled for all point types.
@ SIMULATED
Use a simulated clock for profiling purpose.
MAXON_METHOD void SetEnableState(PROFILER_STATE state)
MAXON_METHOD void AddClockMilliseconds(UInt32 milliseconds)
Adds a time delta in milliseconds to the profiler simulated clock.
MAXON_METHOD void SetTimeFilter(UInt32 threshold)
MAXON_METHOD void SetClockMode(PROFILER_CLOCK_MODE clockMode)
Internal.
定义:
profiler.h:59
#define PROFILER_DELTA(...)
定义:
profiler.h:424
maxon::Int32 Int32
定义:
ge_sys_math.h:58
MAXON_METHOD void OutputStringReport(const String &headerString)
#define PROFILER_METHOD(...)
定义:
profiler.h:427