public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: Drouvot, Bertrand <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Autogenerate some wait events code and documentation
Date: Thu, 20 Apr 2023 10:09:17 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>

On Wed, Mar 29, 2023 at 02:51:27PM +0200, Drouvot, Bertrand wrote:
> Just realized that more polishing was needed.
> 
> Done in V2 attached.

That would be pretty cool to get that done in an automated way, I've
wanted that for a few years now.  And I guess that a few others have
the same feeling after missing to update these docs when adding a new
wait event, or just to enforce this alphabetically, so let's do
something about it in v17.

About the alphabetical order, could we have the script enforce a sort
of the elements parsed from waiteventnames.txt, based on the second
column?  This now relies on the order of the items in the file, but
my history with this stuff has proved that forcing an ordering rule
would be a very good thing long-term.

Seeing waiteventnames.txt, I think that we should have something
closer to errcodes.txt.  Well, seeing the patch, I assume that this is
inspired by errcodes.txt, but this new file should be able to do more
IMO:
- Supporting the parsing of comments, by ignoring them in
generate-waiteventnames.pl.
- Ignore empty likes.
- Add a proper header, copyright, the output generated from it, etc.
- Document the format lines of the file.

It is clear that the format of the file is:
- category
- C symbol in enums.
- Format in the system views.
- Description in the docs.
Or perhaps it would be better to divide this file by sections (like
errcodes.txt) for each category so as we eliminate entirely the first
column?

This number from v2 is nice to see:
 17 files changed, 423 insertions(+), 955 deletions(-)

Perhaps waiteventnames.c should be named pgstat_wait_event.c?  The
result is simply the set of pgstat functions, included in
wait_event.c (this inclusion is OK for me).  Similarly,
wait_event_types.h would be a better name for the set of enums? 

          utils/adt/jsonpath_scan.c \
+         utils/activity/waiteventnames.c \
+         utils/activity/waiteventnames.h \
+         utils/adt/jsonpath_scan.c \

Looks like a copy-pasto.

Note that the patch does not apply, there is a conflict in the docs.
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../[email protected]/2-signature.asc)
  download

view thread (23+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Autogenerate some wait events code and documentation
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox