Re: [PATCH] Identify LWLocks in tracepoints
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Craig Ringer <craig.ringer@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2021-03-19T20:21:24Z
Lists: pgsql-hackers
On 18.03.21 07:34, Craig Ringer wrote: > The main reason I didn't want to add more tracepoints than were strictly > necessary is that Pg doesn't enable the systemtap semaphores feature, so > right now we do a T_NAME(lock) evaluation each time we pass a tracepoint > if --enable-dtrace is compiled in, whether or not anything is tracing. > This was fine on pg11 where it was just: > > #define T_NAME(lock) \ > (LWLockTrancheArray[(lock)->tranche]) > > but since pg13 it instead expands to > > GetLWTrancheName((lock)->tranche) > > where GetLWTrancheName isn't especially trivial. We'll run that function > every single time we pass any of these tracepoints and then discard the > result, which is ... not ideal. That applies so long as Pg is compiled > with --enable-dtrace. I've been meaning to look at enabling the > systemtap semaphores feature in our build so these can be wrapped in > unlikely(TRACE_POSTGRESQL_LWLOCK_RELEASE_ENABLED()) guards, but I wanted > to wrap this patch set up first as there are some complexities around > enabling the semaphores feature. There is already support for that. See the documentation at the end of this page: https://www.postgresql.org/docs/devel/dynamic-trace.html#DEFINING-TRACE-POINTS
Commits
-
Emit dummy statements for probes.d probes when disabled
- 0d204a4b09f7 13.3 landed
- fa8fbadb934b 14.0 landed
-
Prevent lwlock dtrace probes from unnecessary work
- e48ce7ef0ef8 13.3 landed
- b94409a02f61 14.0 landed
-
doc: Fix typo in logicaldecoding.sgml.
- 5fe83adad9ef 14.0 cited
-
Move lwlock-release probe back where it belongs
- 96ae658e6238 14.0 landed
-
Remove bogus tracepoint
- 09418bed67a7 14.0 landed
-
Simplify LWLock tranche machinery by removing array_base/array_stride.
- 3761fe3c20bb 10.0 cited
-
Improve LWLock scalability.
- ab5194e6f617 9.5.0 cited