git/trace2/tr2_dst.c

#include "git-compat-util.h"
#include "abspath.h"
#include "sigchain.h"
#include "strbuf.h"
#include "trace2/tr2_dst.h"
#include "trace2/tr2_sid.h"
#include "trace2/tr2_sysenv.h"

/*
 * How many attempts we will make at creating an automatically-named trace file.
 */
#define MAX_AUTO_ATTEMPTS

/*
 * Sentinel file used to detect when we should discard new traces to avoid
 * writing too many trace files to a directory.
 */
#define DISCARD_SENTINEL_NAME

/*
 * When set to zero, disables directory file count checks. Otherwise, controls
 * how many files we can write to a directory before entering discard mode.
 * This can be overridden via the TR2_SYSENV_MAX_FILES setting.
 */
static int tr2env_max_files =;

static int tr2_dst_want_warning(void)
{}

void tr2_dst_trace_disable(struct tr2_dst *dst)
{}

/*
 * Check to make sure we're not overloading the target directory with too many
 * files. First get the threshold (if present) from the config or envvar. If
 * it's zero or unset, disable this check. Next check for the presence of a
 * sentinel file, then check file count.
 *
 * Returns 0 if tracing should proceed as normal. Returns 1 if the sentinel file
 * already exists, which means tracing should be disabled. Returns -1 if there
 * are too many files but there was no sentinel file, which means we have
 * created and should write traces to the sentinel file.
 *
 * We expect that some trace processing system is gradually collecting files
 * from the target directory; after it removes the sentinel file we'll start
 * writing traces again.
 */
static int tr2_dst_too_many_files(struct tr2_dst *dst, const char *tgt_prefix)
{}

static int tr2_dst_try_auto_path(struct tr2_dst *dst, const char *tgt_prefix)
{}

static int tr2_dst_try_path(struct tr2_dst *dst, const char *tgt_value)
{}

#ifndef NO_UNIX_SOCKETS
#define PREFIX_AF_UNIX
#define PREFIX_AF_UNIX_STREAM
#define PREFIX_AF_UNIX_DGRAM

static int tr2_dst_try_uds_connect(const char *path, int sock_type, int *out_fd)
{}

#define TR2_DST_UDS_TRY_STREAM
#define TR2_DST_UDS_TRY_DGRAM

static int tr2_dst_try_unix_domain_socket(struct tr2_dst *dst,
					  const char *tgt_value)
{}
#endif

static void tr2_dst_malformed_warning(struct tr2_dst *dst,
				      const char *tgt_value)
{}

int tr2_dst_get_trace_fd(struct tr2_dst *dst)
{}

int tr2_dst_trace_want(struct tr2_dst *dst)
{}

void tr2_dst_write_line(struct tr2_dst *dst, struct strbuf *buf_line)
{}