LCOV - code coverage report
Current view: top level - src/backend/utils/activity - wait_event.c (source / functions) Hit Total Coverage
Test: PostgreSQL 16devel Lines: 137 563 24.3 %
Date: 2022-08-17 05:10:35 Functions: 9 9 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* ----------
       2             :  * wait_event.c
       3             :  *    Wait event reporting infrastructure.
       4             :  *
       5             :  * Copyright (c) 2001-2022, PostgreSQL Global Development Group
       6             :  *
       7             :  *
       8             :  * IDENTIFICATION
       9             :  *    src/backend/utils/activity/wait_event.c
      10             :  *
      11             :  * NOTES
      12             :  *
      13             :  * To make pgstat_report_wait_start() and pgstat_report_wait_end() as
      14             :  * lightweight as possible, they do not check if shared memory (MyProc
      15             :  * specifically, where the wait event is stored) is already available. Instead
      16             :  * we initially set my_wait_event_info to a process local variable, which then
      17             :  * is redirected to shared memory using pgstat_set_wait_event_storage(). For
      18             :  * the same reason pgstat_track_activities is not checked - the check adds
      19             :  * more work than it saves.
      20             :  *
      21             :  * ----------
      22             :  */
      23             : #include "postgres.h"
      24             : 
      25             : #include "storage/lmgr.h"     /* for GetLockNameFromTagType */
      26             : #include "storage/lwlock.h"       /* for GetLWLockIdentifier */
      27             : #include "utils/wait_event.h"
      28             : 
      29             : 
      30             : static const char *pgstat_get_wait_activity(WaitEventActivity w);
      31             : static const char *pgstat_get_wait_client(WaitEventClient w);
      32             : static const char *pgstat_get_wait_ipc(WaitEventIPC w);
      33             : static const char *pgstat_get_wait_timeout(WaitEventTimeout w);
      34             : static const char *pgstat_get_wait_io(WaitEventIO w);
      35             : 
      36             : 
      37             : static uint32 local_my_wait_event_info;
      38             : uint32     *my_wait_event_info = &local_my_wait_event_info;
      39             : 
      40             : 
      41             : /*
      42             :  * Configure wait event reporting to report wait events to *wait_event_info.
      43             :  * *wait_event_info needs to be valid until pgstat_reset_wait_event_storage()
      44             :  * is called.
      45             :  *
      46             :  * Expected to be called during backend startup, to point my_wait_event_info
      47             :  * into shared memory.
      48             :  */
      49             : void
      50       24072 : pgstat_set_wait_event_storage(uint32 *wait_event_info)
      51             : {
      52       24072 :     my_wait_event_info = wait_event_info;
      53       24072 : }
      54             : 
      55             : /*
      56             :  * Reset wait event storage location.
      57             :  *
      58             :  * Expected to be called during backend shutdown, before the location set up
      59             :  * pgstat_set_wait_event_storage() becomes invalid.
      60             :  */
      61             : void
      62       24072 : pgstat_reset_wait_event_storage(void)
      63             : {
      64       24072 :     my_wait_event_info = &local_my_wait_event_info;
      65       24072 : }
      66             : 
      67             : /* ----------
      68             :  * pgstat_get_wait_event_type() -
      69             :  *
      70             :  *  Return a string representing the current wait event type, backend is
      71             :  *  waiting on.
      72             :  */
      73             : const char *
      74        6986 : pgstat_get_wait_event_type(uint32 wait_event_info)
      75             : {
      76             :     uint32      classId;
      77             :     const char *event_type;
      78             : 
      79             :     /* report process as not waiting. */
      80        6986 :     if (wait_event_info == 0)
      81         996 :         return NULL;
      82             : 
      83        5990 :     classId = wait_event_info & 0xFF000000;
      84             : 
      85        5990 :     switch (classId)
      86             :     {
      87           0 :         case PG_WAIT_LWLOCK:
      88           0 :             event_type = "LWLock";
      89           0 :             break;
      90          14 :         case PG_WAIT_LOCK:
      91          14 :             event_type = "Lock";
      92          14 :             break;
      93           0 :         case PG_WAIT_BUFFER_PIN:
      94           0 :             event_type = "BufferPin";
      95           0 :             break;
      96        5122 :         case PG_WAIT_ACTIVITY:
      97        5122 :             event_type = "Activity";
      98        5122 :             break;
      99         830 :         case PG_WAIT_CLIENT:
     100         830 :             event_type = "Client";
     101         830 :             break;
     102           0 :         case PG_WAIT_EXTENSION:
     103           0 :             event_type = "Extension";
     104           0 :             break;
     105           2 :         case PG_WAIT_IPC:
     106           2 :             event_type = "IPC";
     107           2 :             break;
     108          20 :         case PG_WAIT_TIMEOUT:
     109          20 :             event_type = "Timeout";
     110          20 :             break;
     111           2 :         case PG_WAIT_IO:
     112           2 :             event_type = "IO";
     113           2 :             break;
     114           0 :         default:
     115           0 :             event_type = "???";
     116           0 :             break;
     117             :     }
     118             : 
     119        5990 :     return event_type;
     120             : }
     121             : 
     122             : /* ----------
     123             :  * pgstat_get_wait_event() -
     124             :  *
     125             :  *  Return a string representing the current wait event, backend is
     126             :  *  waiting on.
     127             :  */
     128             : const char *
     129        6986 : pgstat_get_wait_event(uint32 wait_event_info)
     130             : {
     131             :     uint32      classId;
     132             :     uint16      eventId;
     133             :     const char *event_name;
     134             : 
     135             :     /* report process as not waiting. */
     136        6986 :     if (wait_event_info == 0)
     137         996 :         return NULL;
     138             : 
     139        5990 :     classId = wait_event_info & 0xFF000000;
     140        5990 :     eventId = wait_event_info & 0x0000FFFF;
     141             : 
     142        5990 :     switch (classId)
     143             :     {
     144           0 :         case PG_WAIT_LWLOCK:
     145           0 :             event_name = GetLWLockIdentifier(classId, eventId);
     146           0 :             break;
     147          14 :         case PG_WAIT_LOCK:
     148          14 :             event_name = GetLockNameFromTagType(eventId);
     149          14 :             break;
     150           0 :         case PG_WAIT_BUFFER_PIN:
     151           0 :             event_name = "BufferPin";
     152           0 :             break;
     153        5122 :         case PG_WAIT_ACTIVITY:
     154             :             {
     155        5122 :                 WaitEventActivity w = (WaitEventActivity) wait_event_info;
     156             : 
     157        5122 :                 event_name = pgstat_get_wait_activity(w);
     158        5122 :                 break;
     159             :             }
     160         830 :         case PG_WAIT_CLIENT:
     161             :             {
     162         830 :                 WaitEventClient w = (WaitEventClient) wait_event_info;
     163             : 
     164         830 :                 event_name = pgstat_get_wait_client(w);
     165         830 :                 break;
     166             :             }
     167           0 :         case PG_WAIT_EXTENSION:
     168           0 :             event_name = "Extension";
     169           0 :             break;
     170           2 :         case PG_WAIT_IPC:
     171             :             {
     172           2 :                 WaitEventIPC w = (WaitEventIPC) wait_event_info;
     173             : 
     174           2 :                 event_name = pgstat_get_wait_ipc(w);
     175           2 :                 break;
     176             :             }
     177          20 :         case PG_WAIT_TIMEOUT:
     178             :             {
     179          20 :                 WaitEventTimeout w = (WaitEventTimeout) wait_event_info;
     180             : 
     181          20 :                 event_name = pgstat_get_wait_timeout(w);
     182          20 :                 break;
     183             :             }
     184           2 :         case PG_WAIT_IO:
     185             :             {
     186           2 :                 WaitEventIO w = (WaitEventIO) wait_event_info;
     187             : 
     188           2 :                 event_name = pgstat_get_wait_io(w);
     189           2 :                 break;
     190             :             }
     191           0 :         default:
     192           0 :             event_name = "unknown wait event";
     193           0 :             break;
     194             :     }
     195             : 
     196        5990 :     return event_name;
     197             : }
     198             : 
     199             : /* ----------
     200             :  * pgstat_get_wait_activity() -
     201             :  *
     202             :  * Convert WaitEventActivity to string.
     203             :  * ----------
     204             :  */
     205             : static const char *
     206        5122 : pgstat_get_wait_activity(WaitEventActivity w)
     207             : {
     208        5122 :     const char *event_name = "unknown wait event";
     209             : 
     210        5122 :     switch (w)
     211             :     {
     212          10 :         case WAIT_EVENT_ARCHIVER_MAIN:
     213          10 :             event_name = "ArchiverMain";
     214          10 :             break;
     215         924 :         case WAIT_EVENT_AUTOVACUUM_MAIN:
     216         924 :             event_name = "AutoVacuumMain";
     217         924 :             break;
     218          16 :         case WAIT_EVENT_BGWRITER_HIBERNATE:
     219          16 :             event_name = "BgWriterHibernate";
     220          16 :             break;
     221         932 :         case WAIT_EVENT_BGWRITER_MAIN:
     222         932 :             event_name = "BgWriterMain";
     223         932 :             break;
     224         936 :         case WAIT_EVENT_CHECKPOINTER_MAIN:
     225         936 :             event_name = "CheckpointerMain";
     226         936 :             break;
     227          54 :         case WAIT_EVENT_LOGICAL_APPLY_MAIN:
     228          54 :             event_name = "LogicalApplyMain";
     229          54 :             break;
     230         932 :         case WAIT_EVENT_LOGICAL_LAUNCHER_MAIN:
     231         932 :             event_name = "LogicalLauncherMain";
     232         932 :             break;
     233          16 :         case WAIT_EVENT_RECOVERY_WAL_STREAM:
     234          16 :             event_name = "RecoveryWalStream";
     235          16 :             break;
     236           0 :         case WAIT_EVENT_SYSLOGGER_MAIN:
     237           0 :             event_name = "SysLoggerMain";
     238           0 :             break;
     239          16 :         case WAIT_EVENT_WAL_RECEIVER_MAIN:
     240          16 :             event_name = "WalReceiverMain";
     241          16 :             break;
     242         354 :         case WAIT_EVENT_WAL_SENDER_MAIN:
     243         354 :             event_name = "WalSenderMain";
     244         354 :             break;
     245         932 :         case WAIT_EVENT_WAL_WRITER_MAIN:
     246         932 :             event_name = "WalWriterMain";
     247         932 :             break;
     248             :             /* no default case, so that compiler will warn */
     249             :     }
     250             : 
     251        5122 :     return event_name;
     252             : }
     253             : 
     254             : /* ----------
     255             :  * pgstat_get_wait_client() -
     256             :  *
     257             :  * Convert WaitEventClient to string.
     258             :  * ----------
     259             :  */
     260             : static const char *
     261         830 : pgstat_get_wait_client(WaitEventClient w)
     262             : {
     263         830 :     const char *event_name = "unknown wait event";
     264             : 
     265         830 :     switch (w)
     266             :     {
     267          68 :         case WAIT_EVENT_CLIENT_READ:
     268          68 :             event_name = "ClientRead";
     269          68 :             break;
     270           0 :         case WAIT_EVENT_CLIENT_WRITE:
     271           0 :             event_name = "ClientWrite";
     272           0 :             break;
     273           0 :         case WAIT_EVENT_GSS_OPEN_SERVER:
     274           0 :             event_name = "GSSOpenServer";
     275           0 :             break;
     276           0 :         case WAIT_EVENT_LIBPQWALRECEIVER_CONNECT:
     277           0 :             event_name = "LibPQWalReceiverConnect";
     278           0 :             break;
     279           0 :         case WAIT_EVENT_LIBPQWALRECEIVER_RECEIVE:
     280           0 :             event_name = "LibPQWalReceiverReceive";
     281           0 :             break;
     282           0 :         case WAIT_EVENT_SSL_OPEN_SERVER:
     283           0 :             event_name = "SSLOpenServer";
     284           0 :             break;
     285         758 :         case WAIT_EVENT_WAL_SENDER_WAIT_WAL:
     286         758 :             event_name = "WalSenderWaitForWAL";
     287         758 :             break;
     288           4 :         case WAIT_EVENT_WAL_SENDER_WRITE_DATA:
     289           4 :             event_name = "WalSenderWriteData";
     290           4 :             break;
     291             :             /* no default case, so that compiler will warn */
     292             :     }
     293             : 
     294         830 :     return event_name;
     295             : }
     296             : 
     297             : /* ----------
     298             :  * pgstat_get_wait_ipc() -
     299             :  *
     300             :  * Convert WaitEventIPC to string.
     301             :  * ----------
     302             :  */
     303             : static const char *
     304           2 : pgstat_get_wait_ipc(WaitEventIPC w)
     305             : {
     306           2 :     const char *event_name = "unknown wait event";
     307             : 
     308           2 :     switch (w)
     309             :     {
     310           0 :         case WAIT_EVENT_APPEND_READY:
     311           0 :             event_name = "AppendReady";
     312           0 :             break;
     313           0 :         case WAIT_EVENT_ARCHIVE_CLEANUP_COMMAND:
     314           0 :             event_name = "ArchiveCleanupCommand";
     315           0 :             break;
     316           0 :         case WAIT_EVENT_ARCHIVE_COMMAND:
     317           0 :             event_name = "ArchiveCommand";
     318           0 :             break;
     319           0 :         case WAIT_EVENT_BACKEND_TERMINATION:
     320           0 :             event_name = "BackendTermination";
     321           0 :             break;
     322           0 :         case WAIT_EVENT_BACKUP_WAIT_WAL_ARCHIVE:
     323           0 :             event_name = "BackupWaitWalArchive";
     324           0 :             break;
     325           0 :         case WAIT_EVENT_BGWORKER_SHUTDOWN:
     326           0 :             event_name = "BgWorkerShutdown";
     327           0 :             break;
     328           0 :         case WAIT_EVENT_BGWORKER_STARTUP:
     329           0 :             event_name = "BgWorkerStartup";
     330           0 :             break;
     331           0 :         case WAIT_EVENT_BTREE_PAGE:
     332           0 :             event_name = "BtreePage";
     333           0 :             break;
     334           0 :         case WAIT_EVENT_BUFFER_IO:
     335           0 :             event_name = "BufferIO";
     336           0 :             break;
     337           2 :         case WAIT_EVENT_CHECKPOINT_DONE:
     338           2 :             event_name = "CheckpointDone";
     339           2 :             break;
     340           0 :         case WAIT_EVENT_CHECKPOINT_START:
     341           0 :             event_name = "CheckpointStart";
     342           0 :             break;
     343           0 :         case WAIT_EVENT_EXECUTE_GATHER:
     344           0 :             event_name = "ExecuteGather";
     345           0 :             break;
     346           0 :         case WAIT_EVENT_HASH_BATCH_ALLOCATE:
     347           0 :             event_name = "HashBatchAllocate";
     348           0 :             break;
     349           0 :         case WAIT_EVENT_HASH_BATCH_ELECT:
     350           0 :             event_name = "HashBatchElect";
     351           0 :             break;
     352           0 :         case WAIT_EVENT_HASH_BATCH_LOAD:
     353           0 :             event_name = "HashBatchLoad";
     354           0 :             break;
     355           0 :         case WAIT_EVENT_HASH_BUILD_ALLOCATE:
     356           0 :             event_name = "HashBuildAllocate";
     357           0 :             break;
     358           0 :         case WAIT_EVENT_HASH_BUILD_ELECT:
     359           0 :             event_name = "HashBuildElect";
     360           0 :             break;
     361           0 :         case WAIT_EVENT_HASH_BUILD_HASH_INNER:
     362           0 :             event_name = "HashBuildHashInner";
     363           0 :             break;
     364           0 :         case WAIT_EVENT_HASH_BUILD_HASH_OUTER:
     365           0 :             event_name = "HashBuildHashOuter";
     366           0 :             break;
     367           0 :         case WAIT_EVENT_HASH_GROW_BATCHES_ALLOCATE:
     368           0 :             event_name = "HashGrowBatchesAllocate";
     369           0 :             break;
     370           0 :         case WAIT_EVENT_HASH_GROW_BATCHES_DECIDE:
     371           0 :             event_name = "HashGrowBatchesDecide";
     372           0 :             break;
     373           0 :         case WAIT_EVENT_HASH_GROW_BATCHES_ELECT:
     374           0 :             event_name = "HashGrowBatchesElect";
     375           0 :             break;
     376           0 :         case WAIT_EVENT_HASH_GROW_BATCHES_FINISH:
     377           0 :             event_name = "HashGrowBatchesFinish";
     378           0 :             break;
     379           0 :         case WAIT_EVENT_HASH_GROW_BATCHES_REPARTITION:
     380           0 :             event_name = "HashGrowBatchesRepartition";
     381           0 :             break;
     382           0 :         case WAIT_EVENT_HASH_GROW_BUCKETS_ALLOCATE:
     383           0 :             event_name = "HashGrowBucketsAllocate";
     384           0 :             break;
     385           0 :         case WAIT_EVENT_HASH_GROW_BUCKETS_ELECT:
     386           0 :             event_name = "HashGrowBucketsElect";
     387           0 :             break;
     388           0 :         case WAIT_EVENT_HASH_GROW_BUCKETS_REINSERT:
     389           0 :             event_name = "HashGrowBucketsReinsert";
     390           0 :             break;
     391           0 :         case WAIT_EVENT_LOGICAL_SYNC_DATA:
     392           0 :             event_name = "LogicalSyncData";
     393           0 :             break;
     394           0 :         case WAIT_EVENT_LOGICAL_SYNC_STATE_CHANGE:
     395           0 :             event_name = "LogicalSyncStateChange";
     396           0 :             break;
     397           0 :         case WAIT_EVENT_MQ_INTERNAL:
     398           0 :             event_name = "MessageQueueInternal";
     399           0 :             break;
     400           0 :         case WAIT_EVENT_MQ_PUT_MESSAGE:
     401           0 :             event_name = "MessageQueuePutMessage";
     402           0 :             break;
     403           0 :         case WAIT_EVENT_MQ_RECEIVE:
     404           0 :             event_name = "MessageQueueReceive";
     405           0 :             break;
     406           0 :         case WAIT_EVENT_MQ_SEND:
     407           0 :             event_name = "MessageQueueSend";
     408           0 :             break;
     409           0 :         case WAIT_EVENT_PARALLEL_BITMAP_SCAN:
     410           0 :             event_name = "ParallelBitmapScan";
     411           0 :             break;
     412           0 :         case WAIT_EVENT_PARALLEL_CREATE_INDEX_SCAN:
     413           0 :             event_name = "ParallelCreateIndexScan";
     414           0 :             break;
     415           0 :         case WAIT_EVENT_PARALLEL_FINISH:
     416           0 :             event_name = "ParallelFinish";
     417           0 :             break;
     418           0 :         case WAIT_EVENT_PROCARRAY_GROUP_UPDATE:
     419           0 :             event_name = "ProcArrayGroupUpdate";
     420           0 :             break;
     421           0 :         case WAIT_EVENT_PROC_SIGNAL_BARRIER:
     422           0 :             event_name = "ProcSignalBarrier";
     423           0 :             break;
     424           0 :         case WAIT_EVENT_PROMOTE:
     425           0 :             event_name = "Promote";
     426           0 :             break;
     427           0 :         case WAIT_EVENT_RECOVERY_CONFLICT_SNAPSHOT:
     428           0 :             event_name = "RecoveryConflictSnapshot";
     429           0 :             break;
     430           0 :         case WAIT_EVENT_RECOVERY_CONFLICT_TABLESPACE:
     431           0 :             event_name = "RecoveryConflictTablespace";
     432           0 :             break;
     433           0 :         case WAIT_EVENT_RECOVERY_END_COMMAND:
     434           0 :             event_name = "RecoveryEndCommand";
     435           0 :             break;
     436           0 :         case WAIT_EVENT_RECOVERY_PAUSE:
     437           0 :             event_name = "RecoveryPause";
     438           0 :             break;
     439           0 :         case WAIT_EVENT_REPLICATION_ORIGIN_DROP:
     440           0 :             event_name = "ReplicationOriginDrop";
     441           0 :             break;
     442           0 :         case WAIT_EVENT_REPLICATION_SLOT_DROP:
     443           0 :             event_name = "ReplicationSlotDrop";
     444           0 :             break;
     445           0 :         case WAIT_EVENT_RESTORE_COMMAND:
     446           0 :             event_name = "RestoreCommand";
     447           0 :             break;
     448           0 :         case WAIT_EVENT_SAFE_SNAPSHOT:
     449           0 :             event_name = "SafeSnapshot";
     450           0 :             break;
     451           0 :         case WAIT_EVENT_SYNC_REP:
     452           0 :             event_name = "SyncRep";
     453           0 :             break;
     454           0 :         case WAIT_EVENT_WAL_RECEIVER_EXIT:
     455           0 :             event_name = "WalReceiverExit";
     456           0 :             break;
     457           0 :         case WAIT_EVENT_WAL_RECEIVER_WAIT_START:
     458           0 :             event_name = "WalReceiverWaitStart";
     459           0 :             break;
     460           0 :         case WAIT_EVENT_XACT_GROUP_UPDATE:
     461           0 :             event_name = "XactGroupUpdate";
     462           0 :             break;
     463             :             /* no default case, so that compiler will warn */
     464             :     }
     465             : 
     466           2 :     return event_name;
     467             : }
     468             : 
     469             : /* ----------
     470             :  * pgstat_get_wait_timeout() -
     471             :  *
     472             :  * Convert WaitEventTimeout to string.
     473             :  * ----------
     474             :  */
     475             : static const char *
     476          20 : pgstat_get_wait_timeout(WaitEventTimeout w)
     477             : {
     478          20 :     const char *event_name = "unknown wait event";
     479             : 
     480          20 :     switch (w)
     481             :     {
     482           8 :         case WAIT_EVENT_BASE_BACKUP_THROTTLE:
     483           8 :             event_name = "BaseBackupThrottle";
     484           8 :             break;
     485          10 :         case WAIT_EVENT_CHECKPOINT_WRITE_DELAY:
     486          10 :             event_name = "CheckpointWriteDelay";
     487          10 :             break;
     488           2 :         case WAIT_EVENT_PG_SLEEP:
     489           2 :             event_name = "PgSleep";
     490           2 :             break;
     491           0 :         case WAIT_EVENT_RECOVERY_APPLY_DELAY:
     492           0 :             event_name = "RecoveryApplyDelay";
     493           0 :             break;
     494           0 :         case WAIT_EVENT_RECOVERY_RETRIEVE_RETRY_INTERVAL:
     495           0 :             event_name = "RecoveryRetrieveRetryInterval";
     496           0 :             break;
     497           0 :         case WAIT_EVENT_REGISTER_SYNC_REQUEST:
     498           0 :             event_name = "RegisterSyncRequest";
     499           0 :             break;
     500           0 :         case WAIT_EVENT_VACUUM_DELAY:
     501           0 :             event_name = "VacuumDelay";
     502           0 :             break;
     503           0 :         case WAIT_EVENT_VACUUM_TRUNCATE:
     504           0 :             event_name = "VacuumTruncate";
     505           0 :             break;
     506             :             /* no default case, so that compiler will warn */
     507             :     }
     508             : 
     509          20 :     return event_name;
     510             : }
     511             : 
     512             : /* ----------
     513             :  * pgstat_get_wait_io() -
     514             :  *
     515             :  * Convert WaitEventIO to string.
     516             :  * ----------
     517             :  */
     518             : static const char *
     519           2 : pgstat_get_wait_io(WaitEventIO w)
     520             : {
     521           2 :     const char *event_name = "unknown wait event";
     522             : 
     523           2 :     switch (w)
     524             :     {
     525           0 :         case WAIT_EVENT_BASEBACKUP_READ:
     526           0 :             event_name = "BaseBackupRead";
     527           0 :             break;
     528           0 :         case WAIT_EVENT_BASEBACKUP_SYNC:
     529           0 :             event_name = "BaseBackupSync";
     530           0 :             break;
     531           0 :         case WAIT_EVENT_BASEBACKUP_WRITE:
     532           0 :             event_name = "BaseBackupWrite";
     533           0 :             break;
     534           0 :         case WAIT_EVENT_BUFFILE_READ:
     535           0 :             event_name = "BufFileRead";
     536           0 :             break;
     537           0 :         case WAIT_EVENT_BUFFILE_WRITE:
     538           0 :             event_name = "BufFileWrite";
     539           0 :             break;
     540           0 :         case WAIT_EVENT_BUFFILE_TRUNCATE:
     541           0 :             event_name = "BufFileTruncate";
     542           0 :             break;
     543           0 :         case WAIT_EVENT_CONTROL_FILE_READ:
     544           0 :             event_name = "ControlFileRead";
     545           0 :             break;
     546           0 :         case WAIT_EVENT_CONTROL_FILE_SYNC:
     547           0 :             event_name = "ControlFileSync";
     548           0 :             break;
     549           0 :         case WAIT_EVENT_CONTROL_FILE_SYNC_UPDATE:
     550           0 :             event_name = "ControlFileSyncUpdate";
     551           0 :             break;
     552           0 :         case WAIT_EVENT_CONTROL_FILE_WRITE:
     553           0 :             event_name = "ControlFileWrite";
     554           0 :             break;
     555           0 :         case WAIT_EVENT_CONTROL_FILE_WRITE_UPDATE:
     556           0 :             event_name = "ControlFileWriteUpdate";
     557           0 :             break;
     558           0 :         case WAIT_EVENT_COPY_FILE_READ:
     559           0 :             event_name = "CopyFileRead";
     560           0 :             break;
     561           0 :         case WAIT_EVENT_COPY_FILE_WRITE:
     562           0 :             event_name = "CopyFileWrite";
     563           0 :             break;
     564           0 :         case WAIT_EVENT_DATA_FILE_EXTEND:
     565           0 :             event_name = "DataFileExtend";
     566           0 :             break;
     567           0 :         case WAIT_EVENT_DATA_FILE_FLUSH:
     568           0 :             event_name = "DataFileFlush";
     569           0 :             break;
     570           0 :         case WAIT_EVENT_DATA_FILE_IMMEDIATE_SYNC:
     571           0 :             event_name = "DataFileImmediateSync";
     572           0 :             break;
     573           0 :         case WAIT_EVENT_DATA_FILE_PREFETCH:
     574           0 :             event_name = "DataFilePrefetch";
     575           0 :             break;
     576           0 :         case WAIT_EVENT_DATA_FILE_READ:
     577           0 :             event_name = "DataFileRead";
     578           0 :             break;
     579           0 :         case WAIT_EVENT_DATA_FILE_SYNC:
     580           0 :             event_name = "DataFileSync";
     581           0 :             break;
     582           0 :         case WAIT_EVENT_DATA_FILE_TRUNCATE:
     583           0 :             event_name = "DataFileTruncate";
     584           0 :             break;
     585           0 :         case WAIT_EVENT_DATA_FILE_WRITE:
     586           0 :             event_name = "DataFileWrite";
     587           0 :             break;
     588           0 :         case WAIT_EVENT_DSM_ALLOCATE:
     589           0 :             event_name = "DSMAllocate";
     590           0 :             break;
     591           0 :         case WAIT_EVENT_DSM_FILL_ZERO_WRITE:
     592           0 :             event_name = "DSMFillZeroWrite";
     593           0 :             break;
     594           0 :         case WAIT_EVENT_LOCK_FILE_ADDTODATADIR_READ:
     595           0 :             event_name = "LockFileAddToDataDirRead";
     596           0 :             break;
     597           0 :         case WAIT_EVENT_LOCK_FILE_ADDTODATADIR_SYNC:
     598           0 :             event_name = "LockFileAddToDataDirSync";
     599           0 :             break;
     600           0 :         case WAIT_EVENT_LOCK_FILE_ADDTODATADIR_WRITE:
     601           0 :             event_name = "LockFileAddToDataDirWrite";
     602           0 :             break;
     603           0 :         case WAIT_EVENT_LOCK_FILE_CREATE_READ:
     604           0 :             event_name = "LockFileCreateRead";
     605           0 :             break;
     606           0 :         case WAIT_EVENT_LOCK_FILE_CREATE_SYNC:
     607           0 :             event_name = "LockFileCreateSync";
     608           0 :             break;
     609           0 :         case WAIT_EVENT_LOCK_FILE_CREATE_WRITE:
     610           0 :             event_name = "LockFileCreateWrite";
     611           0 :             break;
     612           0 :         case WAIT_EVENT_LOCK_FILE_RECHECKDATADIR_READ:
     613           0 :             event_name = "LockFileReCheckDataDirRead";
     614           0 :             break;
     615           0 :         case WAIT_EVENT_LOGICAL_REWRITE_CHECKPOINT_SYNC:
     616           0 :             event_name = "LogicalRewriteCheckpointSync";
     617           0 :             break;
     618           0 :         case WAIT_EVENT_LOGICAL_REWRITE_MAPPING_SYNC:
     619           0 :             event_name = "LogicalRewriteMappingSync";
     620           0 :             break;
     621           0 :         case WAIT_EVENT_LOGICAL_REWRITE_MAPPING_WRITE:
     622           0 :             event_name = "LogicalRewriteMappingWrite";
     623           0 :             break;
     624           0 :         case WAIT_EVENT_LOGICAL_REWRITE_SYNC:
     625           0 :             event_name = "LogicalRewriteSync";
     626           0 :             break;
     627           0 :         case WAIT_EVENT_LOGICAL_REWRITE_TRUNCATE:
     628           0 :             event_name = "LogicalRewriteTruncate";
     629           0 :             break;
     630           0 :         case WAIT_EVENT_LOGICAL_REWRITE_WRITE:
     631           0 :             event_name = "LogicalRewriteWrite";
     632           0 :             break;
     633           0 :         case WAIT_EVENT_RELATION_MAP_READ:
     634           0 :             event_name = "RelationMapRead";
     635           0 :             break;
     636           0 :         case WAIT_EVENT_RELATION_MAP_REPLACE:
     637           0 :             event_name = "RelationMapReplace";
     638           0 :             break;
     639           0 :         case WAIT_EVENT_RELATION_MAP_WRITE:
     640           0 :             event_name = "RelationMapWrite";
     641           0 :             break;
     642           0 :         case WAIT_EVENT_REORDER_BUFFER_READ:
     643           0 :             event_name = "ReorderBufferRead";
     644           0 :             break;
     645           0 :         case WAIT_EVENT_REORDER_BUFFER_WRITE:
     646           0 :             event_name = "ReorderBufferWrite";
     647           0 :             break;
     648           0 :         case WAIT_EVENT_REORDER_LOGICAL_MAPPING_READ:
     649           0 :             event_name = "ReorderLogicalMappingRead";
     650           0 :             break;
     651           0 :         case WAIT_EVENT_REPLICATION_SLOT_READ:
     652           0 :             event_name = "ReplicationSlotRead";
     653           0 :             break;
     654           0 :         case WAIT_EVENT_REPLICATION_SLOT_RESTORE_SYNC:
     655           0 :             event_name = "ReplicationSlotRestoreSync";
     656           0 :             break;
     657           0 :         case WAIT_EVENT_REPLICATION_SLOT_SYNC:
     658           0 :             event_name = "ReplicationSlotSync";
     659           0 :             break;
     660           0 :         case WAIT_EVENT_REPLICATION_SLOT_WRITE:
     661           0 :             event_name = "ReplicationSlotWrite";
     662           0 :             break;
     663           0 :         case WAIT_EVENT_SLRU_FLUSH_SYNC:
     664           0 :             event_name = "SLRUFlushSync";
     665           0 :             break;
     666           0 :         case WAIT_EVENT_SLRU_READ:
     667           0 :             event_name = "SLRURead";
     668           0 :             break;
     669           0 :         case WAIT_EVENT_SLRU_SYNC:
     670           0 :             event_name = "SLRUSync";
     671           0 :             break;
     672           0 :         case WAIT_EVENT_SLRU_WRITE:
     673           0 :             event_name = "SLRUWrite";
     674           0 :             break;
     675           0 :         case WAIT_EVENT_SNAPBUILD_READ:
     676           0 :             event_name = "SnapbuildRead";
     677           0 :             break;
     678           0 :         case WAIT_EVENT_SNAPBUILD_SYNC:
     679           0 :             event_name = "SnapbuildSync";
     680           0 :             break;
     681           0 :         case WAIT_EVENT_SNAPBUILD_WRITE:
     682           0 :             event_name = "SnapbuildWrite";
     683           0 :             break;
     684           0 :         case WAIT_EVENT_TIMELINE_HISTORY_FILE_SYNC:
     685           0 :             event_name = "TimelineHistoryFileSync";
     686           0 :             break;
     687           0 :         case WAIT_EVENT_TIMELINE_HISTORY_FILE_WRITE:
     688           0 :             event_name = "TimelineHistoryFileWrite";
     689           0 :             break;
     690           0 :         case WAIT_EVENT_TIMELINE_HISTORY_READ:
     691           0 :             event_name = "TimelineHistoryRead";
     692           0 :             break;
     693           0 :         case WAIT_EVENT_TIMELINE_HISTORY_SYNC:
     694           0 :             event_name = "TimelineHistorySync";
     695           0 :             break;
     696           0 :         case WAIT_EVENT_TIMELINE_HISTORY_WRITE:
     697           0 :             event_name = "TimelineHistoryWrite";
     698           0 :             break;
     699           0 :         case WAIT_EVENT_TWOPHASE_FILE_READ:
     700           0 :             event_name = "TwophaseFileRead";
     701           0 :             break;
     702           0 :         case WAIT_EVENT_TWOPHASE_FILE_SYNC:
     703           0 :             event_name = "TwophaseFileSync";
     704           0 :             break;
     705           0 :         case WAIT_EVENT_TWOPHASE_FILE_WRITE:
     706           0 :             event_name = "TwophaseFileWrite";
     707           0 :             break;
     708           0 :         case WAIT_EVENT_VERSION_FILE_WRITE:
     709           0 :             event_name = "VersionFileWrite";
     710           0 :             break;
     711           0 :         case WAIT_EVENT_WALSENDER_TIMELINE_HISTORY_READ:
     712           0 :             event_name = "WALSenderTimelineHistoryRead";
     713           0 :             break;
     714           0 :         case WAIT_EVENT_WAL_BOOTSTRAP_SYNC:
     715           0 :             event_name = "WALBootstrapSync";
     716           0 :             break;
     717           0 :         case WAIT_EVENT_WAL_BOOTSTRAP_WRITE:
     718           0 :             event_name = "WALBootstrapWrite";
     719           0 :             break;
     720           0 :         case WAIT_EVENT_WAL_COPY_READ:
     721           0 :             event_name = "WALCopyRead";
     722           0 :             break;
     723           0 :         case WAIT_EVENT_WAL_COPY_SYNC:
     724           0 :             event_name = "WALCopySync";
     725           0 :             break;
     726           0 :         case WAIT_EVENT_WAL_COPY_WRITE:
     727           0 :             event_name = "WALCopyWrite";
     728           0 :             break;
     729           0 :         case WAIT_EVENT_WAL_INIT_SYNC:
     730           0 :             event_name = "WALInitSync";
     731           0 :             break;
     732           2 :         case WAIT_EVENT_WAL_INIT_WRITE:
     733           2 :             event_name = "WALInitWrite";
     734           2 :             break;
     735           0 :         case WAIT_EVENT_WAL_READ:
     736           0 :             event_name = "WALRead";
     737           0 :             break;
     738           0 :         case WAIT_EVENT_WAL_SYNC:
     739           0 :             event_name = "WALSync";
     740           0 :             break;
     741           0 :         case WAIT_EVENT_WAL_SYNC_METHOD_ASSIGN:
     742           0 :             event_name = "WALSyncMethodAssign";
     743           0 :             break;
     744           0 :         case WAIT_EVENT_WAL_WRITE:
     745           0 :             event_name = "WALWrite";
     746           0 :             break;
     747             : 
     748             :             /* no default case, so that compiler will warn */
     749             :     }
     750             : 
     751           2 :     return event_name;
     752             : }

Generated by: LCOV version 1.14