2021-01-02 13:10:00 -05:00
|
|
|
#pragma once
|
|
|
|
|
2024-02-20 21:41:37 -05:00
|
|
|
/**
|
|
|
|
** \defgroup trace Performance Tracing
|
|
|
|
** Generates trace output that is compatible with speedscope.app,
|
|
|
|
** chrome://tracing or ui.perfetto.dev for scrutining what each thread is doing
|
|
|
|
** for optimization purposes.
|
|
|
|
** @{
|
|
|
|
*/
|
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
#include <inttypes.h>
|
2022-01-02 13:17:58 -05:00
|
|
|
#include <stddef.h>
|
2021-01-02 13:10:00 -05:00
|
|
|
|
|
|
|
typedef struct _tf_trace_t tf_trace_t;
|
|
|
|
typedef struct sqlite3 sqlite3;
|
|
|
|
|
|
|
|
tf_trace_t* tf_trace_create();
|
|
|
|
void tf_trace_destroy(tf_trace_t* trace);
|
|
|
|
|
2023-02-01 18:20:16 -05:00
|
|
|
void tf_trace_set_process_name(tf_trace_t* trace, const char* name);
|
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
void tf_trace_counter(tf_trace_t* trace, const char* name, int argc, const char** arg_names, const int64_t* arg_values);
|
|
|
|
void tf_trace_begin(tf_trace_t* trace, const char* name);
|
|
|
|
void tf_trace_end(tf_trace_t* trace);
|
|
|
|
|
|
|
|
char* tf_trace_export(tf_trace_t* trace);
|
|
|
|
|
2024-02-15 18:35:01 -05:00
|
|
|
typedef void(tf_trace_write_callback_t)(tf_trace_t* trace, const char* buffer, size_t size, void* user_data);
|
2022-01-02 13:17:58 -05:00
|
|
|
void tf_trace_set_write_callback(tf_trace_t* trace, tf_trace_write_callback_t* callback, void* user_data);
|
|
|
|
void tf_trace_raw(tf_trace_t* trace, const char* buffer, size_t size);
|
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
void tf_trace_sqlite(tf_trace_t* trace, sqlite3* sqlite);
|
2024-02-20 21:41:37 -05:00
|
|
|
|
|
|
|
/** @} */
|