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 1rm9EA-006I9J-16 for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Mar 2024 09:24:19 +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 1rm9E7-00HMoy-Ki for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Mar 2024 09:24:16 +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 1rm9E6-00HMop-4V for pgsql-hackers@lists.postgresql.org; Mon, 18 Mar 2024 09:24:15 +0000 Received: from fhigh5-smtp.messagingengine.com ([103.168.172.156]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rm9Dw-0057QP-PR for pgsql-hackers@lists.postgresql.org; Mon, 18 Mar 2024 09:24:12 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 1779E11400E5; Mon, 18 Mar 2024 05:24:04 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 18 Mar 2024 05:24:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1710753844; x= 1710840244; bh=sg8lG1O9bWTCxulRQtPo63j1wHeO8VLCgioR/5Ehswg=; b=C qJ4dCmovwPSbf3QDQelngZyUOHhzLCVlwGp7lR1xYKtSuus3Zl4cf5BEyAz1QFHu J9JZV4+K+JGqP0PmA22Z6f72DgUeiqoEGeLnoPC205aM9h9MjKSM561Z068wAzH4 dXNOBzjplBIYt7RiyRq0b3IQjcmngYI94LbZFbTaSX+ypGWPXKb/q57/8cEArtpT W0lXpS8pKDG4YJhxJB2sncFgutNA6xX3+Ugy6IGyTJambM3U4/COMKVNp0Ib2zCR 9YngnT38jzFhM5X6VBcotcLdU//2XSpVAHHakIBjYBVQDGxZOgU6qQAwzfD0wPfe T5SDNNvnY7ibek8wsmWqA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrkeejgddtgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpeffffdvgfeuhfehjeeluedvtdfhieegteffgedvudegteeu hedtgfffveettdevfeenucffohhmrghinhepthigthdrfhhtrhdpvghnthgvrhhprhhish gvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 18 Mar 2024 05:24:03 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1710753840; bh=9/ANpmFs6wPlGRa4H8NB64LGqJ3aTsV6IDvd3+yxNF4=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=MaD6xySQJS6ba44VLWbE7rs4l2CW+u5b/UgRGtfJBdxqfnWZf9yqd4JewYm1UTrIu RNv5bhERg/9HdiKO621h0LqXHno6nrQNepyTDCin9c+JksIePpU5XpRaXmLJZtz1WQ EhvmQpzix37lXGuiI2jW6+BRVVVdhOffE0bNL05tQoHR8/Ndm8pFY9EOEe1oSecOwS IHUeUKcth4ntgLvfrcDoZh1RQCaOlJk4kJYPrdYE8smPT4soo/b/Ucssd3rJ6SMaG6 b7dHH9fv8nmmZQdQMxQdUR0aM+TTZtLvifMK0jQKFaK/FhskaUoiaMBnR5BrU/1GtU WeyLobs6SkV4A== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 662DCD41; Mon, 18 Mar 2024 10:24:00 +0100 (CET) Date: Mon, 18 Mar 2024 10:24:00 +0100 From: Alvaro Herrera To: Michael Paquier Cc: Andres Freund , "Drouvot, Bertrand" , PostgreSQL Hackers Subject: Re: Autogenerate some wait events code and documentation Message-ID: <202403180924.rqdpwo4b3bd5@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-Aug-28, Michael Paquier wrote: > 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. FTR I had a rather unpleasant time last week upon finding a wait event named PgSleep. If you grep for that, there are no matches at all; and I spent ten minutes (for real) trying to figure out where that was coming from, until I remembered this thread. Now you have to guess that not only random lowercasing is happening, but also underscore removal. This is not a good developer experience and I think we should rethink this choice. It would be infinitely more usable, and not one bit more difficult, to make these lines be WAIT_EVENT_FOO_BAR FooBar "Waiting on Foo Bar." then there is no guessing involved. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "The important things in the world are problems with society that we don't understand at all. The machines will become more complicated but they won't be more complicated than the societies that run them." (Freeman Dyson)