Re: [PATCH v6 7/7] tr2: dump names if config exist in multiple scopes
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Jul 11, 2022, 14:40 UTC
- Message-ID
- <220711.86fsj77lur.gmgdl@evledraar.gmail.com>
- In-Reply-To
- <c45ead51ffc5a9176493d627da8332d35a31d87c.1657540174.git.dyroneteng@gmail.com>
On Mon, Jul 11 2022, Teng Long wrote:
Show 37 quoted lines
> 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"}This seems sensible on its face, but...
Show 6 quoted lines
> Signed-off-by: Teng Long <dyroneteng@gmail.com> > --- > trace2/tr2_tgt_event.c | 3 +++ > trace2/tr2_tgt_normal.c | 5 ++++- > trace2/tr2_tgt_perf.c | 9 +++++++-- > 3 files changed, 14 insertions(+), 3 deletions(-)
... we really should update Documentation/technical/api-trace2.txt here too.
It does say "..." currently, so we're not lying there, but since we now add "scope" unconditionally...