public inbox for [email protected]  
help / color / mirror / Atom feed
From: Drouvot, Bertrand <[email protected]>
To: Michael Paquier <[email protected]>
To: Andres Freund <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: Alvaro Herrera <[email protected]>
Subject: Re: Autogenerate some wait events code and documentation
Date: Tue, 29 Aug 2023 08:17:10 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <ZOxVHQwEC/9X/p/[email protected]>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<ZOxVHQwEC/9X/p/[email protected]>

Hi,

On 8/28/23 10:04 AM, Michael Paquier wrote:
> On Mon, Jul 17, 2023 at 10:16:02AM +0900, Michael Paquier wrote:
>> So you mean to switch a line that now looks like that:
>> WAIT_EVENT_FOO_BAR   FooBar        "Waiting on Foo Bar."
>> To that:
>> FOO_BAR   "Waiting on Foo Bar."
>> Or even that:
>> WAIT_EVENT_FOO_BAR   "Waiting on Foo Bar."
>>
>> Sure, it is an improvement for any wait events that use WAIT_EVENT_
>> when searching them, but this adds more magic into the LWLock and Lock
>> areas if the same conversion is applied there.  Or am I right to
>> assume that you'd mean to *not* do any of that for these two classes?
>> These can be treated as exceptions in the script when generating the
>> wait event names from the enum elements, of course.
> 
> I have looked again at that, and switching wait_event_names.txt to use
> two columns made of the typedef definitions and the docs like is not a
> problem:
> FOO_BAR   "Waiting on Foo Bar."
> 
> WAIT_EVENT_ is appended to the typedef definitions in the script.  The
> wait event names like "FooBar" are generated from the enums by
> splitting using their underscores and doing some lc().  Lock and
> LWLock don't need to change.  This way, it is easy to grep the wait
> events from the source code and match them with wait_event_names.txt.
> 
> Thoughts or comments?

Agree that done that way one could easily grep the events from the source code and
match them with wait_event_names.txt. Then I don't think the "search" issue in the code
is still a concern with the current proposal.

FWIW, I'm getting:

$ git am v3-000*
Applying: Rename wait events with more consistent camelcase style
Applying: Remove column for wait event names in wait_event_names.txt
error: patch failed: src/backend/utils/activity/wait_event_names.txt:261
error: src/backend/utils/activity/wait_event_names.txt: patch does not apply
Patch failed at 0002 Remove column for wait event names in wait_event_names.txt

Regards,

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






view thread (32+ 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], [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