Re: [PATCH] Identify LWLocks in tracepoints
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Craig Ringer <craig.ringer@enterprisedb.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2021-05-04T22:15:31Z
Lists: pgsql-hackers
Hi,
On 2021-05-03 21:06:30 +0200, Peter Eisentraut wrote:
> On 30.04.21 05:22, Craig Ringer wrote:
> > On Thu, 29 Apr 2021 at 15:31, Peter Eisentraut
> > <peter.eisentraut@enterprisedb.com> wrote:
> > > > So if you could produce a separate patch that adds the
> > > > _ENABLED guards targeting PG14 (and PG13), that would be helpful.
> > >
> > > Here is a proposed patch for this.
> >
> > LGTM.
> >
> > Applies and builds fine on master and (with default fuzz) on
> > REL_13_STABLE. Works as expected.
>
> committed
I'm now getting
/home/andres/src/postgresql/src/backend/storage/lmgr/lwlock.c: In function ‘LWLockAcquire’:
/home/andres/src/postgresql/src/backend/storage/lmgr/lwlock.c:1322:58: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
1322 | TRACE_POSTGRESQL_LWLOCK_WAIT_START(T_NAME(lock), mode);
| ^
/home/andres/src/postgresql/src/backend/storage/lmgr/lwlock.c:1345:57: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
1345 | TRACE_POSTGRESQL_LWLOCK_WAIT_DONE(T_NAME(lock), mode);
| ^
/home/andres/src/postgresql/src/backend/storage/lmgr/lwlock.c:1355:54: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
1355 | TRACE_POSTGRESQL_LWLOCK_ACQUIRE(T_NAME(lock), mode);
| ^
/home/andres/src/postgresql/src/backend/storage/lmgr/lwlock.c: In function ‘LWLockConditionalAcquire’:
/home/andres/src/postgresql/src/backend/storage/lmgr/lwlock.c:1407:64: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
1407 | TRACE_POSTGRESQL_LWLOCK_CONDACQUIRE_FAIL(T_NAME(lock), mode);
| ^
/home/andres/src/postgresql/src/backend/storage/lmgr/lwlock.c:1415:59: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
1415 | TRACE_POSTGRESQL_LWLOCK_CONDACQUIRE(T_NAME(lock), mode);
| ^
/home/andres/src/postgresql/src/backend/storage/lmgr/lwlock.c: In function ‘LWLockAcquireOrWait’:
/home/andres/src/postgresql/src/backend/storage/lmgr/lwlock.c:1488:59: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
1488 | TRACE_POSTGRESQL_LWLOCK_WAIT_START(T_NAME(lock), mode);
| ^
/home/andres/src/postgresql/src/backend/storage/lmgr/lwlock.c:1507:58: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
1507 | TRACE_POSTGRESQL_LWLOCK_WAIT_DONE(T_NAME(lock), mode);
| ^
/home/andres/src/postgresql/src/backend/storage/lmgr/lwlock.c:1538:68: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
1538 | TRACE_POSTGRESQL_LWLOCK_ACQUIRE_OR_WAIT_FAIL(T_NAME(lock), mode);
| ^
/home/andres/src/postgresql/src/backend/storage/lmgr/lwlock.c:1547:63: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
1547 | TRACE_POSTGRESQL_LWLOCK_ACQUIRE_OR_WAIT(T_NAME(lock), mode);
| ^
/home/andres/src/postgresql/src/backend/storage/lmgr/lwlock.c: In function ‘LWLockWaitForVar’:
/home/andres/src/postgresql/src/backend/storage/lmgr/lwlock.c:1708:66: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
1708 | TRACE_POSTGRESQL_LWLOCK_WAIT_START(T_NAME(lock), LW_EXCLUSIVE);
| ^
/home/andres/src/postgresql/src/backend/storage/lmgr/lwlock.c:1728:65: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
1728 | TRACE_POSTGRESQL_LWLOCK_WAIT_DONE(T_NAME(lock), LW_EXCLUSIVE);
| ^
/home/andres/src/postgresql/src/backend/storage/lmgr/lwlock.c: In function ‘LWLockRelease’:
/home/andres/src/postgresql/src/backend/storage/lmgr/lwlock.c:1855:48: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
1855 | TRACE_POSTGRESQL_LWLOCK_RELEASE(T_NAME(lock));
In a build without the trace stuff enabled.
Greetings,
Andres Freund
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