<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/trace2.h, branch v2.40.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.40.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.40.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>trace2: rename the thread_name argument to trace2_thread_start</title>
<updated>2022-10-24T19:45:25Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhost@microsoft.com</email>
</author>
<published>2022-10-24T13:41:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a70839cf36c9cad10e514f75fa1bec2e6180dbda'/>
<id>urn:sha1:a70839cf36c9cad10e514f75fa1bec2e6180dbda</id>
<content type='text'>
Rename the `thread_name` argument in `tr2tls_create_self()` and
`trace2_thread_start()` to be `thread_base_name` to make it clearer
that the passed argument is a component used in the construction of
the actual `struct tr2tls_thread_ctx.thread_name` variable.

The base name will be used along with the thread id to create a
unique thread name.

This commit does not change how the `thread_name` field is
allocated or stored within the `tr2tls_thread_ctx` structure.

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>common-main.c: move non-trace2 exit() behavior out of trace2.c</title>
<updated>2022-06-02T19:51:30Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-06-02T12:25:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=19d75948ef7abe9066efa4462108827d70565ae9'/>
<id>urn:sha1:19d75948ef7abe9066efa4462108827d70565ae9</id>
<content type='text'>
Change the exit() wrapper added in ee4512ed481 (trace2: create new
combined trace facility, 2019-02-22) so that we'll split up the trace2
logging concerns from wanting to wrap the "exit()" function itself for
other purposes.

This makes more sense structurally, as we won't seem to conflate
non-trace2 behavior with the trace2 code. I'd previously added an
explanation for this in 368b5843158 (common-main.c: call exit(), don't
return, 2021-12-07), that comment is being adjusted here.

Now the only thing we'll do if we're not using trace2 is to truncate
the "code" argument to the lowest 8 bits.

We only need to do that truncation on non-POSIX systems, but in
ee4512ed481 that "if defined(__MINGW32__)" code added in
47e3de0e796 (MinGW: truncate exit()'s argument to lowest 8 bits,
2009-07-05) was made to run everywhere. It might be good for clarify
to narrow that down by an "ifdef" again, but I'm not certain that in
the interim we haven't had some other non-POSIX systems rely the
behavior. On a POSIX system taking the lowest 8 bits is implicit, see
exit(3)[1] and wait(2)[2]. Let's leave a comment about that instead.

1. https://man7.org/linux/man-pages/man3/exit.3.html
2. https://man7.org/linux/man-pages/man2/wait.2.html

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>C99: remove hardcoded-out !HAVE_VARIADIC_MACROS code</title>
<updated>2022-02-22T03:14:19Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-02-21T16:05:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=56a29d2c970ca9f95fcfb5859a417a68ff7d5b47'/>
<id>urn:sha1:56a29d2c970ca9f95fcfb5859a417a68ff7d5b47</id>
<content type='text'>
Remove the "else" branches of the HAVE_VARIADIC_MACROS macro, which
have been unconditionally omitted since 765dc168882 (git-compat-util:
always enable variadic macros, 2021-01-28).

Since were always omitted, anyone trying to use a compiler without
variadic macro support to compile a git since version
git v2.31.0 or later would have had a compilation error. 10 months
across a few releases since then should have been enough time for
anyone who cared to run into that and report the issue.

In addition to that, for anyone unsetting HAVE_VARIADIC_MACROS we've
been emitting extremely verbose warnings since at least
ee4512ed481 (trace2: create new combined trace facility,
2019-02-22). That's because there is no such thing as a
"region_enter_printf" or "region_leave_printf" format, so at least
under GCC and Clang everything that includes trace.h (almost every
file) emits a couple of warnings about that.

There's a large benefit to being able to have a hard dependency rely
on variadic macros, the code surrounding usage.c is hard to maintain
if we need to write two implementations of everything, and by relying
on "__FILE__" and "__LINE__" along with "__VA_ARGS__" we can in the
future make error(), die() etc. log where they were called from. We've
also recently merged d67fc4bf0ba (Merge branch 'bc/require-c99',
2021-12-10) which further cements our hard dependency on C99.

So let's delete the fallback code, and update our CodingGuidelines to
note that we depend on this. The added bullet-point starts with
lower-case for consistency with other bullet-points in that section.

The diff in "trace.h" is relatively hard to read, since we need to
retain the existing API docs, which were comments on the code used if
HAVE_VARIADIC_MACROS was not defined.

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>Merge branch 'jh/builtin-fsmonitor-part1'</title>
<updated>2021-10-13T22:15:58Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-10-13T22:15:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=af303ee39214a04ad3c01e5924f2e8c09b5c18cb'/>
<id>urn:sha1:af303ee39214a04ad3c01e5924f2e8c09b5c18cb</id>
<content type='text'>
Built-in fsmonitor (part 1).

* jh/builtin-fsmonitor-part1:
  t/helper/simple-ipc: convert test-simple-ipc to use start_bg_command
  run-command: create start_bg_command
  simple-ipc/ipc-win32: add Windows ACL to named pipe
  simple-ipc/ipc-win32: add trace2 debugging
  simple-ipc: move definition of ipc_active_state outside of ifdef
  simple-ipc: preparations for supporting binary messages.
  trace2: add trace2_child_ready() to report on background children
</content>
</entry>
<entry>
<title>Merge branch 'en/typofixes'</title>
<updated>2021-09-28T20:06:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-09-28T20:06:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=45d141a1ddbc55c220ad4c726c02bbbf7a69247a'/>
<id>urn:sha1:45d141a1ddbc55c220ad4c726c02bbbf7a69247a</id>
<content type='text'>
Typofixes.

* en/typofixes:
  merge-ort: fix completely wrong comment
  trace2.h: fix trivial comment typo
</content>
</entry>
<entry>
<title>trace2.h: fix trivial comment typo</title>
<updated>2021-09-20T18:25:01Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2021-09-19T01:48:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b031f47802b60114d294c2075f8607ce30f50920'/>
<id>urn:sha1:b031f47802b60114d294c2075f8607ce30f50920</id>
<content type='text'>
Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trace2: add trace2_child_ready() to report on background children</title>
<updated>2021-09-20T15:57:58Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhost@microsoft.com</email>
</author>
<published>2021-09-20T15:36:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=64bc75244b5bdc26112cf7b8533a832b692a5fda'/>
<id>urn:sha1:64bc75244b5bdc26112cf7b8533a832b692a5fda</id>
<content type='text'>
Create "child_ready" event to capture the state of a child process
created in the background.

When a child command is started a "child_start" event is generated in
the Trace2 log.  For normal synchronous children, a "child_exit" event
is later generated when the child exits or is terminated.  The two events
include information, such as the "child_id" and "pid", to allow post
analysis to match-up the command line and exit status.

When a child is started in the background (and may outlive the parent
process), it is not possible for the parent to emit a "child_exit"
event.  Create a new "child_ready" event to indicate whether the
child was successfully started.  Also include the "child_id" and "pid"
to allow similar post processing.

This will be used in a later commit with the new "start_bg_command()".

Signed-off-by: Jeff Hostetler &lt;jeffhost@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
