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 1qas2R-00AZrc-GT for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Aug 2023 06:17: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 1qas2Q-003nqk-Af for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Aug 2023 06:17: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 1qas2Q-003nqP-0H for pgsql-hackers@lists.postgresql.org; Tue, 29 Aug 2023 06:17:17 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qas2M-001Y6m-Ow for pgsql-hackers@lists.postgresql.org; Tue, 29 Aug 2023 06:17:16 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3fbd33a57b6so36013005e9.2 for ; Mon, 28 Aug 2023 23:17:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693289832; x=1693894632; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=vqJW9hR5pLNhVjaCW/IBcYBqAoGrUD0vQJ70zN4nHFg=; b=P2JMs6Oqj4E3hFM2yY4EvJNASyEjnfUm3r+3GN9QETi0QoxjqnQ6n5j8HQS2MWnlag aei2AfesHFv94H/5KFxcCllasy3XaMEQ3+lIsMHYoVB6jXHk0ougT7B9PUuJt1kusO2v c0Sdv36Wb4XvPw570U0mTWebtirKFiHh8/RAfNEhgsRMW/eglxGP+YKeiCRVa+z3nn1g orY334HyD6M3USCg2/idf7Yui7AjHR/dewrAk0O84qRB/6JymuqmHiReHPwZuoxb5q1k daVdBy9GXl3wHJY6V5U8/R96AWoedG8EjXgSMxAmewnZ3FmyfdsAQD3/n2b6C/RdrciB dkwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693289832; x=1693894632; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vqJW9hR5pLNhVjaCW/IBcYBqAoGrUD0vQJ70zN4nHFg=; b=QrJ+cM9VdkJ9xzgpHIKM3HhiOPGn/Ih7jjufXjp2hZPSKbEi65XNd49+UgD3Jco14t eozWjOEknO9GNUzd0FrXJGjccIjYu4nCR9kROwvcXo7pGmJmyFU74NikY/Br1O1olKFK H0orVjRsnZEZjlSKhtwkVtEEJwnAK03HB1GskIWCTasUEZS3+UzJYnOEhn6VCuMIZXAB jEFSX17rwGjmeyqscl7360E++Yk9+5VgNYXGfe2FFLpJGi616KR/J7+CH74euzbrAO1t VNQtZRiF8SMDkhJ4QzegGl0QOfgsRDJ3yWiPiCUgAyKG5tki7Cmvx+yeSwaSUBfZRhVG Qhsw== X-Gm-Message-State: AOJu0YyIs5os21MOf7IKF4Kv7zjMIWA4yU/xxRnko31/Rlb5fHFd7kMN J1VsrVfIbuHhC2+LN+/6xbk= X-Google-Smtp-Source: AGHT+IFnMN9aIEP4d0YPjmAx1JsWOON1AcuOaToxhNhNwKhBnAtIm1A5O/Em6GUoVGDNYK600qsBkQ== X-Received: by 2002:a05:600c:2307:b0:3fd:1cfa:939e with SMTP id 7-20020a05600c230700b003fd1cfa939emr21736215wmo.4.1693289831710; Mon, 28 Aug 2023 23:17:11 -0700 (PDT) Received: from ?IPV6:2a01:cb11:55e:1700:6489:54a7:f88c:9aa2? ([2a01:cb11:55e:1700:6489:54a7:f88c:9aa2]) by smtp.gmail.com with ESMTPSA id a2-20020a056000100200b0031c6cc74882sm12512914wrx.107.2023.08.28.23.17.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Aug 2023 23:17:11 -0700 (PDT) Message-ID: <6dc1587f-2ca6-4dd6-b389-94a05912fda5@gmail.com> Date: Tue, 29 Aug 2023 08:17:10 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Autogenerate some wait events code and documentation To: Michael Paquier , Andres Freund Cc: PostgreSQL Hackers , Alvaro Herrera References: <1f74adab-5ed8-450a-853a-f0b4bfe0e751@gmail.com> <9682e829-4120-a3d5-4834-d909ad4b49d8@gmail.com> <20230716192120.t53prl2uruingo6z@awork3.anarazel.de> Content-Language: en-US From: "Drouvot, Bertrand" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 8/28/23 10:04 AM, Michael Paquier wrote: > On Mon, Jul 17, 2023 at 10:16:02AM +0900, Michael Paquier wrote: >> 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 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. > > Thoughts or comments? Agree that done that way one could easily grep the events from the source code and match them with wait_event_names.txt. Then I don't think the "search" issue in the code is still a concern with the current proposal. FWIW, I'm getting: $ git am v3-000* Applying: Rename wait events with more consistent camelcase style Applying: Remove column for wait event names in wait_event_names.txt error: patch failed: src/backend/utils/activity/wait_event_names.txt:261 error: src/backend/utils/activity/wait_event_names.txt: patch does not apply Patch failed at 0002 Remove column for wait event names in wait_event_names.txt Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com