summaryrefslogtreecommitdiffstats
path: root/technical/api-trace2.html
diff options
context:
space:
mode:
Diffstat (limited to 'technical/api-trace2.html')
-rw-r--r--technical/api-trace2.html45
1 files changed, 44 insertions, 1 deletions
diff --git a/technical/api-trace2.html b/technical/api-trace2.html
index c28fe02c3..b04dcc5eb 100644
--- a/technical/api-trace2.html
+++ b/technical/api-trace2.html
@@ -1643,6 +1643,7 @@ not be compared to the child&#8217;s atexit times.</p></div>
<pre><code>{
"event":"def_param",
...
+ "scope":"global",
"param":"core.abbrev",
"value":"7"
}</code></pre>
@@ -2172,6 +2173,48 @@ at offset 508.</p></div>
<div class="paragraph"><p>This example also shows that thread names are assigned in a racy manner
as each thread starts and allocates TLS storage.</p></div>
</dd>
+<dt class="hdlist1">
+Config (def param) Events
+</dt>
+<dd>
+<p>
+ Dump "interesting" config values to trace2 log.
+</p>
+<div class="paragraph"><p>We can optionally emit configuration events, see
+<code>trace2.configparams</code> in <a href="../git-config.html">git-config(1)</a> for how to enable
+it.</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><code>$ git config --system color.ui never
+$ git config --global color.ui always
+$ git config --local color.ui auto
+$ git config --list --show-scope | grep 'color.ui'
+system color.ui=never
+global color.ui=always
+local color.ui=auto</code></pre>
+</div></div>
+<div class="paragraph"><p>Then, mark the config <code>color.ui</code> as "interesting" config with
+<code>GIT_TRACE2_CONFIG_PARAMS</code>:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><code>$ 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 | | | | scope:system | color.ui:never
+d0 | main | def_param | | | | scope:global | color.ui:always
+d0 | main | def_param | | | | scope:local | 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.000470 | | | code:0
+d0 | main | atexit | | 0.000477 | | | code:0</code></pre>
+</div></div>
+</dd>
</dl></div>
</div>
</div>
@@ -2216,7 +2259,7 @@ Trace2 targets (and convert &lt;key&gt; to a "category").
<div id="footer">
<div id="footer-text">
Last updated
- 2022-06-10 15:52:52 PDT
+ 2022-08-30 10:56:31 PDT
</div>
</div>
</body>