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 1rSFFu-00CM9V-WA for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Jan 2024 11:47:51 +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 1rSFFu-00CK2E-2p for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Jan 2024 11:47:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rSFFs-00CK1v-LO for pgsql-hackers@lists.postgresql.org; Tue, 23 Jan 2024 11:47:49 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rSFFq-003I9c-36 for pgsql-hackers@lists.postgresql.org; Tue, 23 Jan 2024 11:47:48 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id 13F525C00C1; Tue, 23 Jan 2024 06:47:44 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Tue, 23 Jan 2024 06:47:44 -0500 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=fm3; t=1706010464; x= 1706096864; bh=lGUZS9GOqHJy+m6Sej4RZfSU2tjxFZpWTP6927v+DGQ=; b=W ARJRh/562h0vjV+bLRRIpO1VqBBKq6llZF+FwK6lOn1LCNauQ8PWUIG20BZ89VRH pwe1XeCR1BAg9O8sgh6RYzwDv32L8hZi7arpbHjncyexpzb8Xt6U5f+sIC5D0ayj nNA/pSLraGsuqF6OMn0SavCzWLUcsEsxcGcM6gXb1PdvtfgOl/CuT9DqskQzilQ8 S+eMTFoVwanIlRcjw1WEqDREdoYIGI4CKYANIyO3h6udVCFRicnaxE4MjC8OAN9v kJG5cJalMgTCgOQivOdm0uki6CzwwvcgrDDcY4s2f6yf3wJ2L1Lv0t6FHqcQEO4o zQD725lTYwBujfa3pt0RQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdekkedgfedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepkeetuedvtdfhueeitdefgfekvdfgtdevuddufeeitdek heefuddvheegvefhfeefnecuffhomhgrihhnpegtihhrrhhushdqtghirdgtohhmpdgvnh htvghrphhrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 23 Jan 2024 06:47:43 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1706010462; bh=poCR9mWafm7N0JqzFVZJWqnQTkhdR+b7GtxQ0rtcI6w=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=a2bldJjdJHpqSDUiXKDywBCWhy9mN10ByK54HrZYzQWJHzxtrdxQYTBoR1Yvo4SyG Wc9tJIS9ylT7AKy97Cl8zSkto+Bf2hHizoBC5v6jRZIeUYLSCXajENYhkClADYw7MY x700fAMUTIOoBr8tNacaMBiIxzloizC7moNzWnj+v2XlJXz1Wip447WthfYC2DChnC /hdl/2oToHI/VLMYIsFNrR0fstkO42VGvdcSDWH1pKjVoHObZ1TYr+u0lX7qkBz+O2 fW4JXjERkE5UiXnSgMgb5l78lJ9H8QY3BhiToe9NwLi2PcSXyF/KZzhiXQ1/MmPJvF /0wBpUav8jpiw== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 16FA398; Tue, 23 Jan 2024 12:47:42 +0100 (CET) Date: Tue, 23 Jan 2024 12:47:42 +0100 From: Alvaro Herrera To: Heikki Linnakangas Cc: Pg Hackers Subject: Re: make BuiltinTrancheNames less ugly Message-ID: <202401231147.clytrnaysp43@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <31066a40-3844-4238-98a4-5eec3f8a598e@iki.fi> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024-Jan-23, Heikki Linnakangas wrote: > On 23/01/2024 12:25, Alvaro Herrera wrote: > > 2. More invasively, rework generate-lwlocknames.pl so that both lwlocks > > and these builtin tranche names appear in a single array. (We could do > > so by #include'ing lwlocknames.c at the top of the array). > Idea 2 seems pretty straightforward, +1 for that. This is what I came up with. For the compilation framework (both Makefile and meson) I mostly just copied what we do in src/backend/node, which seems to have passed CI just fine, but maybe there are better ways to achieve it. ... oh, actually FreeBSD failed with this strange problem while linking: [11:39:43.550] ld: error: undefined symbol: __dtraceenabled_postgresql___lwlock__wait__start [11:39:43.551] >>> referenced by lwlock.c:1277 (../src/backend/storage/lmgr/lwlock.c:1277) [11:39:43.551] >>> lwlock.a.p/lwlock.c.o:(LWLockAcquire) in archive src/backend/storage/lmgr/lwlock.a [11:39:43.551] >>> referenced by lwlock.c:1442 (../src/backend/storage/lmgr/lwlock.c:1442) [11:39:43.551] >>> lwlock.a.p/lwlock.c.o:(LWLockAcquireOrWait) in archive src/backend/storage/lmgr/lwlock.a [11:39:43.551] >>> referenced by lwlock.c:1660 (../src/backend/storage/lmgr/lwlock.c:1660) [11:39:43.551] >>> lwlock.a.p/lwlock.c.o:(LWLockWaitForVar) in archive src/backend/storage/lmgr/lwlock.a [11:39:43.551] [ further similar lines ] https://cirrus-ci.com/task/5055489315176448?logs=build#L1091 I have no idea what this means or how is it related to what I'm doing. IMO it would be less ugly to have the origin file lwlocknames.txt be not a text file but a .h with a macro that can be defined by interested parties so that they can extract what they want from the file, like PG_CMDTAG or PG_KEYWORD. Using Perl for this seems dirty ... -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "In Europe they call me Niklaus Wirth; in the US they call me Nickel's worth. That's because in Europe they call me by name, and in the US by value!"