Re: Getting list of held lwlocks from debugger

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Getting list of held lwlocks from debugger
Date: 2014-07-15 14:17:22
Message-ID: 16086.1405433842@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jeff Janes <jeff(dot)janes(at)gmail(dot)com> writes:
> Is there an easy way to get a list of held lwlocks out of gdb attached to a
> core dump (or for that matter attached to a live process)?

There's the held_lwlocks array in lwlock.c, but that will just give you
pointers. What I imagine you're wishing for is some symbolic display
of which locks they are, and I see no code for that.

The "lock tranche" infrastructure that Robert's been working on would
allow for reasonably decent printout, but it's not complete yet ...

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-07-15 14:20:53 Re: returning SETOF RECORD
Previous Message Magnus Hagander 2014-07-15 14:10:34 Re: [bug fix] pg_ctl always uses the same event source