<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/trace2.h, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2025-03-03T21:49:26Z</updated>
<entry>
<title>trace2.h: *.txt -&gt; *.adoc fixes</title>
<updated>2025-03-03T21:49:26Z</updated>
<author>
<name>Todd Zullinger</name>
<email>tmz@pobox.com</email>
</author>
<published>2025-03-03T20:44:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=508cf7f5d8907a281602a54551abcc58a16d0493'/>
<id>urn:sha1:508cf7f5d8907a281602a54551abcc58a16d0493</id>
<content type='text'>
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>refs/reftable: wire up support for exclude patterns</title>
<updated>2024-09-16T20:57:19Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-09-16T08:50:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=18695250667912d8278e76dce453706c3d488173'/>
<id>urn:sha1:18695250667912d8278e76dce453706c3d488173</id>
<content type='text'>
Exclude patterns can be used by reference backends to skip over blocks
of references that are uninteresting to the caller. Reference backends
do not have to wire up support for them, and all callers are expected to
behave as if the backend didn't support them. In fact, the only backend
that supports exclude patterns right now is the "packed" backend.

Exclude patterns can be quite an important performance optimization in
repositories that have loads of references. The patterns are set up in
case "transfer.hideRefs" and friends are configured during a fetch, so
handling these patterns becomes important once there are lots of hidden
refs in a served repository.

Now that we have properly re-seekable reftable iterators we can also
wire up support for these patterns in the "reftable" backend. Doing so
is conceptually simple: once we hit a reference whose prefix matches the
current exclude pattern we re-seek the iterator to the first reference
that doesn't match the pattern anymore. This schema only works for
trivial patterns that do not have any globbing characters in them, but
this restriction also applies do the "packed" backend.

This makes t1419 work with the "reftable" backend with some slight
modifications. Of course it also speeds up listing of references with
hidden refs. The following benchmark prints one reference with 1 million
hidden references:

    Benchmark 1: HEAD~
      Time (mean ± σ):      93.3 ms ±   2.1 ms    [User: 90.3 ms, System: 2.5 ms]
      Range (min … max):    89.8 ms …  97.2 ms    33 runs

    Benchmark 2: HEAD
      Time (mean ± σ):       4.2 ms ±   0.6 ms    [User: 2.2 ms, System: 1.8 ms]
      Range (min … max):     3.1 ms …   8.1 ms    765 runs

    Summary
      HEAD ran
       22.15 ± 3.19 times faster than HEAD~

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>__attribute__: trace2_region_enter_printf() is like "printf"</title>
<updated>2024-06-10T16:16:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-06-08T18:37:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=89e78c7cdad1ac70d16c0ceb79b3ff95dfadd2bb'/>
<id>urn:sha1:89e78c7cdad1ac70d16c0ceb79b3ff95dfadd2bb</id>
<content type='text'>
The last part of the parameter list the function takes is like
parameters to printf.  Mark it as such.

An existing call that formats a value of type size_t using "%d" was
found by the compiler with the help with this annotation; fix it.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trace2: fix signature of trace2_def_param() macro</title>
<updated>2023-11-23T01:30:32Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhostetler@github.com</email>
</author>
<published>2023-11-22T19:18:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=abcdb978ea13010357ef2bf265f7bf0c55f96dbe'/>
<id>urn:sha1:abcdb978ea13010357ef2bf265f7bf0c55f96dbe</id>
<content type='text'>
Add `struct key_value_info` argument to `trace2_def_param()`.

In dc90208497 (trace2: plumb config kvi, 2023-06-28) a `kvi`
argument was added to `trace2_def_param_fl()` but the macro
was not up updated. Let's fix that.

Signed-off-by: Jeff Hostetler &lt;jeffhostetler@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'bb/use-trace2-counters-for-fsync-stats'</title>
<updated>2023-08-02T16:37:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-08-02T16:37:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=52d9dc20e1ddd5ac6b9e9113983b2f8d6977e6b0'/>
<id>urn:sha1:52d9dc20e1ddd5ac6b9e9113983b2f8d6977e6b0</id>
<content type='text'>
Instead of inventing a custom counter variables for debugging,
use existing trace2 facility in the fsync customization codepath.

* bb/use-trace2-counters-for-fsync-stats:
  wrapper: use trace2 counters to collect fsync stats
</content>
</entry>
<entry>
<title>Merge branch 'bb/trace2-comment-fix'</title>
<updated>2023-07-28T16:45:21Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-07-28T16:45:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c8a33b44c5a56c7b2c7778506acdc71e5365ec1f'/>
<id>urn:sha1:c8a33b44c5a56c7b2c7778506acdc71e5365ec1f</id>
<content type='text'>
In-code comment fix.

* bb/trace2-comment-fix:
  trace2: fix a comment
</content>
</entry>
<entry>
<title>Merge branch 'tb/refs-exclusion-and-packed-refs'</title>
<updated>2023-07-21T20:47:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-07-21T20:47:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=39fe402d6727efb6c98ddca19fae1f094ffaa6b3'/>
<id>urn:sha1:39fe402d6727efb6c98ddca19fae1f094ffaa6b3</id>
<content type='text'>
Enumerating refs in the packed-refs file, while excluding refs that
match certain patterns, has been optimized.

* tb/refs-exclusion-and-packed-refs:
  ls-refs.c: avoid enumerating hidden refs where possible
  upload-pack.c: avoid enumerating hidden refs where possible
  builtin/receive-pack.c: avoid enumerating hidden references
  refs.h: implement `hidden_refs_to_excludes()`
  refs.h: let `for_each_namespaced_ref()` take excluded patterns
  revision.h: store hidden refs in a `strvec`
  refs/packed-backend.c: add trace2 counters for jump list
  refs/packed-backend.c: implement jump lists to avoid excluded pattern(s)
  refs/packed-backend.c: refactor `find_reference_location()`
  refs: plumb `exclude_patterns` argument throughout
  builtin/for-each-ref.c: add `--exclude` option
  ref-filter.c: parameterize match functions over patterns
  ref-filter: add `ref_filter_clear()`
  ref-filter: clear reachable list pointers after freeing
  ref-filter.h: provide `REF_FILTER_INIT`
  refs.c: rename `ref_filter`
</content>
</entry>
<entry>
<title>wrapper: use trace2 counters to collect fsync stats</title>
<updated>2023-07-20T18:52:53Z</updated>
<author>
<name>Beat Bolli</name>
<email>dev+git@drbeat.li</email>
</author>
<published>2023-07-20T16:48:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a27eecea75b3858b4052b191143f144a7e966869'/>
<id>urn:sha1:a27eecea75b3858b4052b191143f144a7e966869</id>
<content type='text'>
As mentioned in the thread starting at [1], trace2 counters should be
used to count events instead of ad-hoc static variables.

Convert the two fsync static variables to trace2 counters, reducing the
coupling between wrapper.c and the trace2 subsystem. Adjust t/t5351 to
match the trace2 counter output format.

The counters are not per-thread because the ones being replaced also
were not.

[1] https://lore.kernel.org/git/20230627195251.1973421-2-calvinwan@google.com/

Signed-off-by: Beat Bolli &lt;dev+git@drbeat.li&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trace2: fix a comment</title>
<updated>2023-07-20T00:02:16Z</updated>
<author>
<name>Beat Bolli</name>
<email>dev+git@drbeat.li</email>
</author>
<published>2023-07-19T23:24:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c48af99a3e516efd0873b9e8c1f1feda453e3cf1'/>
<id>urn:sha1:c48af99a3e516efd0873b9e8c1f1feda453e3cf1</id>
<content type='text'>
When the trace2 counter mechanism was added in 81071626ba (trace2: add
global counter mechanism, 2022-10-24), the name of the file where new
counters are added was misspelled in a comment.

Use the correct file name.

Signed-off-by: Beat Bolli &lt;dev+git@drbeat.li&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs/packed-backend.c: add trace2 counters for jump list</title>
<updated>2023-07-10T21:48:55Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2023-07-10T21:12:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c489f47a649da8984a2240032e1d819e9a80ea2a'/>
<id>urn:sha1:c489f47a649da8984a2240032e1d819e9a80ea2a</id>
<content type='text'>
The previous commit added low-level tests to ensure that the packed-refs
iterator did not enumerate excluded sections of the refspace.

However, there was no guarantee that these sections weren't being
visited, only that they were being suppressed from the output. To harden
these tests, add a trace2 counter which tracks the number of regions
skipped by the packed-refs iterator, and assert on its value.

Suggested-by: Derrick Stolee &lt;derrickstolee@github.com&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
