diff options
Diffstat (limited to 'trace2/tr2_tgt.h')
-rw-r--r-- | trace2/tr2_tgt.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/trace2/tr2_tgt.h b/trace2/tr2_tgt.h index 65f94e1..1f626cf 100644 --- a/trace2/tr2_tgt.h +++ b/trace2/tr2_tgt.h @@ -4,6 +4,12 @@ struct child_process; struct repository; struct json_writer; +struct tr2_timer_metadata; +struct tr2_timer; +struct tr2_counter_metadata; +struct tr2_counter; + +#define NS_TO_SEC(ns) ((double)(ns) / 1.0e9) /* * Function prototypes for a TRACE2 "target" vtable. @@ -63,8 +69,10 @@ typedef void(tr2_tgt_evt_exec_result_fl_t)(const char *file, int line, uint64_t us_elapsed_absolute, int exec_id, int code); +struct key_value_info; typedef void(tr2_tgt_evt_param_fl_t)(const char *file, int line, - const char *param, const char *value); + const char *param, const char *value, + const struct key_value_info *kvi); typedef void(tr2_tgt_evt_repo_fl_t)(const char *file, int line, const struct repository *repo); @@ -96,6 +104,14 @@ typedef void(tr2_tgt_evt_printf_va_fl_t)(const char *file, int line, uint64_t us_elapsed_absolute, const char *fmt, va_list ap); +typedef void(tr2_tgt_evt_timer_t)(const struct tr2_timer_metadata *meta, + const struct tr2_timer *timer, + int is_final_data); + +typedef void(tr2_tgt_evt_counter_t)(const struct tr2_counter_metadata *meta, + const struct tr2_counter *counter, + int is_final_data); + /* * "vtable" for a TRACE2 target. Use NULL if a target does not want * to emit that message. @@ -132,6 +148,8 @@ struct tr2_tgt { tr2_tgt_evt_data_fl_t *pfn_data_fl; tr2_tgt_evt_data_json_fl_t *pfn_data_json_fl; tr2_tgt_evt_printf_va_fl_t *pfn_printf_va_fl; + tr2_tgt_evt_timer_t *pfn_timer; + tr2_tgt_evt_counter_t *pfn_counter; }; /* clang-format on */ |