]> git.ipfire.org Git - thirdparty/git.git/commit - t/t0211-trace2-perf.sh
trace2: use system/global config for default trace2 settings
authorJeff Hostetler <jeffhost@microsoft.com>
Mon, 15 Apr 2019 20:39:47 +0000 (13:39 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 16 Apr 2019 04:37:06 +0000 (13:37 +0900)
commitbce9db6de97c95882a7c46836bb6cc90acf0fef0
tree30d7fd85d54b8d6acbf09a22b2e64467d84c794e
parent800a7f99a8776b18a48cf9c1b0f9418bf4644bbd
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>
14 files changed:
Makefile
t/t0210-trace2-normal.sh
t/t0211-trace2-perf.sh
t/t0212-trace2-event.sh
trace2.c
trace2.h
trace2/tr2_cfg.c
trace2/tr2_dst.c
trace2/tr2_dst.h
trace2/tr2_sysenv.c [new file with mode: 0644]
trace2/tr2_sysenv.h [new file with mode: 0644]
trace2/tr2_tgt_event.c
trace2/tr2_tgt_normal.c
trace2/tr2_tgt_perf.c