Getting list of held lwlocks from debugger

Started by Jeff Janesalmost 12 years ago2 messageshackers
Jump to latest
#1Jeff Janes
jeff.janes@gmail.com

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)?

I can try manually walking the internal data structure, but I am hoping for
something analogous to the way you get memory contexts:

(gdb) p MemoryContextStats(TopMemoryContext)

Cheers,

Jeff

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jeff Janes (#1)
Re: Getting list of held lwlocks from debugger

Jeff Janes <jeff.janes@gmail.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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers