git/trace2/tr2_tgt_event.c

#include "git-compat-util.h"
#include "config.h"
#include "json-writer.h"
#include "repository.h"
#include "run-command.h"
#include "version.h"
#include "trace2/tr2_dst.h"
#include "trace2/tr2_tbuf.h"
#include "trace2/tr2_sid.h"
#include "trace2/tr2_sysenv.h"
#include "trace2/tr2_tgt.h"
#include "trace2/tr2_tls.h"
#include "trace2/tr2_tmr.h"

static struct tr2_dst tr2dst_event =;

/*
 * The version number of the JSON data generated by the EVENT target in this
 * source file. The version should be incremented if new event types are added,
 * if existing fields are removed, or if there are significant changes in
 * interpretation of existing events or fields. Smaller changes, such as adding
 * a new field to an existing event, do not require an increment to the EVENT
 * format version.
 */
#define TR2_EVENT_VERSION

/*
 * Region nesting limit for messages written to the event target.
 *
 * The "region_enter" and "region_leave" messages (especially recursive
 * messages such as those produced while diving the worktree or index)
 * are primarily intended for the performance target during debugging.
 *
 * Some of the outer-most messages, however, may be of interest to the
 * event target.  Use the TR2_SYSENV_EVENT_NESTING setting to increase
 * region details in the event target.
 */
static int tr2env_event_max_nesting_levels =;

/*
 * Use the TR2_SYSENV_EVENT_BRIEF to omit the <time>, <file>, and
 * <line> fields from most events.
 */
static int tr2env_event_be_brief;

static int fn_init(void)
{}

static void fn_term(void)
{}

/*
 * Append common key-value pairs to the currently open JSON object.
 *     "event:"<event_name>"
 *      "sid":"<sid>"
 *   "thread":"<thread_name>"
 *     "time":"<time>"
 *     "file":"<filename>"
 *     "line":<line_number>
 *     "repo":<repo_id>
 */
static void event_fmt_prepare(const char *event_name, const char *file,
			      int line, const struct repository *repo,
			      struct json_writer *jw)
{}

static void fn_too_many_files_fl(const char *file, int line)
{}

static void fn_version_fl(const char *file, int line)
{}

static void fn_start_fl(const char *file, int line,
			uint64_t us_elapsed_absolute, const char **argv)
{}

static void fn_exit_fl(const char *file, int line, uint64_t us_elapsed_absolute,
		       int code)
{}

static void fn_signal(uint64_t us_elapsed_absolute, int signo)
{}

static void fn_atexit(uint64_t us_elapsed_absolute, int code)
{}

static void maybe_add_string_va(struct json_writer *jw, const char *field_name,
				const char *fmt, va_list ap)
{}

static void fn_error_va_fl(const char *file, int line, const char *fmt,
			   va_list ap)
{}

static void fn_command_path_fl(const char *file, int line, const char *pathname)
{}

static void fn_command_ancestry_fl(const char *file, int line, const char **parent_names)
{}

static void fn_command_name_fl(const char *file, int line, const char *name,
			       const char *hierarchy)
{}

static void fn_command_mode_fl(const char *file, int line, const char *mode)
{}

static void fn_alias_fl(const char *file, int line, const char *alias,
			const char **argv)
{}

static void fn_child_start_fl(const char *file, int line,
			      uint64_t us_elapsed_absolute UNUSED,
			      const struct child_process *cmd)
{}

static void fn_child_exit_fl(const char *file, int line,
			     uint64_t us_elapsed_absolute UNUSED,
			     int cid, int pid,
			     int code, uint64_t us_elapsed_child)
{}

static void fn_child_ready_fl(const char *file, int line,
			      uint64_t us_elapsed_absolute UNUSED,
			      int cid, int pid,
			      const char *ready, uint64_t us_elapsed_child)
{}

static void fn_thread_start_fl(const char *file, int line,
			       uint64_t us_elapsed_absolute UNUSED)
{}

static void fn_thread_exit_fl(const char *file, int line,
			      uint64_t us_elapsed_absolute UNUSED,
			      uint64_t us_elapsed_thread)
{}

static void fn_exec_fl(const char *file, int line,
		       uint64_t us_elapsed_absolute UNUSED,
		       int exec_id, const char *exe, const char **argv)
{}

static void fn_exec_result_fl(const char *file, int line,
			      uint64_t us_elapsed_absolute UNUSED,
			      int exec_id, int code)
{}

static void fn_param_fl(const char *file, int line, const char *param,
			const char *value, const struct key_value_info *kvi)
{}

static void fn_repo_fl(const char *file, int line,
		       const struct repository *repo)
{}

static void fn_region_enter_printf_va_fl(const char *file, int line,
					 uint64_t us_elapsed_absolute UNUSED,
					 const char *category,
					 const char *label,
					 const struct repository *repo,
					 const char *fmt, va_list ap)
{}

static void fn_region_leave_printf_va_fl(
	const char *file, int line, uint64_t us_elapsed_absolute UNUSED,
	uint64_t us_elapsed_region, const char *category, const char *label,
	const struct repository *repo, const char *fmt, va_list ap)
{}

static void fn_data_fl(const char *file, int line, uint64_t us_elapsed_absolute,
		       uint64_t us_elapsed_region, const char *category,
		       const struct repository *repo, const char *key,
		       const char *value)
{}

static void fn_data_json_fl(const char *file, int line,
			    uint64_t us_elapsed_absolute,
			    uint64_t us_elapsed_region, const char *category,
			    const struct repository *repo, const char *key,
			    const struct json_writer *value)
{}

static void fn_printf_va_fl(const char *file, int line,
			    uint64_t us_elapsed_absolute,
			    const char *fmt, va_list ap)
{}

static void fn_timer(const struct tr2_timer_metadata *meta,
		     const struct tr2_timer *timer,
		     int is_final_data)
{}

static void fn_counter(const struct tr2_counter_metadata *meta,
		       const struct tr2_counter *counter,
		       int is_final_data)
{}

struct tr2_tgt tr2_tgt_event =;