Re: Make pg_stat_io view count IOs as bytes instead of blocks

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, Melanie Plageman <melanieplageman(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Make pg_stat_io view count IOs as bytes instead of blocks
Date: 2025-01-16 05:47:17
Message-ID: 1550522.1737006437@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Paquier <michael(at)paquier(dot)xyz> writes:
> Not completely sure about the number of parenthesis, but I hope that
> this should be enough (extra set around io_op):
> +#define pgstat_is_ioop_tracked_in_bytes(io_op) \
> + (((unsigned int) (io_op)) < IOOP_NUM_TYPES && \
> + ((unsigned int) (io_op)) >= IOOP_EXTEND)

Yeah, that's safe parenthesis-wise. Whether it'll silence
the warning from those old clangs remains to be seen.

(But if it doesn't, maybe it's not worth working harder,
given that they're old.)

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yugo NAGATA 2025-01-16 05:53:35 Re: Allow ILIKE forward matching to use btree index
Previous Message Michael Paquier 2025-01-16 05:43:43 Re: Make pg_stat_io view count IOs as bytes instead of blocks