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 1priOE-0002VF-Ek for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Apr 2023 16:53:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1priOD-00072x-6k for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Apr 2023 16:53:09 +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 1priOC-00072o-TO for pgsql-hackers@lists.postgresql.org; Wed, 26 Apr 2023 16:53:08 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1priOA-005Cr6-0P for pgsql-hackers@lists.postgresql.org; Wed, 26 Apr 2023 16:53:08 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3f1950f5628so60926965e9.3 for ; Wed, 26 Apr 2023 09:53:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682527985; x=1685119985; 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=DvzzFkbNzVtoCw59DlOMvRkOpdpFCuF7k84zIB5Fy9s=; b=A0nflBD7nErYhZsOvjW6ZPNNFvDbervkvXjHGsm8fBkY/Z6S6MwEEFtDeraQfVmBen 2x6cMWJOhiz0Z8VlzzcZGCeQkFJ6BkxWRemlwp5eFGVlTxgB/+WqCXexudSkKseb0CLW wzlGP4AWePhs+H6VMH9bx84LnqToVuAMkKkSrQ42PpiRp/2LtzzJYTBBckeVuu0usnog 6wNdSq/KXXvjbjCZKjaKoPLXi6VlA8p0i2vLfTEHafUazr6YGBvuBJEYaUiEn9rmGe9K UhJgVIkIx5ra1PhCPCr7Vl6WPCeGt56YwvsQ5tZ4O/NzaedJPyVyK9cpRl+dzMWYEmru Q+tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682527985; x=1685119985; 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=DvzzFkbNzVtoCw59DlOMvRkOpdpFCuF7k84zIB5Fy9s=; b=PXpHXgwh3v0At371Ie+o9qKv/09wQdv3ZHlel1J5+7lzMh9dc8q9j7DmdE/pdc3O5w PGAB/56MbVgf/nRIqqTl7+ofXfT7lynT3jcdQQdZY1odgfLPVEmh28znwnS4UKg3gQi6 XVDNdbL6J4c58NK0xDYnvNPZ0XFq5meE1M8j9Ajz5heLTo3Jgfkljdqun0tpOYD86EvS yH6N+3orOexiu3O8+03pEpT3ll0TWqknU3wI5ZWvsNjsyEbkQXFwvfmmA4zBl1VZq+jx 1FOymkaOM5Su045mBWNaWs3DPy414kNqX6vQrqvz/9TO4cxaWdVtPVG2ZajZjmPuIPAN +8Bw== X-Gm-Message-State: AAQBX9fhNu2ySmvEoa3wq+p/ITpRKCiobJsxp07i+NUaQ8BdudCgxkLx SbeLE052jQEgc4t9biQHb6Qr8vm3+UP0SA== X-Google-Smtp-Source: AKy350YvdpjhK6Zcp+QAVJeYrbwbjMyE4cVBQV21KsA2kBuSq46L57P2x0XSd39Dpb8ZafdgzurMYA== X-Received: by 2002:a05:600c:2194:b0:3f1:72ec:4009 with SMTP id e20-20020a05600c219400b003f172ec4009mr13508218wme.9.1682527984390; Wed, 26 Apr 2023 09:53:04 -0700 (PDT) Received: from [192.168.27.131] ([54.239.6.186]) by smtp.gmail.com with ESMTPSA id hg7-20020a05600c538700b003f1940fe278sm15129090wmb.7.2023.04.26.09.53.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Apr 2023 09:53:03 -0700 (PDT) Message-ID: Date: Wed, 26 Apr 2023 18:51:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: Autogenerate some wait events code and documentation To: Michael Paquier Cc: PostgreSQL Hackers References: <77a86b3a-c4a8-5f5d-69b9-d70bbf2e9b98@gmail.com> <6b6cdc76-e10e-95f8-62cf-3a3137c86df5@gmail.com> <2e649ed7-6c66-5d6a-16d4-5d5367d40e69@gmail.com> 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 4/25/23 7:15 AM, Michael Paquier wrote: > On Mon, Apr 24, 2023 at 09:03:53AM +0200, Drouvot, Bertrand wrote: >> Oh right, fixed. > > I may tweak a few things if I put my hands on it, but that looks > pretty solid seen from here.. Glad to hear! ;-) > I have spotted a few extra issues. > > One thing I have noticed with v4 is that the order of the tables > generated in wait_event_types.h and the SGML docs is inconsistent with > previous versions, and these are not in an alphabetical order. HEAD > orders them as Activity, BufferPin, Client, Extension, IO, IPC, Lock, > LWLock and Timeout. This patch switches the order to become > different, and note that the first table describing each of the wait > event type classes gets it right. > Right, ordering being somehow broken is also something I did mention initially when I first presented this patch up-thread. That's also due to the fact that this patch does not autogenerate PG_WAIT_LWLOCK, PG_WAIT_LOCK, PG_WAIT_BUFFER_PIN and PG_WAIT_EXTENSION. > It seems to me that you should apply an extra ordering in > generate-waiteventnames.pl to make sure that the tables are printed in > the same order as previously, around here: > +# Generate the output files > +foreach $waitclass (keys %hashwe) { > Yeah but that would still affect only the auto-generated one and then result to having the wait event part of the documentation "monitoring-stats" not ordered as compared to the "Wait Event Types" Table. And as we have only one "include" in doc/src/sgml/monitoring.sgml for all the auto-generated one, the ordering would still be broken. > (The table describing all the wait event types could be removed from > the SGML docs as well, at the cost of having their description in the > new .txt file. However, as these are long, it would make the .txt > file much messier, so not doing this extra part is OK for me.) Right, but that might be a valuable option to also fix the ordering issue mentioned above (need to look deeper at this). > > - * Use this category when a process is waiting because it has no work to do, > - * unless the "Client" or "Timeout" category describes the situation better. > - * Typically, this should only be used for background processes > > wait_event.h includes a set of comments describing each category, that > this patch removes. Rather than removing this information, which is > helpful to have around, why not making them comments of > waiteventnames.txt instead? Losing this information would be sad. > Yeah, good point, I'll look at this. > +# src/backend/utils/activity/pgstat_wait_event.c > +# c functions to get the wait event name based on the enum > Nit. 'c' should be upper-case. > > } > + > if (IsNewer( > 'src/include/storage/lwlocknames.h', > Not wrong, but this is an unrelated diff. > Yeah, probably due to a pgindent run. > +if %DIST%==1 if exist src\backend\utils\activity\pgstat_wait_event.c del /q src\backend\utils\activity\pgstat_wait_event.c > if %DIST%==1 if exist src\backend\storage\lmgr\lwlocknames.h del /q src\backend\storage\lmgr\lwlocknames.h > +if %DIST%==1 if exist src\backend\utils\activity\wait_event_types.h del /q src\backend\utils\activity\wait_event_types.h > The order here is off a bit. Missed that previously.. > > perltidy had better be run on generate-waiteventnames.pl (I can do > that myself, no worries), as a couple of lines' format don't seem > quite in line. Will do, no problem at all. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com