docs
Loading...
Searching...
No Matches
CAPI_Profiler.h

Overview

User-defined profiling interface.

#include <Ultralight/CAPI/CAPI_Profiler.h>

When set, the library emits structured timing data (scopes, events, counters) at key internal boundaries that can be forwarded to any profiling tool or trace format.

This is intended to be implemented by users and set before creating the Renderer. The profiler must outlive the Renderer/App.

See also
ulPlatformSetProfiler()

Classes

struct  ULProfiler

Typedefs

typedef void(*) ULProfilerBeginScopeCallback(const char *name)
 The callback invoked when the library enters a named profiling scope.
typedef void(*) ULProfilerEndScopeCallback(void)
 The callback invoked when the library exits the most recently entered scope.
typedef void(*) ULProfilerBeginFrameCallback(uint64_t frame_id)
 The callback invoked when a new rendering frame begins.
typedef void(*) ULProfilerEndFrameCallback(void)
 The callback invoked when a rendering frame ends.
typedef void(*) ULProfilerEmitEventCallback(const char *name, const char *detail)
 The callback invoked for instant (point-in-time) annotations.
typedef void(*) ULProfilerEmitCounterCallback(const char *name, int64_t value)
 The callback invoked for counter/gauge updates.
typedef uint64_t(*) ULProfilerBeginEventCallback(const char *name, const char *detail)
 The callback invoked when an async event begins.
typedef void(*) ULProfilerEndEventCallback(uint64_t id)
 The callback invoked when an async event ends.

Typedef Documentation

◆ ULProfilerBeginEventCallback

typedef uint64_t(*) ULProfilerBeginEventCallback(const char *name, const char *detail)

The callback invoked when an async event begins.

Parameters
nameStatic string literal identifying the event type.
detailOptional detail string (may be NULL).
Returns
Implementation-defined event ID (passed to end_event to close). Must be non-zero.

◆ ULProfilerBeginFrameCallback

typedef void(*) ULProfilerBeginFrameCallback(uint64_t frame_id)

The callback invoked when a new rendering frame begins.

Called automatically by the library.

Parameters
frame_idMonotonic frame counter.

◆ ULProfilerBeginScopeCallback

typedef void(*) ULProfilerBeginScopeCallback(const char *name)

The callback invoked when the library enters a named profiling scope.

Parameters
nameStatic string literal identifying the scope (e.g., "Ultralight.Layout"). Pointer is stable for the lifetime of the library.

◆ ULProfilerEmitCounterCallback

typedef void(*) ULProfilerEmitCounterCallback(const char *name, int64_t value)

The callback invoked for counter/gauge updates.

Parameters
nameStatic string literal identifying the counter.
valueCurrent value of the counter.

◆ ULProfilerEmitEventCallback

typedef void(*) ULProfilerEmitEventCallback(const char *name, const char *detail)

The callback invoked for instant (point-in-time) annotations.

Parameters
nameStatic string literal identifying the event.
detailOptional detail string (may be NULL).

◆ ULProfilerEndEventCallback

typedef void(*) ULProfilerEndEventCallback(uint64_t id)

The callback invoked when an async event ends.

Parameters
idThe event ID returned by begin_event.

◆ ULProfilerEndFrameCallback

typedef void(*) ULProfilerEndFrameCallback(void)

The callback invoked when a rendering frame ends.

Called automatically by the library.

◆ ULProfilerEndScopeCallback

typedef void(*) ULProfilerEndScopeCallback(void)

The callback invoked when the library exits the most recently entered scope.

Go to the source code of this file.