|
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) |
|
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) |
|
Generates trace output that is compatible with speedscope.app, chrome://tracing or ui.perfetto.dev for scrutinizing what each thread is doing for optimization purposes.
◆ sqlite3
An SQLite database instance.
◆ tf_trace_t
◆ tf_trace_write_callback_t
typedef void() tf_trace_write_callback_t(tf_trace_t *trace, const char *buffer, size_t size, void *user_data) |
A callback to collect trace data.
- Parameters
-
trace | The trace instance. |
buffer | The trace data. |
size | The size of the trace data. |
user_data | User data registered with the callback. |
◆ tf_trace_begin()
void tf_trace_begin |
( |
tf_trace_t * |
trace, |
|
|
const char * |
name |
|
) |
| |
Begin tracing a time interval. End with tf_trace_end().
- Parameters
-
trace | The trace instance. |
name | The interval name. |
◆ tf_trace_counter()
void tf_trace_counter |
( |
tf_trace_t * |
trace, |
|
|
const char * |
name, |
|
|
int |
argc, |
|
|
const char ** |
arg_names, |
|
|
const int64_t * |
arg_values |
|
) |
| |
Record counter values.
- Parameters
-
trace | The trace instance. |
name | The counter group name. |
argc | The number of counters. |
arg_names | The counter names. |
arg_values | The counter values. |
◆ tf_trace_create()
Create a trace instance. Can be used to produce a Chrome trace event document for analyzing performance. Clean up with tf_trace_destroy().
- Returns
- A trace instance.
◆ tf_trace_destroy()
◆ tf_trace_end()
End tracing the next time interval previously started with tf_trace_begin().
- Parameters
-
◆ tf_trace_export()
Export all currently stored trace data to a string.
- Parameters
-
- Returns
- A string representation of the trace data.
◆ tf_trace_raw()
void tf_trace_raw |
( |
tf_trace_t * |
trace, |
|
|
const char * |
buffer, |
|
|
size_t |
size |
|
) |
| |
Inject raw trace data.
- Parameters
-
trace | The trace instance. |
buffer | The trace data. |
size | The size of the trace data. |
◆ tf_trace_set_process_name()
void tf_trace_set_process_name |
( |
tf_trace_t * |
trace, |
|
|
const char * |
name |
|
) |
| |
Set the name of the current process.
- Parameters
-
trace | The trace instance. |
name | The name of the process. |
◆ tf_trace_set_write_callback()
Replace the trace recording behavior.
- Parameters
-
trace | The trace instance. |
callback | A callback that will be called instead of collecting the trace data in a buffer. |
user_data | User data to pass to the callback. |
◆ tf_trace_sqlite()
Register for trace-worthy events from sqlite and record them going forward.
- Parameters
-
trace | The trace instance. |
sqlite | The SQLite database. |