git/trace2.c

#include "git-compat-util.h"
#include "config.h"
#include "repository.h"
#include "run-command.h"
#include "sigchain.h"
#include "thread-utils.h"
#include "trace.h"
#include "trace2.h"
#include "trace2/tr2_cfg.h"
#include "trace2/tr2_cmd_name.h"
#include "trace2/tr2_ctr.h"
#include "trace2/tr2_dst.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 int trace2_enabled;
static int trace2_redact =;

static int tr2_next_child_id; /* modify under lock */
static int tr2_next_exec_id; /* modify under lock */
static int tr2_next_repo_id =; /* modify under lock. zero is reserved */

/*
 * A table of the builtin TRACE2 targets.  Each of these may be independently
 * enabled or disabled.  Each TRACE2 API method will try to write an event to
 * *each* of the enabled targets.
 */
/* clang-format off */
static struct tr2_tgt *tr2_tgt_builtins[] =;
/* clang-format on */

/* clang-format off */
#define for_each_builtin(j, tgt_j)
/* clang-format on */

/* clang-format off */
#define for_each_wanted_builtin(j, tgt_j)
/* clang-format on */

/*
 * Force (rather than lazily) initialize any of the requested
 * builtin TRACE2 targets at startup (and before we've seen an
 * actual TRACE2 event call) so we can see if we need to setup
 * private data structures and thread-local storage.
 *
 * Return the number of builtin targets enabled.
 */
static int tr2_tgt_want_builtins(void)
{}

/*
 * Properly terminate each builtin target.  Give each target
 * a chance to write a summary event and/or flush if necessary
 * and then close the fd.
 */
static void tr2_tgt_disable_builtins(void)
{}

/*
 * The signature of this function must match the pfn_timer
 * method in the targets.  (Think of this is an apply operation
 * across the set of active targets.)
 */
static void tr2_tgt_emit_a_timer(const struct tr2_timer_metadata *meta,
				 const struct tr2_timer *timer,
				 int is_final_data)
{}

/*
 * The signature of this function must match the pfn_counter
 * method in the targets.
 */
static void tr2_tgt_emit_a_counter(const struct tr2_counter_metadata *meta,
				   const struct tr2_counter *counter,
				   int is_final_data)
{}

static int tr2main_exit_code;

/*
 * Our atexit routine should run after everything has finished.
 *
 * Note that events generated here might not actually appear if
 * we are writing to fd 1 or 2 and our atexit routine runs after
 * the pager's atexit routine (since it closes them to shutdown
 * the pipes).
 */
static void tr2main_atexit_handler(void)
{}

static void tr2main_signal_handler(int signo)
{}

void trace2_initialize_clock(void)
{}

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

int trace2_is_enabled(void)
{}

/*
 * Redacts an argument, i.e. ensures that no password in
 * https://user:password@host/-style URLs is logged.
 *
 * Returns the original if nothing needed to be redacted.
 * Returns a pointer that needs to be `free()`d otherwise.
 */
static const char *redact_arg(const char *arg)
{}

/*
 * Redacts arguments in an argument list.
 *
 * Returns the original if nothing needed to be redacted.
 * Otherwise, returns a new array that needs to be released
 * via `free_redacted_argv()`.
 */
static const char **redact_argv(const char **argv)
{}

static void free_redacted_argv(const char **redacted, const char **argv)
{}

void trace2_cmd_start_fl(const char *file, int line, const char **argv)
{}

void trace2_cmd_exit_fl(const char *file, int line, int code)
{}

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

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

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

void trace2_cmd_name_fl(const char *file, int line, const char *name)
{}

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

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

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

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

void trace2_cmd_set_config_fl(const char *file, int line, const char *key,
			      const char *value)
{}

void trace2_child_start_fl(const char *file, int line,
			   struct child_process *cmd)
{}

void trace2_child_exit_fl(const char *file, int line, struct child_process *cmd,
			  int child_exit_code)
{}

void trace2_child_ready_fl(const char *file, int line,
			   struct child_process *cmd,
			   const char *ready)
{}

int trace2_exec_fl(const char *file, int line, const char *exe,
		   const char **argv)
{}

void trace2_exec_result_fl(const char *file, int line, int exec_id, int code)
{}

void trace2_thread_start_fl(const char *file, int line, const char *thread_base_name)
{}

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

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

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

void trace2_region_enter_printf_va_fl(const char *file, int line,
				      const char *category, const char *label,
				      const struct repository *repo,
				      const char *fmt, va_list ap)
{}

void trace2_region_enter_fl(const char *file, int line, const char *category,
			    const char *label, const struct repository *repo, ...)
{}

void trace2_region_enter_printf_fl(const char *file, int line,
				   const char *category, const char *label,
				   const struct repository *repo,
				   const char *fmt, ...)
{}

void trace2_region_leave_printf_va_fl(const char *file, int line,
				      const char *category, const char *label,
				      const struct repository *repo,
				      const char *fmt, va_list ap)
{}

void trace2_region_leave_fl(const char *file, int line, const char *category,
			    const char *label, const struct repository *repo, ...)
{}

void trace2_region_leave_printf_fl(const char *file, int line,
				   const char *category, const char *label,
				   const struct repository *repo,
				   const char *fmt, ...)
{}

void trace2_data_string_fl(const char *file, int line, const char *category,
			   const struct repository *repo, const char *key,
			   const char *value)
{}

void trace2_data_intmax_fl(const char *file, int line, const char *category,
			   const struct repository *repo, const char *key,
			   intmax_t value)
{}

void trace2_data_json_fl(const char *file, int line, const char *category,
			 const struct repository *repo, const char *key,
			 const struct json_writer *value)
{}

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

void trace2_printf_fl(const char *file, int line, const char *fmt, ...)
{}

void trace2_timer_start(enum trace2_timer_id tid)
{}

void trace2_timer_stop(enum trace2_timer_id tid)
{}

void trace2_counter_add(enum trace2_counter_id cid, uint64_t value)
{}

const char *trace2_session_id(void)
{}