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

Re: [PATCH v3] trace2: only include "fsync" events if we git_fsync()

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 18, 2022, 16:50 UTC
Message-ID
<xmqq5yjus6u2.fsf@gitster.g>
In-Reply-To
<patch-v3-1.1-979dea5956a-20220718T102747Z-avarab@gmail.com>
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
Show 5 quoted lines
> As we're needing to indent the trace2_data_intmax() lines let's
> introduce helper variables to ensure that our resulting lines (which
> were already too) don't exceed the recommendations of the
> CodingGuidelines. Doing that requires either wrapping them twice, or
> introducing short throwaway variable names, let's do the latter.
Or a macro that can be used like
	log_trace_fsync_nonzero(writeout_only);
	log_trace_fsync_nonzero(hardware_flush);
something along the lines of
#define log_trace_fsync_nonzero(var) \
	if (count_fsync_ #var) \
		trace2_data_intmax("fsync", the_repository, \
			"fsync/" ##var, count_fsync_ #var)
using token pasting and token stringification ;-)

The macro itself I am not serious at all. s/_if/_nonzero/ may be worth pondering, though.

>    We now test how many "writeout" and "flush" sync events we emit,
>    rather than the (meaningless) previous behavior (see above)>
Makes sense.

Neeraj, Ack, as the author of 9a498767 (trace2: add stats for fsync operations, 2022-03-30)?

Thanks all.
Previous: Ævar Arnfjörð BjarmasonNext: Neeraj Singh (WINDOWS-SFS)
Message 7 of 8 in “trace2: don't include "fsync" events in all trace2 logs”
  1. trace2: don't include "fsync" events in all trace2 logsÆvar Arnfjörð Bjarmason, Jun 23, 2022
  2. Neeraj Singh (WINDOWS-SFS)Jun 23, 2022
  3. Junio C HamanoJun 23, 2022
  4. trace2: don't include "fsync" events in all trace2 logsÆvar Arnfjörð Bjarmason, Jun 30, 2022
  5. Junio C HamanoJun 30, 2022
  6. trace2: only include "fsync" events if we git_fsync()Ævar Arnfjörð Bjarmason, Jul 18, 2022
  7. Junio C HamanoJul 18, 2022
  8. Neeraj Singh (WINDOWS-SFS)Jul 18, 2022

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.