@ -22,21 +22,41 @@ Targets are defined using a VTable allowing easy extension to other
@@ -22,21 +22,41 @@ Targets are defined using a VTable allowing easy extension to other
formats in the future. This might be used to define a binary format,
for example.
Trace2 is controlled using `trace2.*` config values in the system and
global config files and `GIT_TR2*` environment variables. Trace2 does
not read from repo local or worktree config files or respect `-c`
command line config settings.
== Trace2 Targets
Trace2 defines the following set of Trace2 Targets.
Format details are given in a later section.
`GIT_TR2` (NORMAL)::
=== The Normal Format Target
The normal format target is a tradition printf format and similar
to GIT_TRACE format. This format is enabled with the `GIT_TR`
environment variable or the `trace2.normalTarget` system or global
Enables the target, opens and writes to the file in append mode.
=== Enabling a Target
`af_unix:[<socket_type>:]<absolute-pathname>`::
To enable a target, set the corresponding environment variable or
system or global config value to one of the following:
Enables the target, opens and writes to a Unix Domain Socket
(on platforms that support them).
+
Socket type can be either `stream` or `dgram`. If the socket type is
omitted, Git will try both.
include::../trace2-target-values.txt[]
== Trace2 API
@ -243,15 +268,16 @@ significantly affects program performance or behavior, such as
@@ -243,15 +268,16 @@ significantly affects program performance or behavior, such as
Emits a "def_param" messages for "important" configuration
settings.
+
The environment variable `GIT_TR2_CONFIG_PARAMS` can be set to a
The environment variable `GIT_TR2_CONFIG_PARAMS` or the `trace2.configParams`
config value can be set to a
list of patterns of important configuration settings, for example:
`core.*,remote.*.url`. This function will iterate over all config
settings and emit a "def_param" message for each match.
Emits a "def_param" message for a specific configuration
setting IFF it matches the `GIT_TR2_CONFIG_PARAMS` pattern.
Emits a "def_param" message for a new or updated key/value
pair IF `key` is considered important.
+
This is used to hook into `git_config_set()` and catch any
configuration changes and update a value previously reported by
@ -418,9 +444,6 @@ recursive tree walk.
@@ -418,9 +444,6 @@ recursive tree walk.
=== NORMAL Format
NORMAL format is enabled when the `GIT_TR2` environment variable is
set.
Events are written as lines of the form:
------------
@ -437,8 +460,8 @@ Events are written as lines of the form:
@@ -437,8 +460,8 @@ Events are written as lines of the form:
Note that this may contain embedded LF or CRLF characters that are
not escaped, so the event may spill across multiple lines.
If `GIT_TR2_BRIEF` is true, the `time`, `filename`, and `line` fields
are omitted.
If `GIT_TR2_BRIEF` or `trace2.normalBrief` is true, the `time`, `filename`,
and `line` fields are omitted.
This target is intended to be more of a summary (like GIT_TRACE) and
less detailed than the other targets. It ignores thread, region, and
@ -446,9 +469,6 @@ data messages, for example.
@@ -446,9 +469,6 @@ data messages, for example.
=== PERF Format
PERF format is enabled when the `GIT_TR2_PERF` environment variable
is set.
Events are written as lines of the form:
------------
@ -508,8 +528,8 @@ This field is in anticipation of in-proc submodules in the future.
@@ -508,8 +528,8 @@ This field is in anticipation of in-proc submodules in the future.
15:33:33.532712 wt-status.c:2331 | d0 | main | region_leave | r1 | 0.127568 | 0.001504 | status | label:print
------------
If `GIT_TR2_PERF_BRIEF` is true, the `time`, `file`, and `line`
fields are omitted.
If `GIT_TR2_PERF_BRIEF` or `trace2.perfBrief` is true, the `time`, `file`,
and `line` fields are omitted.
------------
d0 | main | region_leave | r1 | 0.011717 | 0.009122 | index | label:preload
@ -520,9 +540,6 @@ during development and is quite noisy.
@@ -520,9 +540,6 @@ during development and is quite noisy.
=== EVENT Format
EVENT format is enabled when the `GIT_TR2_EVENT` environment
variable is set.
Each event is a JSON-object containing multiple key/value pairs
written as a single line and followed by a LF.
@ -540,7 +557,7 @@ The following key/value pairs are common to all events:
@@ -540,7 +557,7 @@ The following key/value pairs are common to all events: