Re: [PATCH] Identify LWLocks in tracepoints

From: Craig Ringer <craig(dot)ringer(at)enterprisedb(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, David Steele <david(at)pgmasters(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Identify LWLocks in tracepoints
Date: 2021-04-14 02:45:16
Message-ID: CAGRY4ny-39OP+o9k0DaF=y3x8mJb-9fBOYoU7E9ZkEYFRKe_EQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 14 Apr 2021 at 10:41, Craig Ringer
<craig(dot)ringer(at)enterprisedb(dot)com> wrote:
> On Wed, 14 Apr 2021 at 02:25, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> > You could try to identify locks by pointer addresses, but that's got
> > security hazards and the addreses aren't portable across all the
> > backends involved in the parallel query because of how DSM works, so
> > it's not really that helpful in terms of matching stuff up.
>
> What I'm doing now is identifying them by LWLock* across backends. I
> keep track of DSM segment mappings in each backend inside the trace
> script and I relocate LWLock* pointers known to be inside DSM segments
> relative to a dummy base address so they're equal across backends.

BTW, one of the reasons I did this was to try to identify BDR and
pglogical code that blocks or sleeps while holding a LWLock. I got
stuck on that for other reasons, so it didn't go anywhere, but those
issues are now resolved so I should probably return to it at some
point.

It'd be a nice thing to be able to run on postgres itself too.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2021-04-14 02:48:33 Re: Replication slot stats misgivings
Previous Message Craig Ringer 2021-04-14 02:41:44 Re: [PATCH] Identify LWLocks in tracepoints