git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 2/2] wrapper: use trace2 counters to collect fsync stats

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 20, 2023, 19:26 UTC
Message-ID
<xmqq5y6e2xl7.fsf@gitster.g>
In-Reply-To
<20230720164823.625815-1-dev+git@drbeat.li>
Beat Bolli <dev+git@drbeat.li> writes:
Show 17 quoted lines
> 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 <dev+git@drbeat.li>
> ---
> v2:
> - Adjust t/t5351
> - Update commit message
I also spotted this change since v1:
- Rename trace2 counters to use "-" (not "_") as inter-word separators.

Since I do not seem to be able to find any review comments regarding the variable naming in the v1's thread, let's ask stakeholders.

Are folks involved in the trace2 subsystem (especially Jeff Hostetler---already CC:ed---who presumably has the most stake in it) OK with the naming convention of the multi-word variable? This is the first use of multi-word variable name in tr2_ctr, and thus will establish whatever convention you guys want to use. I do have a slight preference of "writeout-only" over "writeout_only" but that is purely from visual appearance. If there is a desire to keep the names literally reusable as identifiers in some languages used to postprocess trace output, or something, that might weigh differently.

Show 7 quoted lines
>  t/t5351-unpack-large-objects.sh |  6 +++---
>  trace2.c                        |  1 -
>  trace2.h                        |  4 ++++
>  trace2/tr2_ctr.c                | 10 ++++++++++
>  wrapper.c                       | 19 ++-----------------
>  wrapper.h                       |  5 -----
>  6 files changed, 19 insertions(+), 26 deletions(-)

Very nice to see clean-up patch that reduces the amount of code. Nicely done.

Thanks, will queue. If folks do not find issues in a few days, let's merge it to 'next'.

Previous: Beat BolliNext: Junio C Hamano
Message 5 of 9 in “trace2: fix a comment”
  1. 1/2 trace2: fix a commentBeat Bolli, Jul 19, 2023
  2. 2/2 wrapper: use trace2 counters to collect fsync statsBeat Bolli, Jul 19, 2023
  3. Junio C HamanoJul 20, 2023
  4. 2/2 wrapper: use trace2 counters to collect fsync statsBeat Bolli, Jul 20, 2023
  5. Junio C HamanoJul 20, 2023
  6. Junio C HamanoJul 25, 2023
  7. Beat BolliJul 25, 2023
  8. Jeff HostetlerAug 7, 2023
  9. Jeff HostetlerAug 7, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.