mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
800a7f99a8
commit
bce9db6de9
12
trace2.h
12
trace2.h
@@ -38,7 +38,8 @@ void trace2_initialize_clock(void);
|
||||
|
||||
/*
|
||||
* Initialize TRACE2 tracing facility if any of the builtin TRACE2
|
||||
* targets are enabled in the environment. Emits a 'version' event.
|
||||
* targets are enabled in the system config or the environment.
|
||||
* Emits a 'version' event.
|
||||
*
|
||||
* Cleanup/Termination is handled automatically by a registered
|
||||
* atexit() routine.
|
||||
@@ -125,10 +126,11 @@ void trace2_cmd_alias_fl(const char *file, int line, const char *alias,
|
||||
* Emit one or more 'def_param' events for "interesting" configuration
|
||||
* settings.
|
||||
*
|
||||
* The environment variable "GIT_TR2_CONFIG_PARAMS" can be set to a
|
||||
* list of patterns considered important. For example:
|
||||
*
|
||||
* GIT_TR2_CONFIG_PARAMS="core.*,remote.*.url"
|
||||
* Use the TR2_SYSENV_CFG_PARAM setting to register a comma-separated
|
||||
* list of patterns configured important. For example:
|
||||
* git config --system trace2.configParams 'core.*,remote.*.url'
|
||||
* or:
|
||||
* GIT_TR2_CONFIG_PARAMS=core.*,remote.*.url"
|
||||
*
|
||||
* Note: this routine does a read-only iteration on the config data
|
||||
* (using read_early_config()), so it must not be called until enough
|
||||
|
||||
Reference in New Issue
Block a user