All of lore.kernel.org
 help / color / mirror / Atom feed
From: "tenglong.tl" <dyroneteng@gmail.com>
To: avarab@gmail.com
Cc: dyroneteng@gmail.com, git@jeffhostetler.com, git@vger.kernel.org,
	gitster@pobox.com, tenglong.tl@alibaba-inc.com
Subject: Re: [PATCH v1 1/2] api-trace2.txt: print config key-value pair
Date: Mon,  1 Aug 2022 20:25:15 +0800	[thread overview]
Message-ID: <20220801122515.23146-1-tenglong.tl@alibaba-inc.com> (raw)
In-Reply-To: <220722.86fsits91m.gmgdl@evledraar.gmail.com>

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> I didn't notice this before, but this is an addition to a long section
> where the examples are ------- delimited, starting with "in this
> example.." usually.

A little puzzled. About "------- delimited", do you mean the "block" syntax?

> So this "print configs" seems like on odd continuation. Shouldn't this
> copy the template of "Thread Events::" above. I.e. something like (I
> have not tried to asciidoc render this):

I think "Events" in "Thread Events" means the thread start and end events,
maybe not a template here. So I think it might be better to keep this namingi
if I'm right, but I will use this candidate naming to show diff in the end.

I'm not good at naming so I'm glad to accept the suggestion about it.

>	Config (def param) Events::
>		We can optionally emit configuration events, see
>		`trace2.configParams` in linkgit:git-config[1] for how to enable
>		it.
>	+
>	< your example below would follow this>

I refer to the previous sections, it's like the template is :

<title>

        <brief one-line description>

<detailed multi-lines description>

So, how about this like:

diff --git a/Documentation/technical/api-trace2.txt b/Documentation/technical/api-trace2.txt
index 77a150b30e..38d0878d85 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)

Thanks.

  parent reply	other threads:[~2022-08-01 12:43 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-21 13:27 [PATCH 0/2] tr2: shows the scope unconditionally with config tenglong.tl
2022-07-21 13:27 ` [PATCH 1/2] api-trace2.txt: print config key-value pair tenglong.tl
2022-07-21 13:27 ` [PATCH 2/2] tr2: shows scope unconditionally in addition to " tenglong.tl
2022-07-21 16:57   ` Junio C Hamano
2022-07-22  6:12     ` tenglong.tl
2022-07-22  8:19 ` [PATCH v1 0/2] tr2: shows the scope unconditionally with config tenglong.tl
2022-07-22  8:19   ` [PATCH v1 1/2] api-trace2.txt: print config key-value pair tenglong.tl
2022-07-22 10:59     ` Ævar Arnfjörð Bjarmason
2022-07-25 19:07       ` Junio C Hamano
2022-08-01 12:25       ` tenglong.tl [this message]
2022-08-05 22:21         ` Junio C Hamano
2022-08-08  6:16           ` Teng Long
2022-07-22 21:05     ` Junio C Hamano
2022-07-23  6:06       ` tenglong.tl
2022-07-23 17:47         ` Junio C Hamano
2022-07-25  9:18           ` tenglong.tl
2022-07-22  8:19   ` [PATCH v1 2/2] tr2: shows scope unconditionally in addition to " tenglong.tl
2022-08-12  2:56   ` [PATCH v2 0/2] tr2: shows the scope unconditionally with config Teng Long
2022-08-12  2:56     ` [PATCH v2 1/2] api-trace2.txt: print config key-value pair Teng Long
2022-08-12  2:56     ` [PATCH v2 2/2] tr2: shows scope unconditionally in addition to " Teng Long
2022-08-12 21:16       ` Junio C Hamano
2022-08-19 21:18     ` [PATCH v2 0/2] tr2: shows the scope unconditionally with config Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220801122515.23146-1-tenglong.tl@alibaba-inc.com \
    --to=dyroneteng@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@jeffhostetler.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=tenglong.tl@alibaba-inc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.