Re: Autogenerate some wait events code and documentation

From: "Drouvot, Bertrand" <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Autogenerate some wait events code and documentation
Date: 2023-07-04 10:04:50
Message-ID: 2b81dcc2-7a3d-10f0-e93d-016002bbc721@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 7/4/23 9:34 AM, Drouvot, Bertrand wrote:
> Hi,
>
> On 7/3/23 9:11 AM, Michael Paquier wrote:
>> On Mon, Jul 03, 2023 at 03:57:42PM +0900, Michael Paquier wrote:
>
> Thanks for looking at it and having fixed the issues that were present in
> v10.
>
>>> I think that we should add some options to the perl script to be more
>>> selective with the files generated.  How about having two options
>>> called --docs and --code to select one or the other, then limit what
>>> gets generated in each path?  I guess that it would be cleaner if we
>>> error in the case where both options are defined, and just use some
>>> gotos to redirect to each foreach loop to limit extra indentations in
>>> the script.  This would avoid the need to remove the C and H files
>>> from the docs, additionally, which is what the Makefile in doc/ does.
>>>
>>> I have fixed all the issues I've found in v11 attached, except for the
>>> last one (I have added the OUTDIR trick for reference, but that's
>>> incorrect and incomplete).  Could you look at this part?
>>
>> Ah.  It took me a few extra minutes, but I think that we should set
>> "capture" to "false", no?  It looks like meson is getting confused,
>> expecting something in stdout but the new script generates a few
>> files, and does not output anything.  That's different from the other
>> doc-related perl scripts.
>> --
>
> Yeah, with "capture" set to "false" then ninja alldocs does not error out
> and wait_event_types.sgml gets generated.
>
> I'll look at the extra options --code and --docs.

Please find attached v12 that:

- sets "capture" to "false"
- adds the --code and --docs extra options to generate-wait_event_types.pl
- makes sure at least one of those option is provided
- makes sure that both options can't be provided simultaneously
- update the related Makefile/meson.build files accordingly
- fix a bug in generate-wait_event_types.pl (die on rename($stmp...) was not
using the right file (it was using ctmp). That was not visible before the docs/code
split.

Not related to this patch but I noticed that when building with meson some c files
are duplicated a the end of the build.

Indeed, they also appear in some include directories:

./meson_build/src/include/storage/lwlocknames.c
./meson_build/src/include/utils/pgstat_wait_event.c
./meson_build/src/include/utils/fmgrtab.c
./meson_build/src/include/nodes/queryjumblefuncs.funcs.c
./meson_build/src/include/nodes/readfuncs.switch.c
./meson_build/src/include/nodes/readfuncs.funcs.c
./meson_build/src/include/nodes/copyfuncs.switch.c
./meson_build/src/include/nodes/equalfuncs.funcs.c
./meson_build/src/include/nodes/outfuncs.switch.c
./meson_build/src/include/nodes/queryjumblefuncs.switch.c
./meson_build/src/include/nodes/copyfuncs.funcs.c
./meson_build/src/include/nodes/equalfuncs.switch.c
./meson_build/src/include/nodes/outfuncs.funcs.c

Is it expected? If not, I guess it's worth another patch.

Regards,

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

Attachment Content-Type Size
v12-0001-Generate-automatically-wait-event-related-code-a.patch text/plain 123.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2023-07-04 11:15:45 Re: Incremental sort for access method with ordered scan support (amcanorderbyop)
Previous Message Aleksander Alekseev 2023-07-04 10:02:37 Re: Add 64-bit XIDs into PostgreSQL 15