LCOV - code coverage report
Current view: top level - src/backend/utils/activity - wait_event.c (source / functions) Hit Total Coverage
Test: PostgreSQL 15devel Lines: 103 548 18.8 %
Date: 2021-09-17 16:07:28 Functions: 7 9 77.8 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.13