pgsql: Prevent lwlock dtrace probes from unnecessary work - Mailing list pgsql-committers

From Peter Eisentraut
Subject pgsql: Prevent lwlock dtrace probes from unnecessary work
Date
Msg-id E1lddx5-0001Jw-G8@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Prevent lwlock dtrace probes from unnecessary work

If dtrace is compiled in but disabled, the lwlock dtrace probes still
evaluate their arguments.  Since PostgreSQL 13, T_NAME(lock) does
nontrivial work, so it should be avoided if not needed.  To fix, make
these calls conditional on the *_ENABLED() macro corresponding to each
probe.

Reviewed-by: Craig Ringer <craig.ringer@enterprisedb.com>
Discussion: https://www.postgresql.org/message-id/CAGRY4nwxKUS_RvXFW-ugrZBYxPFFM5kjwKT5O+0+Stuga5b4+Q@mail.gmail.com

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e48ce7ef0ef8de3d8e9e56be4d23d7830681b18b

Modified Files
--------------
src/backend/storage/lmgr/lwlock.c | 39 ++++++++++++++++++++++++++-------------
1 file changed, 26 insertions(+), 13 deletions(-)


pgsql-committers by date:

Previous
From: Bruce Momjian
Date:
Subject: pgsql: Update query_id computation
Next
From: Alexander Korotkov
Date:
Subject: pgsql: Remove mention of the version number from pg_trgm docs