Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qLCqa-002Zn8-Fe for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Jul 2023 01:16:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qLCqY-002gm2-6Y for pgsql-hackers@arkaria.postgresql.org; Mon, 17 Jul 2023 01:16:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qLCqX-002glu-0k for pgsql-hackers@lists.postgresql.org; Mon, 17 Jul 2023 01:16:17 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qLCqR-000oaO-QQ for pgsql-hackers@lists.postgresql.org; Mon, 17 Jul 2023 01:16:15 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id EB2185C008B; Sun, 16 Jul 2023 21:16:09 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sun, 16 Jul 2023 21:16:09 -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=1689556569; x=1689642969; bh=Mn chz2JGDt9KOZ18+Kwey+eZaQf3pRMPzAxKBgDkn8A=; b=wa6QTDxG32iKuLOcUZ yMGL+mOH92sMUdhUjAvrdTtvOAZsEzT4JKKJp4NqinU/Qzm6XqCYNwcPSFBt5omA krSKfl1OMHK0YhuuvPDukEsaTcnXsgfkso11yPQ8hnXDoj2/m1857vxmijuRXeG4 ZH5NG9t6duimBynuewUU9z02mQvFQOq5I6gZBvJFOO1WnjRXpgu5JrNRZUOSBMaM VBKsSqDGwysoGJg0VfX1+G9c1Bba5KOAUJpFu1fMVqDZpyA2c4cSiw4kcHlxDEK2 zMvxwU4bo899iHv0yourVXQZwXKLQH7ABsLX6JcT65tRI6NVSJkeS82uP97Kgizb xojA== 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=1689556569; x=1689642969; bh=Mnchz2JGDt9KO Z18+Kwey+eZaQf3pRMPzAxKBgDkn8A=; b=j/uMHRDYXLlqFyKM0MaPztoqaOhRY G5NwKXRqyKC6oVcxt2aI2Tj8s+XTHlG7EYPEj93gnT8iXVmECbdcsQfFBzuZOxSt CudB/qRmd4tR38qGWzPEWeKZUYAldO/pxxIcHzTN4O+Jn1mdMMje0/Emo2S7cdI+ QKlD8a1nv1tX/G+oBWlMtOyVyBlw+/2ujFV7gPs1jasVbuQz/NDNXDzCa8qe9+d2 UGH2P9b4dcK2A28/dLzTS3pQqUs74I/BH09kK7mDZphlygurO9gmPYQUVseV7nhk u3GrQFYMQlomVo+HNvtR4c9GG2gT+RP9IMXXkb2bTMlBigmBJPzllhKBQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrgedugdeghecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeg geffhfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 16 Jul 2023 21:16:07 -0400 (EDT) Date: Mon, 17 Jul 2023 10:16:02 +0900 From: Michael Paquier To: Andres Freund Cc: "Drouvot, Bertrand" , PostgreSQL Hackers , Alvaro Herrera Subject: Re: Autogenerate some wait events code and documentation Message-ID: References: <1f74adab-5ed8-450a-853a-f0b4bfe0e751@gmail.com> <9682e829-4120-a3d5-4834-d909ad4b49d8@gmail.com> <20230716192120.t53prl2uruingo6z@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="HEdmgoeMywJSx4r2" Content-Disposition: inline In-Reply-To: <20230716192120.t53prl2uruingo6z@awork3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --HEdmgoeMywJSx4r2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 16, 2023 at 12:21:20PM -0700, Andres Freund wrote: > I think the search issue is valid, so I do think going the other way is > preferrable. I.e. use just the enum value in the .txt and generate the ca= mel > case name from that. That allows you to search the define used in code and > find a hit in the file. >=20 > I personally would still leave off the WAIT_EVENT prefix in the .txt, I t= hink > most of us can remember to chop that off. 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 don't think we need to be particularly consistent with wait events acro= ss > major versions. They're necessarily tied to how the code works, and we've > yanked that around plenty. IMO, it depends on the code path involved. For example, I know of some code that relies on SyncRep to track backends waiting on a sync reply, and that's one sensible to keep compatible. I'd be sad if something like that breaks suddenly after a major release. -- Michael --HEdmgoeMywJSx4r2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmS0llIACgkQnvQgOdby QH1yXA//TyQs1iC3n4BtgKcUdT+M3Bb8Yha4jB8m2ZMz1S8H7BZYBRPys3Z5I3uH 2IT1xv4t64/ygZa2Owt2sNEpxVDW/KLzVGuRrVYic4Lw/jLJCLW4lexLrMkiWKCh siqP2zWRbQHX+hGjplpeiMpUovl+vMA3boQQARPGlbnE1L89O8/o7UfwT6UDEY21 Pn3dkMWpZOVo6WRlJchcyX1HDYgH/WP+JlEhHevM4ZYBIpzJTaH8sWWXPeNRhi4f U+tQMUSn8sfe8yc5A5WQE6ng3R/3wvFmQD13vo3zvLXdOrL14WsKZJJ0UxNgRYBU /QTDhk6iFpsIvEaYXMkSr5dNAkikqovhD27vl8e3jYZ4DimxREwYqaxFidm4jk1O EGnuYkOZaJJ1hyW7XS77snlAw1CSavEoWuCJtBdqiVWC7TdM2O24KE5cknniueZt 4Tm5INqv1exxG1dqf7skZl2p6FAg9FKXAByv5zKiScHXd1sCWQMTp8WvD0Z16wel FcH0oqpRVMUMSG9gyUH1YFP9XKKISE/PJK+/NWDAxcNi4XE5XpRQKtni3UR/UBq8 q5K5FNUnOjSV4cT11DFSmwtpOpN9jj0p55zxuGMcKQANDrwEysLhVkf+ZXLwn5RW t7A+pemrMeWYx+hxL8cXPSxCcG0Dvjy0c1T3RESoZz8+/VawPBk= =np26 -----END PGP SIGNATURE----- --HEdmgoeMywJSx4r2--