summaryrefslogtreecommitdiff
path: root/Documentation/technical
diff options
context:
space:
mode:
authorTeng Long <dyroneteng@gmail.com>2022-08-12 02:56:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-08-12 04:05:00 (GMT)
commit050d0dc241376a5db083f24e739d5ecabcfaf2dc (patch)
tree126965c3d138489a0b5d72d323dd91169f3649e1 /Documentation/technical
parent9dd64cb4d310986dd7b8ca7fff92f9b61e0bd21a (diff)
downloadgit-050d0dc241376a5db083f24e739d5ecabcfaf2dc.zip
git-050d0dc241376a5db083f24e739d5ecabcfaf2dc.tar.gz
git-050d0dc241376a5db083f24e739d5ecabcfaf2dc.tar.bz2
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 <dyroneteng@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/technical')
-rw-r--r--Documentation/technical/api-trace2.txt31
1 files changed, 31 insertions, 0 deletions
diff --git a/Documentation/technical/api-trace2.txt b/Documentation/technical/api-trace2.txt
index 77a150b..38d0878 100644
--- a/Documentation/technical/api-trace2.txt
+++ b/Documentation/technical/api-trace2.txt
@@ -1207,6 +1207,37 @@ at offset 508.
This example also shows that thread names are assigned in a racy manner
as each thread starts and allocates TLS storage.
+Config (def param) Events::
+
+ Dump "interesting" config values to trace2 log.
++
+We can optionally emit configuration events, see
+`trace2.configparams` in linkgit:git-config[1] for how to enable
+it.
++
+----------------
+$ git config color.ui auto
+----------------
++
+Then, mark the config `color.ui` as "interesting" config with
+`GIT_TRACE2_CONFIG_PARAMS`:
++
+----------------
+$ export GIT_TRACE2_PERF_BRIEF=1
+$ export GIT_TRACE2_PERF=~/log.perf
+$ export GIT_TRACE2_CONFIG_PARAMS=color.ui
+$ git version
+...
+$ cat ~/log.perf
+d0 | main | version | | | | | ...
+d0 | main | start | | 0.001642 | | | /usr/local/bin/git version
+d0 | main | cmd_name | | | | | version (version)
+d0 | main | def_param | | | | | color.ui:auto
+d0 | main | data | r0 | 0.002100 | 0.002100 | fsync | fsync/writeout-only:0
+d0 | main | data | r0 | 0.002126 | 0.002126 | fsync | fsync/hardware-flush:0
+d0 | main | exit | | 0.002142 | | | code:0
+d0 | main | atexit | | 0.002161 | | | code:0
+----------------
== Future Work
=== Relationship to the Existing Trace Api (api-trace.txt)