IProfiler#

class carb.profiler.IProfiler#

Bases: pybind11_object

Interface to control the Carbonite profiler and emit profiling data.

Methods

__init__(*args, **kwargs)

begin(self, mask, name)

Begins a profiling zone with a name.

end(self, mask)

Ends the current profiling zone.

ensure_thread(self)

Ensures that the profiler is aware of a Python thread.

flow(self, arg0, arg1, arg2, arg3)

Emits a flow marker connecting two events across time/threads.

frame(self, arg0, arg1)

Inserts a frame marker for the calling thread.

get_capture_mask(self)

Gets the current capture mask.

instant(self, arg0, arg1, arg2)

Emits an instant event.

is_python_profiling_enabled(self)

Returns whether Python cProfile-level profiling is enabled.

set_capture_mask(self, mask)

Sets the capture mask; returns previous mask.

set_python_profiling_enabled(self, enable)

Enables or disables cProfile-level Python profiling.

shutdown(self)

Shuts down the profiler.

startup(self)

Starts up the profiler.

value_float(self, mask, value, name)

Sends a float value sample to the profiler.

value_int(self, mask, value, name)

Sends a signed integer value sample to the profiler.

value_uint(self, mask, value, name)

Sends an unsigned integer value sample to the profiler.

__init__(*args, **kwargs)#
begin(
self: carb.profiler._profiler.IProfiler,
mask: int,
name: str,
) None#

Begins a profiling zone with a name.

end(
self: carb.profiler._profiler.IProfiler,
mask: int,
) None#

Ends the current profiling zone.

ensure_thread(
self: carb.profiler._profiler.IProfiler,
) None#

Ensures that the profiler is aware of a Python thread.

If the profiler is already aware of the Python thread, there is no effect.

Parameters:

None

Returns:

None

flow(
self: carb.profiler._profiler.IProfiler,
arg0: int,
arg1: carb.profiler._profiler.FlowType,
arg2: int,
arg3: str,
) None#

Emits a flow marker connecting two events across time/threads.

frame(
self: carb.profiler._profiler.IProfiler,
arg0: int,
arg1: str,
) None#

Inserts a frame marker for the calling thread.

get_capture_mask(
self: carb.profiler._profiler.IProfiler,
) int#

Gets the current capture mask.

instant(
self: carb.profiler._profiler.IProfiler,
arg0: int,
arg1: carb.profiler._profiler.InstantType,
arg2: str,
) None#

Emits an instant event.

is_python_profiling_enabled(
self: carb.profiler._profiler.IProfiler,
) bool#

Returns whether Python cProfile-level profiling is enabled.

Returns:

True if Python function profiling is enabled, False otherwise.

set_capture_mask(
self: carb.profiler._profiler.IProfiler,
mask: int,
) int#

Sets the capture mask; returns previous mask.

set_python_profiling_enabled(
self: carb.profiler._profiler.IProfiler,
enable: bool,
) None#

Enables or disables cProfile-level Python profiling.

Enabling this value causes every Python function call to be recorded through carb.profiler. As such, it can negatively affect performance and can lead to very large profiler files.

Only Python threads that carb.profiler is aware of will report to the profiler. Calling ensure_thread() will ensure that carb.profiler is aware of a Python thread.

Use is_python_profiling_enabled() to determine the current state of this value.

Parameters:

enable – True to enable the profiler or False to disable.

Returns:

None

shutdown(self: carb.profiler._profiler.IProfiler) None#

Shuts down the profiler.

startup(self: carb.profiler._profiler.IProfiler) None#

Starts up the profiler.

value_float(
self: carb.profiler._profiler.IProfiler,
mask: int,
value: float,
name: str,
) None#

Sends a float value sample to the profiler.

value_int(
self: carb.profiler._profiler.IProfiler,
mask: int,
value: int,
name: str,
) None#

Sends a signed integer value sample to the profiler.

value_uint(
self: carb.profiler._profiler.IProfiler,
mask: int,
value: int,
name: str,
) None#

Sends an unsigned integer value sample to the profiler.