LDKProfilerCounter
typedef struct LDKProfilerCounter{
volatile i32 id;
}LDKProfilerCounter;
typedef struct LDKProfilerCounter{
volatile i32 id;
}LDKProfilerCounter;
typedef struct LDKProfilerSource{
volatile i32 id;
}LDKProfilerSource;
#define LDK_PROFILE_BEGIN(name) \
LDK_PROFILE_BEGIN_IMPL(name, __LINE__)
#define LDK_PROFILE_BEGIN_IMPL(name, line) \
do\
{\
static LDKProfilerSource LDK_PROFILE_CONCAT(\
ldk_profiler_source_, line)={0};\
ldk_profiler_zone_begin_source(\
&LDK_PROFILE_CONCAT(ldk_profiler_source_, line), \
LDK_PROFILER_ZONE_USER, (name), __FILE__, __func__, (u32)(line));\
}while(0)
#define LDK_PROFILE_CONCAT(a, b) LDK_PROFILE_CONCAT_INNER(a, b)
#define LDK_PROFILE_CONCAT_INNER(a, b) a##b
#define LDK_PROFILE_COUNTER_ADD(name, value) \
LDK_PROFILE_COUNTER_ADD_IMPL(name, value, __LINE__)
#define LDK_PROFILE_COUNTER_ADD_IMPL(name, value, line) \
do\
{\
static LDKProfilerCounter LDK_PROFILE_CONCAT(\
ldk_profiler_counter_, line)={0};\
ldk_profiler_counter_add_source(\
&LDK_PROFILE_CONCAT(ldk_profiler_counter_, line), (name), \
(double)(value));\
}while(0)
#define LDK_PROFILE_COUNTER_SET(name, value) \
LDK_PROFILE_COUNTER_SET_IMPL(name, value, __LINE__)
#define LDK_PROFILE_COUNTER_SET_IMPL(name, value, line) \
do\
{\
static LDKProfilerCounter LDK_PROFILE_CONCAT(\
ldk_profiler_counter_, line)={0};\
ldk_profiler_counter_set_source(\
&LDK_PROFILE_CONCAT(ldk_profiler_counter_, line), (name), \
(double)(value));\
}while(0)
#define LDK_PROFILE_END() ldk_profiler_zone_end()
Collect the current profiler sample data.
LDK_API void ldk_profiler_capture_collect(bool enabled);
bool enabledCheck whether the profiler capture is active.
LDK_API bool ldk_profiler_capture_is_active(void);
True when the queried condition holds; false otherwise.
Get the profiler capture path.
LDK_API const char * ldk_profiler_capture_path_get(void);
Pointer to the requested object or data; NULL when unavailable.
Start the profiler capture.
LDK_API bool ldk_profiler_capture_start(const char *path);
const char *pathTrue if the operation succeeds; false otherwise.
Stop the profiler capture.
LDK_API void ldk_profiler_capture_stop(void);
Toggle profiler capture state.
LDK_API void ldk_profiler_capture_toggle(void);
Increment a profiler counter at a source location.
LDK_API void ldk_profiler_counter_add_source(
LDKProfilerCounter *counter,
const char *name,
double value
);
LDKProfilerCounter *counterconst char *namedouble valueAssign a profiler counter value at a source location.
LDK_API void ldk_profiler_counter_set_source(
LDKProfilerCounter *counter,
const char *name,
double value
);
LDKProfilerCounter *counterconst char *namedouble valueInitialize the profiler.
LDK_API bool ldk_profiler_initialize(const char *runtree_path);
const char *runtree_pathTrue if the operation succeeds; false otherwise.
Shut down the profiler.
LDK_API void ldk_profiler_terminate(void);
Set the profiler thread name.
LDK_API void ldk_profiler_thread_name_set(const char *name);
const char *name