git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Neeraj Singh <neerajsi@microsoft.com>
Subject: Re: [PATCH v2] trace2: don't include "fsync" events in all trace2 logs
Date: Thu, 30 Jun 2022 13:45:21 -0700	[thread overview]
Message-ID: <xmqqczepev8e.fsf@gitster.g> (raw)
In-Reply-To: <patch-v2-1.1-a1fc37de947-20220630T084607Z-avarab@gmail.com> ("Ævar Arnfjörð Bjarmason"'s message of "Thu, 30 Jun 2022 10:56:47 +0200")

Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> 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

too -> too something

> +    elsif ($event eq 'data_json') {
> +	# NEEDSWORK: Ignore due to
> +	# compat/win32/trace2_win32_process_info.c, which should log a
> +	# "cmd_ancestry" event instead.
> +    }

This does read better.

>  void trace_git_fsync_stats(void)
>  {
> -	trace2_data_intmax("fsync", the_repository, "fsync/writeout-only", count_fsync_writeout_only);
> -	trace2_data_intmax("fsync", the_repository, "fsync/hardware-flush", count_fsync_hardware_flush);
> +	const struct repository *r = the_repository;
> +	const intmax_t cfwo = count_fsync_writeout_only;
> +	const intmax_t cfhf = count_fsync_hardware_flush;
> +
> +	if (cfwo)
> +		trace2_data_intmax("fsync", r, "fsync/writeout-only", cfwo);
> +	if (cfhf)
> +		trace2_data_intmax("fsync", r, "fsync/hardware-flush", cfhf);

I would have wrapped the lines instead of introducing these extra
variables; the key observation is that it would make a much easier
pattern to follow for a future developer who needs to add the third
kind of "fsync" on top of the existing wo and hf.

But we can address that when somebody actually adds the third one,
so let's take the patch as-is.

Thanks.

  reply	other threads:[~2022-06-30 20:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23 15:51 [PATCH] trace2: don't include "fsync" events in all trace2 logs Ævar Arnfjörð Bjarmason
2022-06-23 18:21 ` [EXTERNAL] " Neeraj Singh (WINDOWS-SFS)
2022-06-23 19:34 ` Junio C Hamano
2022-06-30  8:56 ` [PATCH v2] " Ævar Arnfjörð Bjarmason
2022-06-30 20:45   ` Junio C Hamano [this message]
2022-07-18 10:31   ` [PATCH v3] trace2: only include "fsync" events if we git_fsync() Ævar Arnfjörð Bjarmason
2022-07-18 16:50     ` Junio C Hamano
2022-07-18 19:01       ` [EXTERNAL] " Neeraj Singh (WINDOWS-SFS)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqczepev8e.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=neerajsi@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).