Re: Make pg_stat_io view count IOs as bytes instead of blocks - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Make pg_stat_io view count IOs as bytes instead of blocks
Date
Msg-id 1550522.1737006437@sss.pgh.pa.us
Whole thread Raw
In response to Re: Make pg_stat_io view count IOs as bytes instead of blocks  (Nazir Bilal Yavuz <byavuz81@gmail.com>)
Responses Re: Make pg_stat_io view count IOs as bytes instead of blocks
List pgsql-hackers
Michael Paquier <michael@paquier.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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Make pg_stat_io view count IOs as bytes instead of blocks
Next
From: Yugo NAGATA
Date:
Subject: Re: Allow ILIKE forward matching to use btree index