<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/Documentation/technical/api-trace2.txt, branch v2.41.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.41.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.41.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-10-24T19:45:26Z</updated>
<entry>
<title>trace2: add global counter mechanism</title>
<updated>2022-10-24T19:45:26Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhost@microsoft.com</email>
</author>
<published>2022-10-24T13:41:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=81071626ba1ec54ad72de1e0a9a49c78eb87a2c8'/>
<id>urn:sha1:81071626ba1ec54ad72de1e0a9a49c78eb87a2c8</id>
<content type='text'>
Add global counters mechanism to Trace2.

The Trace2 counters mechanism adds the ability to create a set of
global counter variables and an API to increment them efficiently.
Counters can optionally report per-thread usage in addition to the sum
across all threads.

Counter events are emitted to the Trace2 logs when a thread exits and
at process exit.

Counters are an alternative to `data` and `data_json` events.

Counters are useful when you want to measure something across the life
of the process, when you don't want per-measurement events for
performance reasons, when the data does not fit conveniently within a
region, or when your control flow does not easily let you write the
final total.  For example, you might use this to report the number of
calls to unzip() or the number of de-delta steps during a checkout.

Signed-off-by: Jeff Hostetler &lt;jeffhost@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trace2: add stopwatch timers</title>
<updated>2022-10-24T19:45:26Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhost@microsoft.com</email>
</author>
<published>2022-10-24T13:41:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8ad575646c0b1e927a05650a1ec64125121ae591'/>
<id>urn:sha1:8ad575646c0b1e927a05650a1ec64125121ae591</id>
<content type='text'>
Add stopwatch timer mechanism to Trace2.

Timers are an alternative to Trace2 Regions.  Regions are useful for
measuring the time spent in various computation phases, such as the
time to read the index, time to scan for unstaged files, time to scan
for untracked files, and etc.

However, regions are not appropriate in all places.  For example,
during a checkout, it would be very inefficient to use regions to
measure the total time spent inflating objects from the ODB from
across the entire lifetime of the process; a per-unzip() region would
flood the output and significantly slow the command; and some form of
post-processing would be requried to compute the time spent in unzip().

Timers can be used to measure a series of timer intervals and emit
a single summary event (at thread and/or process exit).

Signed-off-by: Jeff Hostetler &lt;jeffhost@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>api-trace2.txt: elminate section describing the public trace2 API</title>
<updated>2022-10-24T19:45:25Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhost@microsoft.com</email>
</author>
<published>2022-10-24T13:41:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8e8c5ad27a0a35f1be31af48050a8c81892c452d'/>
<id>urn:sha1:8e8c5ad27a0a35f1be31af48050a8c81892c452d</id>
<content type='text'>
Eliminate the mostly obsolete `Public API` sub-section from the
`Trace2 API` section in the documentation.  Strengthen the referral
to `trace2.h`.

Most of the technical information in this sub-section was moved to
`trace2.h` in 6c51cb525d (trace2: move doc to trace2.h, 2019-11-17) to
be adjacent to the function prototypes.  The remaining text wasn't
that useful by itself.

Furthermore, the text would need a bit of overhaul to add routines
that do not immediately generate a message, such as stopwatch timers.
So it seemed simpler to just get rid of it.

Signed-off-by: Jeff Hostetler &lt;jeffhost@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tr2tls: clarify TLS terminology</title>
<updated>2022-10-24T19:45:25Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhost@microsoft.com</email>
</author>
<published>2022-10-24T13:41:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5bbb9251378b0e62bb06e72bda0574e06dee4933'/>
<id>urn:sha1:5bbb9251378b0e62bb06e72bda0574e06dee4933</id>
<content type='text'>
Reduce or eliminate use of the term "TLS" in the Trace2 code.

The term "TLS" has two popular meanings: "thread-local storage" and
"transport layer security".  In the Trace2 source, the term is associated
with the former.  There was concern on the mailing list about it refering
to the latter.

Update the source and documentation to eliminate the use of the "TLS" term
or replace it with the phrase "thread-local storage" to reduce ambiguity.

Signed-off-by: Jeff Hostetler &lt;jeffhost@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tr2: shows scope unconditionally in addition to key-value pair</title>
<updated>2022-08-12T04:05:00Z</updated>
<author>
<name>Teng Long</name>
<email>dyroneteng@gmail.com</email>
</author>
<published>2022-08-12T02:56:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=35ae40ead34f29c827abf101ba4e5412c2e67ab0'/>
<id>urn:sha1:35ae40ead34f29c827abf101ba4e5412c2e67ab0</id>
<content type='text'>
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 \
    &gt; GIT_TRACE2_CONFIG_PARAMS=core.multipackIndex \
    &gt; 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 &lt;dyroneteng@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>api-trace2.txt: print config key-value pair</title>
<updated>2022-08-12T04:05:00Z</updated>
<author>
<name>Teng Long</name>
<email>dyroneteng@gmail.com</email>
</author>
<published>2022-08-12T02:56:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=050d0dc241376a5db083f24e739d5ecabcfaf2dc'/>
<id>urn:sha1:050d0dc241376a5db083f24e739d5ecabcfaf2dc</id>
<content type='text'>
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 &lt;dyroneteng@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>usage.c: add a non-fatal bug() function to go with BUG()</title>
<updated>2022-06-02T19:51:35Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-06-02T12:25:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0cc05b044fd690f37565262a5b09f60c203c5218'/>
<id>urn:sha1:0cc05b044fd690f37565262a5b09f60c203c5218</id>
<content type='text'>
Add a bug() function to use in cases where we'd like to indicate a
runtime BUG(), but would like to defer the BUG() call because we're
possibly accumulating more bug() callers to exhaustively indicate what
went wrong.

We already have this sort of facility in various parts of the
codebase, just in the form of ad-hoc re-inventions of the
functionality that this new API provides. E.g. this will be used to
replace optbug() in parse-options.c, and the 'error("BUG:[...]' we do
in a loop in builtin/receive-pack.c.

Unlike the code this replaces we'll log to trace2 with this new bug()
function (as with other usage.c functions, including BUG()), we'll
also be able to avoid calls to xstrfmt() in some cases, as the bug()
function itself accepts variadic sprintf()-like arguments.

Any caller to bug() can follow up such calls with BUG_if_bug(),
which will BUG() out (i.e. abort()) if there were any preceding calls
to bug(), callers can also decide not to call BUG_if_bug() and leave
the resulting BUG() invocation until exit() time. There are currently
no bug() API users that don't call BUG_if_bug() themselves after a
for-loop, but allowing for not calling BUG_if_bug() keeps the API
flexible. As the tests and documentation here show we'll catch missing
BUG_if_bug() invocations in our exit() wrapper.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trace2 docs: add missing full stop</title>
<updated>2022-05-04T17:31:05Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2022-05-03T10:26:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a6c80c313c1138eb0e6c040cb78274ca28991c90'/>
<id>urn:sha1:a6c80c313c1138eb0e6c040cb78274ca28991c90</id>
<content type='text'>
Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trace2 docs: clarify what `varargs` is all about</title>
<updated>2022-05-04T17:31:05Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2022-05-03T10:26:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=236d1177ba893b1101de5b330cd4eb116e4eb9d3'/>
<id>urn:sha1:236d1177ba893b1101de5b330cd4eb116e4eb9d3</id>
<content type='text'>
Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trace2 docs: fix a JSON formatted example</title>
<updated>2022-05-04T17:31:04Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2022-05-03T10:26:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c4667b17fb67482b2b6d3787ff496e5c75ab2075'/>
<id>urn:sha1:c4667b17fb67482b2b6d3787ff496e5c75ab2075</id>
<content type='text'>
The example was not in valid JSON format due to a duplicate key "sid".

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
