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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ævar Arnfjörð Bjarmason  <avarab@xxxxxxxxx> 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
> 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.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux