Skip to content

Commit 050d0dc

Browse files
dyronegitster
authored andcommitted
api-trace2.txt: print config key-value pair
It's supported to print "interesting" config key-value paire to tr2 log by setting "GIT_TRACE2_CONFIG_PARAMS" environment variable and the "trace2.configparam" config, let's add the related docs in Documentaion/technical/api-trace2.txt. Signed-off-by: Teng Long <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9dd64cb commit 050d0dc

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Documentation/technical/api-trace2.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,37 @@ at offset 508.
12071207
This example also shows that thread names are assigned in a racy manner
12081208
as each thread starts and allocates TLS storage.
12091209

1210+
Config (def param) Events::
1211+
1212+
Dump "interesting" config values to trace2 log.
1213+
+
1214+
We can optionally emit configuration events, see
1215+
`trace2.configparams` in linkgit:git-config[1] for how to enable
1216+
it.
1217+
+
1218+
----------------
1219+
$ git config color.ui auto
1220+
----------------
1221+
+
1222+
Then, mark the config `color.ui` as "interesting" config with
1223+
`GIT_TRACE2_CONFIG_PARAMS`:
1224+
+
1225+
----------------
1226+
$ export GIT_TRACE2_PERF_BRIEF=1
1227+
$ export GIT_TRACE2_PERF=~/log.perf
1228+
$ export GIT_TRACE2_CONFIG_PARAMS=color.ui
1229+
$ git version
1230+
...
1231+
$ cat ~/log.perf
1232+
d0 | main | version | | | | | ...
1233+
d0 | main | start | | 0.001642 | | | /usr/local/bin/git version
1234+
d0 | main | cmd_name | | | | | version (version)
1235+
d0 | main | def_param | | | | | color.ui:auto
1236+
d0 | main | data | r0 | 0.002100 | 0.002100 | fsync | fsync/writeout-only:0
1237+
d0 | main | data | r0 | 0.002126 | 0.002126 | fsync | fsync/hardware-flush:0
1238+
d0 | main | exit | | 0.002142 | | | code:0
1239+
d0 | main | atexit | | 0.002161 | | | code:0
1240+
----------------
12101241
== Future Work
12111242

12121243
=== Relationship to the Existing Trace Api (api-trace.txt)

0 commit comments

Comments
 (0)