Re: Verify predefined LWLocks tranches have entries in wait_event_names.txt

Bertrand Drouvot <bertranddrouvot.pg@gmail.com>

From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Nathan Bossart <nathandbossart@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-07-23T06:22:16Z
Lists: pgsql-hackers

Attachments

Hi,

On Wed, Jul 23, 2025 at 12:23:37PM +0900, Michael Paquier wrote:
> On Tue, Jul 22, 2025 at 02:25:13PM -0500, Nathan Bossart wrote:
> > I stared at this patch some more and came up with the attached.  The
> > biggest change is that I've moved the list of built-in LWLock tranches to
> > the existing lwlocklist.h file.  That simplifies the patch and centralizes
> > these lists.  This is arguably a bit too much preprocessor magic, though.

Yeah, but OTOH we avoid the addition of a new file and we avoid changing some
meson and make files. Also the distinction is still clear as we are using a new
macro name. So that's fine by me.

> > Thoughts?

I noticed that you removed the LWTRANCHE_ prefix in lwlocklist.h, while I agree
that's not needed, that could be misleading for people that grep for things like
"LWTRANCHE_XACT_BUFFER" for example. I don't think that's a big deal though.

Also, I think we don't need to read lwlocklist.h twice in generate-lwlocknames.pl.

PFA v4 where the only change compared to v3 is that it reads lwlocklist.h once
in generate-lwlocknames.pl.

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Commits

  1. Cross-check lists of built-in LWLock tranches.

  2. Remove unused variable in generate-lwlocknames.pl.

  3. Rework lwlocknames.txt to become lwlocklist.h