Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pqmfr-0008EP-0l for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Apr 2023 03:15:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pqmfp-0005H7-Ox for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Apr 2023 03:15:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pqmfo-0005Gy-21 for pgsql-hackers@lists.postgresql.org; Mon, 24 Apr 2023 03:15:29 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pqmfj-004j34-RW for pgsql-hackers@lists.postgresql.org; Mon, 24 Apr 2023 03:15:27 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 6641132005D8; Sun, 23 Apr 2023 23:15:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 23 Apr 2023 23:15:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1682306120; x=1682392520; bh=lw dEa+i7Kg4SE/sX3/wXaOzElqGR8O4j8WuktZDnVlQ=; b=SOtr9urpIeUdc2lkzG 8TkrVopo4V1sfYlsz9B0QHzWPhvm/ICrCTpgYzIpBzWBGle9HX4/kVpgsyqzQDmc 02gmTbwkIt+fD6mf7V9QFsXsOFN1RdiKeLhm4b+bLBKxXdRSVtHd4eNKcRG67CO0 MyCH8Y68dEDYBWazaLG55vxMKRlGTMBqsIFe/ytHGCaFUHAjjAChpAaD4F6T4Grw iYRbr5ei+v+NSfLrYie0A1FN2yOJBUDfzXj0Sx9ar6WZ0VeCH/L2n9tnxqd7QwQr vlHN5apQk7l/7C/y08kGr7aRIuLUHuXZZRqt76NIPO3dXyDaNvhv4DMnkDbC0yQF 7flg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1682306120; x=1682392520; bh=lwdEa+i7Kg4SE /sX3/wXaOzElqGR8O4j8WuktZDnVlQ=; b=VMsCApHuZX/YpHpIk2RvEWcg3kqFn B8/z85haf6KEfNocNw6GGN61bC54NsvE/ew5pX0VKsz9umvl0Kgdw2DrmyvGZ5Xz 3sGm7CK6K7q+Ytd9BnLcVCOHJFomAEuzX3f+m8Tu3JC36V+QcN8iJqXwmw2IMPc4 Pc3fBgIRcoJfEWB3WzSBei5wrQOTKc/zGIuKgC7o66WReXeTq6HVaU9PjuBVNTqA n6XjMdHP3VkYlC9lGZShW80wKjuss94DJjQtQfdpPuw9qCXkD3uF1QPTjvlJPM72 /k1GLJoGmOIu3MlKxk1Jij2Ie3SeDCIhk6X9Ko74pD8aTdF0WIjFw1KxA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedtledgjedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 23 Apr 2023 23:15:18 -0400 (EDT) Date: Mon, 24 Apr 2023 12:15:13 +0900 From: Michael Paquier To: "Drouvot, Bertrand" Cc: PostgreSQL Hackers Subject: Re: Autogenerate some wait events code and documentation Message-ID: References: <77a86b3a-c4a8-5f5d-69b9-d70bbf2e9b98@gmail.com> <6b6cdc76-e10e-95f8-62cf-3a3137c86df5@gmail.com> <2e649ed7-6c66-5d6a-16d4-5d5367d40e69@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="QBWZEYKofo64Qnan" Content-Disposition: inline In-Reply-To: <2e649ed7-6c66-5d6a-16d4-5d5367d40e69@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --QBWZEYKofo64Qnan Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 22, 2023 at 03:36:05PM +0200, Drouvot, Bertrand wrote: > On 4/20/23 3:09 AM, Michael Paquier wrote: >> 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? >=20 > Yeah, that could be an option. V3 is still using the category as the firs= t column > but I'm ok to change it by a section if you prefer (though I don't really= see the need). It can make the file width shorter, at least.. [ .. thinks .. ] +my $waitclass; +my @wait_classes =3D ("PG_WAIT_ACTIVITY", "PG_WAIT_CLIENT", "PG_WAIT_IPC",= "PG_WAIT_TIMEOUT", "PG_WAIT_IO"); Actually, having a "Section" in waiteventnames.txt would remove the need to store this knowledge in generate-waiteventnames.pl, which is a duplicate of the txt contents. If somebody adds a new class in the future, it would be necessary to update this path as well. Well, that would not be a huge effort in itself, but IMO the script translating the .txt to the docs and the code should have no need to know the types of classes. I guess that a format like that would make the most sense to me, then: Section: ClassName PG_WAIT_CLASS_NAME # ClassName would be "IO", "IPC", "Timeout", etc. WAIT_EVENT_NAME_1 "WaitEventName1" "Description of wait event 1" WAIT_EVENT_NAME_N "WaitEventNameN" "Description of wait event N" >> utils/adt/jsonpath_scan.c \ >> + utils/activity/waiteventnames.c \ >> + utils/activity/waiteventnames.h \ >> + utils/adt/jsonpath_scan.c \ >>=20 >> Looks like a copy-pasto. >=20 > Why do you think so? both files have to be removed. jsonpath_scan.c is listed twice, and that's still the case in v3. The list of files deleted for maintainer-clean in src/backend/Makefile should be listed alphabetically (utils/activity/ before utils/adt/), but that's a nit ;) -- Michael --QBWZEYKofo64Qnan Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmRF9EEACgkQnvQgOdby QH2K8BAAmDKiLTe/ScbfUW8AVAfxOcDNqB0ozp3vqFPiCtYY0RRHZ5ecGr3PirwN M6k2mOmXV2SCVBDFMA2Su4qSZ226lBGF2Xy2UQVY4aSpAmsqF0KEePhF6U6SBkpB JS1OJyc7fjXp0Ksec7o+GYpMd/hLJfGDrt/gZQcthTMexss99FXH5q2N73GxPdNh Rs7OT5UUrhbtzjaSwo628sLNh+I5LxEpcmZkg6EJEkQfOFFtfi/9305MdO+wEhEU /N5S7OIFvAeKJ+bUnJE6QVNrQS05J/P811oEJ/UinNKkOLNVxjbMJ753gJH7PZT5 Ao9MJ1TWuKWWdvm7uX7BLRbVZVpIHqBbKHWurzZbiUdds14dGidMhCkIYCl7SHZj K2LDtQ6uQNrXhhJOc3Jhbnje87v/Q05sNbiqohgAlJG//3S8w99xcLUm0v9NVWu+ 7SMKFxxATPemESV8H+DVF0rEQOVKAgvEvW7QCuo77vR3GvXyaOcvd9QSThSfpWnh ry1P26SDXwUz4LJvrWMiP2yH8cUXHghcI8vG4vPc7tF9HuWee7nDyCX1NLu58sO5 O8ci8cDOEf9jphruy700LGA0ZxTlJiJu3RjE+q4RJyXOt4UyRuIvfmKeheatmKQe vEGp06hOemzWSUpthAeO7iWWI9sVW8xqbIJBsdzWvEiTo8tksKA= =yHvs -----END PGP SIGNATURE----- --QBWZEYKofo64Qnan--