23
for example.
24
25
Trace2 is controlled using `trace2.*` config values in the system and
26
-global config files and `GIT_TR2*` environment variables. Trace2 does
26
+global config files and `GIT_TRACE2*` environment variables. Trace2 does
27
not read from repo local or worktree config files or respect `-c`
28
command line config settings.
29
42
For example
43
44
------------
45
-$ export GIT_TR2=~/log.normal
45
+$ export GIT_TRACE2=~/log.normal
46
$ git version
47
git version 2.20.1.155.g426c96fcdb
48
------------
71
The performance format target (PERF) is a column-based format to
72
replace GIT_TRACE_PERFORMANCE and is suitable for development and
73
testing, possibly to complement tools like gprof. This format is
74
-enabled with the `GIT_TR2_PERF` environment variable or the
74
+enabled with the `GIT_TRACE2_PERF` environment variable or the
75
`trace2.perfTarget` system or global config setting.
76
77
For example
78
79
------------
80
-$ export GIT_TR2_PERF=~/log.perf
80
+$ export GIT_TRACE2_PERF=~/log.perf
81
$ git version
82
git version 2.20.1.155.g426c96fcdb
83
------------
104
=== The Event Format Target
105
106
The event format target is a JSON-based format of event data suitable
107
-for telemetry analysis. This format is enabled with the `GIT_TR2_EVENT`
107
+for telemetry analysis. This format is enabled with the `GIT_TRACE2_EVENT`
108
environment variable or the `trace2.eventTarget` system or global config
109
setting.
110
111
For example
112
113
------------
114
-$ export GIT_TR2_EVENT=~/log.event
114
+$ export GIT_TRACE2_EVENT=~/log.event
115
$ git version
116
git version 2.20.1.155.g426c96fcdb
117
------------
273
Emits a "def_param" messages for "important" configuration
274
settings.
275
+
276
-The environment variable `GIT_TR2_CONFIG_PARAMS` or the `trace2.configParams`
276
+The environment variable `GIT_TRACE2_CONFIG_PARAMS` or the `trace2.configParams`
277
config value can be set to a
278
list of patterns of important configuration settings, for example:
279
`core.*,remote.*.url`. This function will iterate over all config
465
Note that this may contain embedded LF or CRLF characters that are
466
not escaped, so the event may spill across multiple lines.
467
468
-If `GIT_TR2_BRIEF` or `trace2.normalBrief` is true, the `time`, `filename`,
468
+If `GIT_TRACE2_BRIEF` or `trace2.normalBrief` is true, the `time`, `filename`,
469
and `line` fields are omitted.
470
471
This target is intended to be more of a summary (like GIT_TRACE) and
533
15:33:33.532712 wt-status.c:2331 | d0 | main | region_leave | r1 | 0.127568 | 0.001504 | status | label:print
534
------------
535
536
-If `GIT_TR2_PERF_BRIEF` or `trace2.perfBrief` is true, the `time`, `file`,
536
+If `GIT_TRACE2_PERF_BRIEF` or `trace2.perfBrief` is true, the `time`, `file`,
537
and `line` fields are omitted.
538
539
------------
598
`"repo":<repo-id>`::
599
when present, is the integer repo-id as described previously.
600
601
-If `GIT_TR2_EVENT_BRIEF` or `trace2.eventBrief` is true, the `file`
601
+If `GIT_TRACE2_EVENT_BRIEF` or `trace2.eventBrief` is true, the `file`
602
and `line` fields are omitted from all events and the `time` field is
603
only present on the "start" and "atexit" events.
604
911
The `category` field may be used in a future enhancement to
912
do category-based filtering.
913
+
914
-`GIT_TR2_EVENT_NESTING` or `trace2.eventNesting` can be used to
914
+`GIT_TRACE2_EVENT_NESTING` or `trace2.eventNesting` can be used to
915
filter deeply nested regions and data events. It defaults to "2".
916
917
`"region_leave"`::
1039
5.199 seconds and of that 4.932 was in ssh.
1040
+
1041
----------------
1042
-$ export GIT_TR2_BRIEF=1
1043
-$ export GIT_TR2=~/log.normal
1042
+$ export GIT_TRACE2_BRIEF=1
1043
+$ export GIT_TRACE2=~/log.normal
1044
$ git fetch origin
1045
...
1046
----------------
1075
indented for clarity.)
1076
+
1077
----------------
1078
-$ export GIT_TR2_BRIEF=1
1079
-$ export GIT_TR2=~/log.normal
1078
+$ export GIT_TRACE2_BRIEF=1
1079
+$ export GIT_TRACE2=~/log.normal
1080
$ git fetch origin
1081
...
1082
----------------
1134
+0.027149 (since the process started) and took 0.014581 seconds.
1135
+
1136
----------------
1137
-$ export GIT_TR2_PERF_BRIEF=1
1138
-$ export GIT_TR2_PERF=~/log.perf
1137
+$ export GIT_TRACE2_PERF_BRIEF=1
1138
+$ export GIT_TRACE2_PERF=~/log.perf
1139
$ git status
1140
...
1141
1180
We can further investigate the time spent scanning for untracked files.
1181
+
1182
----------------
1183
-$ export GIT_TR2_PERF_BRIEF=1
1184
-$ export GIT_TR2_PERF=~/log.perf
1183
+$ export GIT_TRACE2_PERF_BRIEF=1
1184
+$ export GIT_TRACE2_PERF=~/log.perf
1185
$ git status
1186
...
1187
$ cat ~/log.perf
1236
This example shows that the index contained 3552 entries.
1237
+
1238
----------------
1239
-$ export GIT_TR2_PERF_BRIEF=1
1240
-$ export GIT_TR2_PERF=~/log.perf
1239
+$ export GIT_TRACE2_PERF_BRIEF=1
1240
+$ export GIT_TRACE2_PERF=~/log.perf
1241
$ git status
1242
...
1243
$ cat ~/log.perf
1310
to report the per-thread parameters.
1311
+
1312
----------------
1313
-$ export GIT_TR2_PERF_BRIEF=1
1314
-$ export GIT_TR2_PERF=~/log.perf
1313
+$ export GIT_TRACE2_PERF_BRIEF=1
1314
+$ export GIT_TRACE2_PERF=~/log.perf
1315
$ git status
1316
...
1317
$ cat ~/log.perf