<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/trace2, branch v2.35.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.35.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.35.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-12-15T17:39:47Z</updated>
<entry>
<title>Merge branch 'ab/run-command'</title>
<updated>2021-12-15T17:39:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-12-15T17:39:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=832ec72c3e15820c3b728b3a56398655d7bb7cb3'/>
<id>urn:sha1:832ec72c3e15820c3b728b3a56398655d7bb7cb3</id>
<content type='text'>
API clean-up.

* ab/run-command:
  run-command API: remove "env" member, always use "env_array"
  difftool: use "env_array" to simplify memory management
  run-command API: remove "argv" member, always use "args"
  run-command API users: use strvec_push(), not argv construction
  run-command API users: use strvec_pushl(), not argv construction
  run-command tests: use strvec_pushv(), not argv assignment
  run-command API users: use strvec_pushv(), not argv assignment
  upload-archive: use regular "struct child_process" pattern
  worktree: stop being overly intimate with run_command() internals
</content>
</entry>
<entry>
<title>Merge branch 'js/trace2-avoid-recursive-errors'</title>
<updated>2021-12-10T22:35:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-12-10T22:35:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9b0a970ace0316662697cd9db326bcfb48e36838'/>
<id>urn:sha1:9b0a970ace0316662697cd9db326bcfb48e36838</id>
<content type='text'>
trace2 error code path fix.

* js/trace2-avoid-recursive-errors:
  trace2: disable tr2_dst before warning on write errors
</content>
</entry>
<entry>
<title>run-command API: remove "argv" member, always use "args"</title>
<updated>2021-11-26T06:15:07Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-11-25T22:52:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d3b2159712019a06f1f495d3e42bd6aa6e76e848'/>
<id>urn:sha1:d3b2159712019a06f1f495d3e42bd6aa6e76e848</id>
<content type='text'>
Remove the "argv" member from the run-command API, ever since "args"
was added in c460c0ecdca (run-command: store an optional argv_array,
2014-05-15) being able to provide either "argv" or "args" has led to
some confusion and bugs.

If we hadn't gone in that direction and only had an "argv" our
problems wouldn't have been solved either, as noted in [1] (and in the
documentation amended here) it comes with inherent memory management
issues: The caller would have to hang on to the "argv" until the
run-command API was finished. If the "argv" was an argument to main()
this wasn't an issue, but if it it was manually constructed using the
API might be painful.

We also have a recent report[2] of a user of the API segfaulting,
which is a direct result of it being complex to use. This commit
addresses the root cause of that bug.

This change is larger than I'd like, but there's no easy way to avoid
it that wouldn't involve even more verbose intermediate steps. We use
the "argv" as the source of truth over the "args", so we need to
change all parts of run-command.[ch] itself, as well as the trace2
logging at the same time.

The resulting Windows-specific code in start_command() is a bit nasty,
as we're now assigning to a strvec's "v" member, instead of to our own
"argv". There was a suggestion of some alternate approaches in reply
to an earlier version of this commit[3], but let's leave larger a
larger and needless refactoring of this code for now.

1. http://lore.kernel.org/git/YT6BnnXeAWn8BycF@coredump.intra.peff.net
2. https://lore.kernel.org/git/20211120194048.12125-1-ematsumiya@suse.de/
3. https://lore.kernel.org/git/patch-5.5-ea1011f7473-20211122T153605Z-avarab@gmail.com/

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: disable tr2_dst before warning on write errors</title>
<updated>2021-11-19T06:38:15Z</updated>
<author>
<name>Josh Steadmon</name>
<email>steadmon@google.com</email>
</author>
<published>2021-11-18T22:01:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=538ac746048fab0ed32b972e34eaabb9fb3f15b9'/>
<id>urn:sha1:538ac746048fab0ed32b972e34eaabb9fb3f15b9</id>
<content type='text'>
If writing a trace2 message fails, we optionally warn the user of this
fact. However, in 0ee10fd (usage: add trace2 entry upon warning(),
2020-11-23), we added a trace entry to the warning() function. This
means that we can enter an infinite loop of failing trace2 writes and
warnings. Fix this by disabling the failing trace2 destination before
issuing the warning.

Additionally, trace2 sets a default SIGPIPE handler
(tr2main_signal_handler) when it is initialized. This handler generates
its own trace2 messages when a signal is received. If a trace2 write
fails due to a broken pipe, this handler will run and then cause another
failed write. Fix this by temporarily ignoring SIGPIPE while writing
trace2 messages. This is safe because the write will still fail, and we
will disable the failing destination.

Signed-off-by: Josh Steadmon &lt;steadmon@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'js/trace2-raise-format-version'</title>
<updated>2021-11-12T23:29:25Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-11-12T23:29:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5a73c6bdc717127c2da99f57bc630c4efd8aed02'/>
<id>urn:sha1:5a73c6bdc717127c2da99f57bc630c4efd8aed02</id>
<content type='text'>
When we added a new event type to trace2 event stream, we forgot to
raise the format version number, which has been corrected.

* js/trace2-raise-format-version:
  trace2: increment event format version
</content>
</entry>
<entry>
<title>trace2: increment event format version</title>
<updated>2021-11-11T23:01:04Z</updated>
<author>
<name>Josh Steadmon</name>
<email>steadmon@google.com</email>
</author>
<published>2021-11-11T22:34:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=04480e67fe7a0a8c111becd43b114ce634e4a7e8'/>
<id>urn:sha1:04480e67fe7a0a8c111becd43b114ce634e4a7e8</id>
<content type='text'>
In 64bc752 (trace2: add trace2_child_ready() to report on background
children, 2021-09-20), we added a new "child_ready" event. In
Documentation/technical/api-trace2.txt, we promise that adding a new
event type will result in incrementing the trace2 event format version
number, but this was not done. Correct this in code &amp; docs.

Signed-off-by: Josh Steadmon &lt;steadmon@google.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>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>
<entry>
<title>tr2: stop leaking "thread_name" memory</title>
<updated>2021-09-07T18:07:59Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-08-27T08:02:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=48f68715b14b47395a5cd63568a9a29beea8aa6f'/>
<id>urn:sha1:48f68715b14b47395a5cd63568a9a29beea8aa6f</id>
<content type='text'>
Fix a memory leak introduced in ee4512ed481 (trace2: create new
combined trace facility, 2019-02-22), we were doing a free() of other
memory allocated in tr2tls_create_self(), but not the "thread_name"
"struct strbuf".

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Acked-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'es/trace2-log-parent-process-name'</title>
<updated>2021-08-24T22:32:40Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-08-24T22:32:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6f64eeab605b82b187b2dd1fc72492f434bad603'/>
<id>urn:sha1:6f64eeab605b82b187b2dd1fc72492f434bad603</id>
<content type='text'>
trace2 logs learned to show parent process name to see in what
context Git was invoked.

* es/trace2-log-parent-process-name:
  tr2: log parent process name
  tr2: make process info collection platform-generic
</content>
</entry>
</feed>
