mirror of https://github.com/postgres/postgres
This way, we can fold the list of lock names to occur in
BuiltinTrancheNames instead of having its own separate array. This
saves two lines of code in GetLWTrancheName and some space in
BuiltinTrancheNames, as foreseen in commit 74a7306310
, as well as
removing the need for a separate lwlocknames.c file.
We still have to build lwlocknames.h using Perl code, which initially I
wanted to avoid, but it gives us the chance to cross-check
wait_event_names.txt.
Discussion: https://postgr.es/m/202401231025.gbv4nnte5fmm@alvherre.pgsql
pull/159/head
parent
e5da0fe3c2
commit
da952b415f
@ -1,3 +1,2 @@ |
||||
/lwlocknames.c |
||||
/lwlocknames.h |
||||
/s_lock_test |
||||
|
@ -1,60 +0,0 @@ |
||||
# Some commonly-used locks have predefined positions within MainLWLockArray; |
||||
# these are defined here. If you add a lock, add it to the end to avoid |
||||
# renumbering the existing locks; if you remove a lock, consider leaving a gap |
||||
# in the numbering sequence for the benefit of DTrace and other external |
||||
# debugging scripts. Also, do not forget to update the section |
||||
# WaitEventLWLock of src/backend/utils/activity/wait_event_names.txt. |
||||
|
||||
# 0 is available; was formerly BufFreelistLock |
||||
ShmemIndexLock 1 |
||||
OidGenLock 2 |
||||
XidGenLock 3 |
||||
ProcArrayLock 4 |
||||
SInvalReadLock 5 |
||||
SInvalWriteLock 6 |
||||
WALBufMappingLock 7 |
||||
WALWriteLock 8 |
||||
ControlFileLock 9 |
||||
# 10 was CheckpointLock |
||||
# 11 was XactSLRULock |
||||
# 12 was SubtransSLRULock |
||||
MultiXactGenLock 13 |
||||
# 14 was MultiXactOffsetSLRULock |
||||
# 15 was MultiXactMemberSLRULock |
||||
RelCacheInitLock 16 |
||||
CheckpointerCommLock 17 |
||||
TwoPhaseStateLock 18 |
||||
TablespaceCreateLock 19 |
||||
BtreeVacuumLock 20 |
||||
AddinShmemInitLock 21 |
||||
AutovacuumLock 22 |
||||
AutovacuumScheduleLock 23 |
||||
SyncScanLock 24 |
||||
RelationMappingLock 25 |
||||
#26 was NotifySLRULock |
||||
NotifyQueueLock 27 |
||||
SerializableXactHashLock 28 |
||||
SerializableFinishedListLock 29 |
||||
SerializablePredicateListLock 30 |
||||
# 31 was SerialSLRULock |
||||
SyncRepLock 32 |
||||
BackgroundWorkerLock 33 |
||||
DynamicSharedMemoryControlLock 34 |
||||
AutoFileLock 35 |
||||
ReplicationSlotAllocationLock 36 |
||||
ReplicationSlotControlLock 37 |
||||
#38 was CommitTsSLRULock |
||||
CommitTsLock 39 |
||||
ReplicationOriginLock 40 |
||||
MultiXactTruncationLock 41 |
||||
# 42 was OldSnapshotTimeMapLock |
||||
LogicalRepWorkerLock 43 |
||||
XactTruncationLock 44 |
||||
# 45 was XactTruncationLock until removal of BackendRandomLock |
||||
WrapLimitsVacuumLock 46 |
||||
NotifyQueueTailLock 47 |
||||
WaitEventExtensionLock 48 |
||||
WALSummarizerLock 49 |
||||
DSMRegistryLock 50 |
||||
InjectionPointLock 51 |
||||
SerialControlLock 52 |
@ -0,0 +1,85 @@ |
||||
/*-------------------------------------------------------------------------
|
||||
* |
||||
* lwlocklist.h |
||||
* |
||||
* The predefined LWLock list is kept in its own source file for use by |
||||
* automatic tools. The exact representation of a keyword is determined by |
||||
* the PG_LWLOCK macro, which is not defined in this file; it can be |
||||
* defined by the caller for special purposes. |
||||
* |
||||
* Also, generate-lwlocknames.pl processes this file to create lwlocknames.h. |
||||
* |
||||
* Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group |
||||
* Portions Copyright (c) 1994, Regents of the University of California |
||||
* |
||||
* IDENTIFICATION |
||||
* src/include/storage/lwlocklist.h |
||||
* |
||||
*------------------------------------------------------------------------- |
||||
*/ |
||||
|
||||
/*
|
||||
* Some commonly-used locks have predefined positions within MainLWLockArray; |
||||
* these are defined here. If you add a lock, add it to the end to avoid |
||||
* renumbering the existing locks; if you remove a lock, consider leaving a gap |
||||
* in the numbering sequence for the benefit of DTrace and other external |
||||
* debugging scripts. Also, do not forget to update the section |
||||
* WaitEventLWLock of src/backend/utils/activity/wait_event_names.txt. |
||||
* |
||||
* Note that the names here don't include the Lock suffix, to appease the |
||||
* C preprocessor; it's added elsewhere. |
||||
*/ |
||||
|
||||
/* 0 is available; was formerly BufFreelistLock */ |
||||
PG_LWLOCK(1, ShmemIndex) |
||||
PG_LWLOCK(2, OidGen) |
||||
PG_LWLOCK(3, XidGen) |
||||
PG_LWLOCK(4, ProcArray) |
||||
PG_LWLOCK(5, SInvalRead) |
||||
PG_LWLOCK(6, SInvalWrite) |
||||
PG_LWLOCK(7, WALBufMapping) |
||||
PG_LWLOCK(8, WALWrite) |
||||
PG_LWLOCK(9, ControlFile) |
||||
/* 10 was CheckpointLock */ |
||||
/* 11 was XactSLRULock */ |
||||
/* 12 was SubtransSLRULock */ |
||||
PG_LWLOCK(13, MultiXactGen) |
||||
/* 14 was MultiXactOffsetSLRULock */ |
||||
/* 15 was MultiXactMemberSLRULock */ |
||||
PG_LWLOCK(16, RelCacheInit) |
||||
PG_LWLOCK(17, CheckpointerComm) |
||||
PG_LWLOCK(18, TwoPhaseState) |
||||
PG_LWLOCK(19, TablespaceCreate) |
||||
PG_LWLOCK(20, BtreeVacuum) |
||||
PG_LWLOCK(21, AddinShmemInit) |
||||
PG_LWLOCK(22, Autovacuum) |
||||
PG_LWLOCK(23, AutovacuumSchedule) |
||||
PG_LWLOCK(24, SyncScan) |
||||
PG_LWLOCK(25, RelationMapping) |
||||
/* 26 was NotifySLRULock */ |
||||
PG_LWLOCK(27, NotifyQueue) |
||||
PG_LWLOCK(28, SerializableXactHash) |
||||
PG_LWLOCK(29, SerializableFinishedList) |
||||
PG_LWLOCK(30, SerializablePredicateList) |
||||
/* 31 was SerialSLRULock */ |
||||
PG_LWLOCK(32, SyncRep) |
||||
PG_LWLOCK(33, BackgroundWorker) |
||||
PG_LWLOCK(34, DynamicSharedMemoryControl) |
||||
PG_LWLOCK(35, AutoFile) |
||||
PG_LWLOCK(36, ReplicationSlotAllocation) |
||||
PG_LWLOCK(37, ReplicationSlotControl) |
||||
/* 38 was CommitTsSLRULock */ |
||||
PG_LWLOCK(39, CommitTs) |
||||
PG_LWLOCK(40, ReplicationOrigin) |
||||
PG_LWLOCK(41, MultiXactTruncation) |
||||
/* 42 was OldSnapshotTimeMapLock */ |
||||
PG_LWLOCK(43, LogicalRepWorker) |
||||
PG_LWLOCK(44, XactTruncation) |
||||
/* 45 was XactTruncationLock until removal of BackendRandomLock */ |
||||
PG_LWLOCK(46, WrapLimitsVacuum) |
||||
PG_LWLOCK(47, NotifyQueueTail) |
||||
PG_LWLOCK(48, WaitEventExtension) |
||||
PG_LWLOCK(49, WALSummarizer) |
||||
PG_LWLOCK(50, DSMRegistry) |
||||
PG_LWLOCK(51, InjectionPoint) |
||||
PG_LWLOCK(52, SerialControl) |
Loading…
Reference in new issue