pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: make BuiltinTrancheNames less ugly
Date: Tue, 23 Jan 2024 12:47:42 +0100
Message-ID: <202401231147.clytrnaysp43@alvherre.pgsql> (raw)
In-Reply-To: <31066a40-3844-4238-98a4-5eec3f8a598e@iki.fi>

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!"





view thread (12+ messages)  latest in thread

Message-ID: <202401231147.clytrnaysp43@alvherre.pgsql>
Permalink:  ../202401231147.clytrnaysp43@alvherre.pgsql/
Also on:    postgresql.org/message-id/202401231147.clytrnaysp43@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, hlinnaka@iki.fi, pgsql-hackers@lists.postgresql.org
  Subject: Re: make BuiltinTrancheNames less ugly
  In-Reply-To: <202401231147.clytrnaysp43@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox