<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/trace.c, branch v2.22.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.22.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.22.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-08-18T16:47:46Z</updated>
<entry>
<title>trace.h: support nested performance tracing</title>
<updated>2018-08-18T16:47:46Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-08-18T14:41:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c46c406ae1ee30f64a13083edfa5683d2685fd61'/>
<id>urn:sha1:c46c406ae1ee30f64a13083edfa5683d2685fd61</id>
<content type='text'>
Performance measurements are listed right now as a flat list, which is
fine when we measure big blocks. But when we start adding more and
more measurements, some of them could be just part of a bigger
measurement and a flat list gives a wrong impression that they are
executed at the same level instead of nested.

Add trace_performance_enter() and trace_performance_leave() to allow
indent these nested measurements. For now it does not help much
because the only nested thing is (lazy) name hash initialization
(e.g. called in diff-index from "git status"). This will help more
because I'm going to add some more tracing that's actually nested.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trace.c: export trace_setup_key</title>
<updated>2018-03-30T19:49:57Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-03-30T18:34:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cb50761959c0c30aa9c44098db3a72db06570238'/>
<id>urn:sha1:cb50761959c0c30aa9c44098db3a72db06570238</id>
<content type='text'>
This is so that we can print traces based on this key outside trace.c.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trace.c: move strbuf_release() out of print_trace_line()</title>
<updated>2018-01-16T20:16:54Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-01-15T10:59:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=33011e769c2dd3eaa63e5b480e5845c5d370ab13'/>
<id>urn:sha1:33011e769c2dd3eaa63e5b480e5845c5d370ab13</id>
<content type='text'>
The function is about printing a trace line, not releasing the buffer it
receives too. Move strbuf_release() back outside. This makes it easier
to see how strbuf is managed.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trace: avoid unnecessary quoting</title>
<updated>2018-01-16T20:16:54Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-01-15T10:59:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1fbdab21bb452ca4732bf088539247047465b99d'/>
<id>urn:sha1:1fbdab21bb452ca4732bf088539247047465b99d</id>
<content type='text'>
Trace output which contains arbitrary strings (e.g., the
arguments to commands which we are running) is always passed
through sq_quote_buf(). That function always adds
single-quotes, even if the output consists of vanilla
characters. This can make the output a bit hard to read.

Let's avoid the quoting if there are no characters which a
shell would interpret. Trace output doesn't necessarily need
to be shell-compatible, but:

  - the shell language is a good ballpark for what humans
    consider readable (well, humans versed in command line
    tools)

  - the run_command bits can be cut-and-pasted to a shell,
    and we'll keep that property

  - it covers any cases which would make the output
    visually ambiguous (e.g., embedded whitespace or quotes)

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>sq_quote_argv: drop maxlen parameter</title>
<updated>2018-01-16T20:16:54Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-01-15T10:59:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e35f11c29391e557964a39204fae6b89afab6a2a'/>
<id>urn:sha1:e35f11c29391e557964a39204fae6b89afab6a2a</id>
<content type='text'>
No caller passes anything but "0" for this parameter, which
requests that the function ignore it completely. In fact, in
all of history there was only one such caller, and it went
away in 7f51f8bc2b (alias: use run_command api to execute
aliases, 2011-01-07).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trace: improve performance while category is disabled</title>
<updated>2017-12-06T17:43:02Z</updated>
<author>
<name>Gennady Kupava</name>
<email>gkupava@bloomberg.net</email>
</author>
<published>2017-11-26T20:11:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8eeb25c6795af71400537e8ab064407d7998e0e2'/>
<id>urn:sha1:8eeb25c6795af71400537e8ab064407d7998e0e2</id>
<content type='text'>
Move just enough code from trace.c into trace.h header so all code
necessary to determine that trace is disabled could be inlined to
calling functions.  Then perform the check if the trace key is
enabled sooner in call chain.

Signed-off-by: Gennady Kupava &lt;gkupava@bloomberg.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trace: remove trace key normalization</title>
<updated>2017-11-27T01:19:08Z</updated>
<author>
<name>Gennady Kupava</name>
<email>gkupava@bloomberg.net</email>
</author>
<published>2017-11-26T20:11:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=406102a731145d39c497e384857ac9f9d2bdccb2'/>
<id>urn:sha1:406102a731145d39c497e384857ac9f9d2bdccb2</id>
<content type='text'>
Trace key normalization is not used, not strictly necessary,
complicates the code and would negatively affect compilation speed if
moved to header.

New trace_default_key key or existing separate marco could be used
instead of passing NULL as a key.

Signed-off-by: Gennady Kupava &lt;gkupava@bloomberg.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Replace Free Software Foundation address in license notices</title>
<updated>2017-11-09T04:21:21Z</updated>
<author>
<name>Todd Zullinger</name>
<email>tmz@pobox.com</email>
</author>
<published>2017-11-07T05:39:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=484257925fada31045aefec7484fd663f7c40c2f'/>
<id>urn:sha1:484257925fada31045aefec7484fd663f7c40c2f</id>
<content type='text'>
The mailing address for the FSF has changed over the years.  Rather than
updating the address across all files, refer readers to gnu.org, as the
GNU GPL documentation now suggests for license notices.  The mailing
address is retained in the full license files (COPYING and LGPL-2.1).

The old address is still present in t/diff-lib/COPYING.  This is
intentional, as the file is used in tests and the contents are not
expected to change.

Signed-off-by: Todd Zullinger &lt;tmz@pobox.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trace: do not fall back to stderr</title>
<updated>2016-08-05T16:28:17Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-08-05T07:58:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6f25305799f0bbddbac1d678293e8c5cf404deb3'/>
<id>urn:sha1:6f25305799f0bbddbac1d678293e8c5cf404deb3</id>
<content type='text'>
If the trace code cannot open a specified file, or does not
understand the contents of the GIT_TRACE variable, it falls
back to printing trace output to stderr.

This is an attempt to be helpful, but in practice it just
ends up annoying. The user was trying to get the output to
go somewhere else, so spewing it to stderr does not really
accomplish that. And as it's intended for debugging, they
can presumably re-run the command with their error
corrected.

So instead of falling back, this patch disables bogus trace
keys for the rest of the program, just as we do for write
errors. We can drop the "Defaulting to..." part of the error
message entirely; after seeing "cannot open '/foo'", the
user can assume that tracing is skipped.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trace: disable key after write error</title>
<updated>2016-08-05T16:28:16Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-08-03T23:01:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=46ac74b71681f1d2ff29615236193e651dcdd9fe'/>
<id>urn:sha1:46ac74b71681f1d2ff29615236193e651dcdd9fe</id>
<content type='text'>
If we get a write error writing to a trace descriptor, the
error isn't likely to go away if we keep writing. Instead,
you'll just get the same error over and over. E.g., try:

  GIT_TRACE_PACKET=42 git ls-remote &gt;/dev/null

You don't really need to see:

  warning: unable to write trace for GIT_TRACE_PACKET: Bad file descriptor

hundreds of times. We could fallback to tracing to stderr,
as we do in the error code-path for open(), but there's not
much point. If the user fed us a bogus descriptor, they're
probably better off fixing their invocation. And if they
didn't, and we saw a transient error (e.g., ENOSPC writing
to a file), it probably doesn't help anybody to have half of
the trace in a file, and half on stderr.

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