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 1qJl6Z-0002Ay-CG for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Jul 2023 01:26:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qJl6X-0004KX-8N for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Jul 2023 01:26:49 +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 1qJl6W-0004KN-VL for pgsql-hackers@lists.postgresql.org; Thu, 13 Jul 2023 01:26:48 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qJl6O-0008CC-Qu for pgsql-hackers@lists.postgresql.org; Thu, 13 Jul 2023 01:26:47 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTPA id AEB2B60172; Thu, 13 Jul 2023 10:26:35 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.8 at oss.nttdata.com MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 13 Jul 2023 10:26:35 +0900 From: Masahiro Ikeda To: Michael Paquier Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Support to define custom wait events for extensions In-Reply-To: References: <135feae32cd28f9fb555fe46acb939a0@oss.nttdata.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: X-Sender: ikedamsh@oss.nttdata.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-07-13 09:12, Michael Paquier wrote: > On Wed, Jul 12, 2023 at 05:46:31PM +0900, Michael Paquier wrote: >> On Wed, Jul 12, 2023 at 04:52:38PM +0900, Masahiro Ikeda wrote: >>> If the behavior is unexpected, we need to change the current code. >>> I have created a patch for the areas that I felt needed to be >>> changed. >>> - 0001-change-the-die-condition-in-generate-wait_event_type.patch >>> (In addition to the above, "$continue = ",\n";" doesn't appear to be >>> necessary.) >> >> die "wait event names must start with 'WAIT_EVENT_'" >> if ( $trimmedwaiteventname eq $waiteventenumname >> - && $waiteventenumname !~ /^LWLock/ >> - && $waiteventenumname !~ /^Lock/); >> - $continue = ",\n"; >> + && $waitclassname !~ /^WaitEventLWLock$/ >> + && $waitclassname !~ /^WaitEventLock$/); >> >> Indeed, this looks wrong as-is. $waiteventenumname refers to the >> names of the enum elements, so we could just apply a filter based on >> the class names in full. The second check in for the generation of >> the c/h files uses the class names. > > At the end, I have gone with an event simpler way and removed the > checks for LWLock and Lock as their hardcoded values marked as DOCONLY > satisfy this check. The second check when generating the C and header > code has also been simplified a bit to use an exact match with the > class name. Thanks for your quick response. I'll rebase for the commit. Regards, -- Masahiro Ikeda NTT DATA CORPORATION