summaryrefslogtreecommitdiff
path: root/Documentation/technical
diff options
context:
space:
mode:
authorTeng Long <dyroneteng@gmail.com>2022-08-12 02:56:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-08-12 04:05:00 (GMT)
commit35ae40ead34f29c827abf101ba4e5412c2e67ab0 (patch)
treeacc7434005982ba18e542a4491f908aebe1732aa /Documentation/technical
parent050d0dc241376a5db083f24e739d5ecabcfaf2dc (diff)
downloadgit-35ae40ead34f29c827abf101ba4e5412c2e67ab0.zip
git-35ae40ead34f29c827abf101ba4e5412c2e67ab0.tar.gz
git-35ae40ead34f29c827abf101ba4e5412c2e67ab0.tar.bz2
tr2: shows scope unconditionally in addition to key-value pair
When we specify GIT_TRACE2_CONFIG_PARAMS or trace2.configparams, trace2 will prints "interesting" config values to log. Sometimes, when a config set in multiple scope files, the following output looks like (the irrelevant fields are omitted here as "..."): ...| def_param | ... | core.multipackindex:false ...| def_param | ... | core.multipackindex:false ...| def_param | ... | core.multipackindex:false As the log shows, even each config in different scope is dumped, but we don't know which scope it comes from. Therefore, it's better to add the scope names as well to make them be more recognizable. For example, when execute: $ GIT_TRACE2_PERF=1 \ > GIT_TRACE2_CONFIG_PARAMS=core.multipackIndex \ > git rev-list --test-bitmap HEAD" The following is the ouput (the irrelevant fields are omitted here as "..."): Format normal: ... git.c:461 ... def_param scope:system core.multipackindex=false ... git.c:461 ... def_param scope:global core.multipackindex=false ... git.c:461 ... def_param scope:local core.multipackindex=false Format perf: ... | def_param | ... | scope:system | core.multipackindex:false ... | def_param | ... | scope:global | core.multipackindex:false ... | def_param | ... | scope:local | core.multipackindex:false Format event: {"event":"def_param", ... ,"scope":"system","param":"core.multipackindex","value":"false"} {"event":"def_param", ... ,"scope":"global","param":"core.multipackindex","value":"false"} {"event":"def_param", ... ,"scope":"local","param":"core.multipackindex","value":"false"} 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.txt17
1 files changed, 13 insertions, 4 deletions
diff --git a/Documentation/technical/api-trace2.txt b/Documentation/technical/api-trace2.txt
index 38d0878..2afa28b 100644
--- a/Documentation/technical/api-trace2.txt
+++ b/Documentation/technical/api-trace2.txt
@@ -717,6 +717,7 @@ The "exec_id" field is a command-unique id and is only useful if the
{
"event":"def_param",
...
+ "scope":"global",
"param":"core.abbrev",
"value":"7"
}
@@ -1216,7 +1217,13 @@ We can optionally emit configuration events, see
it.
+
----------------
-$ git config color.ui auto
+$ 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
----------------
+
Then, mark the config `color.ui` as "interesting" config with
@@ -1232,11 +1239,13 @@ $ 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 | 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.002142 | | | code:0
-d0 | main | atexit | | 0.002161 | | | code:0
+d0 | main | exit | | 0.000470 | | | code:0
+d0 | main | atexit | | 0.000477 | | | code:0
----------------
== Future Work