1
0
mirror of https://github.com/git/git.git synced 2024-09-29 20:13:27 +02:00
git/trace2/tr2_sysenv.h
Jeff Hostetler bce9db6de9 trace2: use system/global config for default trace2 settings
Teach git to read the system and global config files for
default Trace2 settings.  This allows system-wide Trace2 settings to
be installed and inherited to make it easier to manage a collection of
systems.

The original GIT_TR2* environment variables are loaded afterwards and
can be used to override the system settings.

Only the system and global config files are used.  Repo and worktree
local config files are ignored.  Likewise, the "-c" command line
arguments are also ignored.  These limits are for performance reasons.

(1) For users not using Trace2, there should be minimal overhead to
detect that Trace2 is not enabled.  In particular, Trace2 should not
allocate lots of otherwise unused data strucutres.

(2) For accurate performance measurements, Trace2 should be initialized
as early in the git process as possible, and before most of the normal
git process initialization (which involves discovering the .git directory
and reading a hierarchy of config files).

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-04-16 13:37:06 +09:00

37 lines
807 B
C

#ifndef TR2_SYSENV_H
#define TR2_SYSENV_H
/*
* The Trace2 settings that can be loaded from /etc/gitconfig
* and/or user environment variables.
*
* Note that this set does not contain any of the transient
* environment variables used to pass information from parent
* to child git processes, such "GIT_TR2_PARENT_SID".
*/
enum tr2_sysenv_variable {
TR2_SYSENV_CFG_PARAM = 0,
TR2_SYSENV_DST_DEBUG,
TR2_SYSENV_NORMAL,
TR2_SYSENV_NORMAL_BRIEF,
TR2_SYSENV_EVENT,
TR2_SYSENV_EVENT_BRIEF,
TR2_SYSENV_EVENT_NESTING,
TR2_SYSENV_PERF,
TR2_SYSENV_PERF_BRIEF,
TR2_SYSENV_MUST_BE_LAST
};
void tr2_sysenv_load(void);
const char *tr2_sysenv_get(enum tr2_sysenv_variable);
const char *tr2_sysenv_display_name(enum tr2_sysenv_variable var);
void tr2_sysenv_release(void);
#endif /* TR2_SYSENV_H */