Verify predefined LWLocks tranches have entries in wait_event_names.txt

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Verify predefined LWLocks tranches have entries in wait_event_names.txt
Date: 2025-07-18 13:39:15
Message-ID: aHpOgwuFQfcFMZ/B@ip-10-97-1-34.eu-west-3.compute.internal
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

Some discrepancies between wait_event_names.txt and predefined LWLocks tranches
have been observed, see: a493e741d32 ,08b9b9e043b and c3623703f36.

To prevent new discrepancies from occurring, this patch series aims to $SUBJECT
(as 5b1b9bce844 did for predefined LWLocks).

The patch series contains:

0001 - Extracts the predefined LWLocks tranches from lwlock.c and puts them
in a new file (namely lwlocktranchelist.h). This way, we can include this file
in lwlock.c using the same macro pattern as we do for lwlocklist.h.

This gives us the chance to cross-check with wait_event_names.txt in
generate-lwlocknames.pl in the same way as 5b1b9bce844 did.

It's much simpler and makes more sense than having generate-lwlocknames.pl
parsing lwlock.c.

0002 - While doing changes in generate-lwlocknames.pl, I noticed that
$continue is not used (Oversight in commit da952b415f4), so let's remove it.

0003 - Cross-check lists of predefined tranches

Same idea as 5b1b9bce844 i.e if the lists (in wait_event_names.txt and
lwlocktranchelist.h) do not match exactly, building will fail.

I wonder if once these get in, we could also generate "BuiltinTrancheIds" (in
lwlock.h) from lwlocktranchelist.h with generate-lwlocknames.pl.

Regards,

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

Attachment Content-Type Size
v1-0001-Create-lwlocktranchelist.h.patch text/x-diff 8.6 KB
v1-0002-Remove-unused-variable-in-generate-lwlocknames.pl.patch text/x-diff 1.1 KB
v1-0003-Cross-check-lists-of-predefined-tranches.patch text/x-diff 6.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2025-07-18 13:40:55 Re: Fix lwlock.c and wait_event_names.txt discrepancy
Previous Message Ashutosh Bapat 2025-07-18 12:17:17 Re: Upgrade from Fedora 40 to Fedora 42, or from PostgreSQL 16.3 to PostgreSQL 16.9