#include <profiler.h>
Internal.
Static Public Member Functions | |
static const Profiler & | NullValueRef () |
Private Member Functions | |
MAXON_INTERFACE_NONVIRTUAL (Profiler, MAXON_REFERENCE_NONE, "net.maxon.interface.profiler") | |
|
private |
|
static |
MAXON_METHOD UInt32 GetSampleCount | ( | ) |
Gets the count of captured samples.
MAXON_METHOD void Reset | ( | ) |
Resets the profiler.
MAXON_METHOD Bool GetDebugDumpEnabled | ( | ) |
Gets the profiler debug dump enabled state.
MAXON_METHOD void SetDebugDumpEnabled | ( | Bool | state | ) |
Sets the profiler debug dump enabled state.
[in] | state | True if enabled, false otherwise. |
MAXON_METHOD PROFILER_STATE GetEnableState | ( | ) |
Gets the profiler state.
MAXON_METHOD void SetEnableState | ( | PROFILER_STATE | state | ) |
Sets the profiler state.
[in] | state | State: DISABLED, ENABLED_METHOD_SCOPE, ENABLED_ALL |
MAXON_METHOD Bool GetEnableState | ( | const ProfilingPoint & | profilingPoint | ) |
Gets the enabled state of a profiling point.
MAXON_METHOD void 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.
MAXON_METHOD Bool IsFirstTime | ( | const ProfilingPoint & | profilingPoint | ) |
Indicates if a profiling point is visited for the first time in the current scope.
[in] | profilingPoint | ProfilingPoint reference. |
MAXON_METHOD void AddSample | ( | const ProfilingPoint & | profilingPoint | ) |
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.
[in] | profilingPoint | ProfilingPoint reference. |
MAXON_METHOD void AddPointSample | ( | const ProfilingPoint & | profilingPoint, |
const Char * | outputString = nullptr |
||
) |
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:
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. |
MAXON_METHOD void AddPointSample | ( | const ProfilingPoint & | profilingPoint, |
const String & | outputString | ||
) |
MAXON_METHOD void OutputString | ( | String & | string | ) |
Outputs a string to the debugger output and the C4D console profiler logger.
[in] | string | String to output. |
MAXON_METHOD void OutputStringReport | ( | const String & | headerString | ) |
Outputs a profiling trace to the debugger output and the C4D console profiler logger.
[in] | headerString | Header string to output first. |
MAXON_METHOD PROFILER_CLOCK_MODE GetClockMode | ( | ) |
Gets the profiler clock mode.
MAXON_METHOD void SetClockMode | ( | PROFILER_CLOCK_MODE | clockMode | ) |
Sets the profiler clock mode.
[in] | clockMode | State: NORMAL, SIMULATED |
MAXON_METHOD void SetClock | ( | TimeValue | timeValue | ) |
Sets the profiler simulated clock time value.
MAXON_METHOD void SetClockMilliseconds | ( | UInt32 | milliseconds | ) |
Sets the profiler simulated clock to a time value in milliseconds.
MAXON_METHOD UInt32 GetClockSampleProcessTime | ( | ) |
Gets the profiler simulated clock time to process a sample in milliseconds.
MAXON_METHOD void SetClockSampleProcessTime | ( | UInt32 | milliseconds | ) |
Sets the profiler simulated clock time to process a sample.
MAXON_METHOD UInt32 GetClockAutoIncrementTime | ( | ) |
Gets the profiler simulated clock automatic time increment.
MAXON_METHOD void SetClockAutoIncrementTime | ( | UInt32 | milliseconds | ) |
Sets the profiler simulated clock automatic time increment.
MAXON_METHOD void AddClock | ( | TimeValue | timeValue | ) |
Adds a time value to the profiler simulated clock.
MAXON_METHOD void AddClockMilliseconds | ( | UInt32 | milliseconds | ) |
Adds a time delta in milliseconds to the profiler simulated clock.
MAXON_METHOD UInt32 GetTimeFilter | ( | ) |
Gets the time filter threshold value in milliseconds.
MAXON_METHOD void SetTimeFilter | ( | UInt32 | threshold | ) |
Sets the time filter threshold value in milliseconds.
[in] | threshold | State. |
MAXON_METHOD void GetLock | ( | ) |
Get a lock on the profiler.
MAXON_METHOD void ReleaseLock | ( | ) |
Releases a lock on the profiler.