git-commit-vandalism/Documentation/config/trace2.txt
Josh Steadmon 83e57b04e6 trace2: discard new traces if target directory has too many files
trace2 can write files into a target directory. With heavy usage, this
directory can fill up with files, causing difficulty for
trace-processing systems.

This patch adds a config option (trace2.maxFiles) to set a maximum
number of files that trace2 will write to a target directory. The
following behavior is enabled when the maxFiles is set to a positive
integer:
  When trace2 would write a file to a target directory, first check
  whether or not the traces should be discarded. Traces should be
  discarded if:
    * there is a sentinel file declaring that there are too many files
    * OR, the number of files exceeds trace2.maxFiles.
  In the latter case, we create a sentinel file named git-trace2-discard
  to speed up future checks.

The assumption is that a separate trace-processing system is dealing
with the generated traces; once it processes and removes the sentinel
file, it should be safe to generate new trace files again.

The default value for trace2.maxFiles is zero, which disables the file
count check.

The config can also be overridden with a new environment variable:
GIT_TRACE2_MAX_FILES.

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-10-05 17:53:51 +09:00

63 lines
2.5 KiB
Plaintext

Trace2 config settings are only read from the system and global
config files; repository local and worktree config files and `-c`
command line arguments are not respected.
trace2.normalTarget::
This variable controls the normal target destination.
It may be overridden by the `GIT_TRACE2` environment variable.
The following table shows possible values.
trace2.perfTarget::
This variable controls the performance target destination.
It may be overridden by the `GIT_TRACE2_PERF` environment variable.
The following table shows possible values.
trace2.eventTarget::
This variable controls the event target destination.
It may be overridden by the `GIT_TRACE2_EVENT` environment variable.
The following table shows possible values.
+
include::../trace2-target-values.txt[]
trace2.normalBrief::
Boolean. When true `time`, `filename`, and `line` fields are
omitted from normal output. May be overridden by the
`GIT_TRACE2_BRIEF` environment variable. Defaults to false.
trace2.perfBrief::
Boolean. When true `time`, `filename`, and `line` fields are
omitted from PERF output. May be overridden by the
`GIT_TRACE2_PERF_BRIEF` environment variable. Defaults to false.
trace2.eventBrief::
Boolean. When true `time`, `filename`, and `line` fields are
omitted from event output. May be overridden by the
`GIT_TRACE2_EVENT_BRIEF` environment variable. Defaults to false.
trace2.eventNesting::
Integer. Specifies desired depth of nested regions in the
event output. Regions deeper than this value will be
omitted. May be overridden by the `GIT_TRACE2_EVENT_NESTING`
environment variable. Defaults to 2.
trace2.configParams::
A comma-separated list of patterns of "important" config
settings that should be recorded in the trace2 output.
For example, `core.*,remote.*.url` would cause the trace2
output to contain events listing each configured remote.
May be overridden by the `GIT_TRACE2_CONFIG_PARAMS` environment
variable. Unset by default.
trace2.destinationDebug::
Boolean. When true Git will print error messages when a
trace target destination cannot be opened for writing.
By default, these errors are suppressed and tracing is
silently disabled. May be overridden by the
`GIT_TRACE2_DST_DEBUG` environment variable.
trace2.maxFiles::
Integer. When writing trace files to a target directory, do not
write additional traces if we would exceed this many files. Instead,
write a sentinel file that will block further tracing to this
directory. Defaults to 0, which disables this check.