tildefriends/src/trace.h
2023-02-01 23:20:16 +00:00

25 lines
882 B
C

#pragma once
#include <inttypes.h>
#include <stddef.h>
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);
void tf_trace_set_process_name(tf_trace_t* trace, const char* name);
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);
typedef void (tf_trace_write_callback_t)(tf_trace_t* trace, const char* buffer, size_t size, void* user_data);
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);
void tf_trace_sqlite(tf_trace_t* trace, sqlite3* sqlite);