Line data Source code
1 : /*------------------------------------------------------------------------- 2 : * 3 : * pgstat_wait_event.c 4 : * Generated wait events infrastructure code 5 : * 6 : * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group 7 : * Portions Copyright (c) 1994, Regents of the University of California 8 : * 9 : * NOTES 10 : * ****************************** 11 : * *** DO NOT EDIT THIS FILE! *** 12 : * ****************************** 13 : * 14 : * It has been GENERATED by src/backend/utils/activity/generate-wait_event_types.pl 15 : * 16 : *------------------------------------------------------------------------- 17 : */ 18 : 19 : static const char * 20 7218 : pgstat_get_wait_activity(WaitEventActivity w) 21 : { 22 7218 : const char *event_name = "unknown wait event"; 23 : 24 7218 : switch (w) 25 : { 26 60 : case WAIT_EVENT_ARCHIVER_MAIN: 27 60 : event_name = "ArchiverMain"; 28 60 : break; 29 1222 : case WAIT_EVENT_AUTOVACUUM_MAIN: 30 1222 : event_name = "AutovacuumMain"; 31 1222 : break; 32 28 : case WAIT_EVENT_BGWRITER_HIBERNATE: 33 28 : event_name = "BgwriterHibernate"; 34 28 : break; 35 1326 : case WAIT_EVENT_BGWRITER_MAIN: 36 1326 : event_name = "BgwriterMain"; 37 1326 : break; 38 1328 : case WAIT_EVENT_CHECKPOINTER_MAIN: 39 1328 : event_name = "CheckpointerMain"; 40 1328 : break; 41 74 : case WAIT_EVENT_LOGICAL_APPLY_MAIN: 42 74 : event_name = "LogicalApplyMain"; 43 74 : break; 44 1328 : case WAIT_EVENT_LOGICAL_LAUNCHER_MAIN: 45 1328 : event_name = "LogicalLauncherMain"; 46 1328 : break; 47 0 : case WAIT_EVENT_LOGICAL_PARALLEL_APPLY_MAIN: 48 0 : event_name = "LogicalParallelApplyMain"; 49 0 : break; 50 26 : case WAIT_EVENT_RECOVERY_WAL_STREAM: 51 26 : event_name = "RecoveryWalStream"; 52 26 : break; 53 0 : case WAIT_EVENT_REPLICATION_SLOTSYNC_MAIN: 54 0 : event_name = "ReplicationSlotsyncMain"; 55 0 : break; 56 0 : case WAIT_EVENT_REPLICATION_SLOTSYNC_SHUTDOWN: 57 0 : event_name = "ReplicationSlotsyncShutdown"; 58 0 : break; 59 0 : case WAIT_EVENT_SYSLOGGER_MAIN: 60 0 : event_name = "SysloggerMain"; 61 0 : break; 62 26 : case WAIT_EVENT_WAL_RECEIVER_MAIN: 63 26 : event_name = "WalReceiverMain"; 64 26 : break; 65 472 : case WAIT_EVENT_WAL_SENDER_MAIN: 66 472 : event_name = "WalSenderMain"; 67 472 : break; 68 0 : case WAIT_EVENT_WAL_SUMMARIZER_WAL: 69 0 : event_name = "WalSummarizerWal"; 70 0 : break; 71 1328 : case WAIT_EVENT_WAL_WRITER_MAIN: 72 1328 : event_name = "WalWriterMain"; 73 1328 : break; 74 : /* no default case, so that compiler will warn */ 75 : } 76 : 77 7218 : return event_name; 78 : } 79 : 80 : static const char * 81 0 : pgstat_get_wait_bufferpin(WaitEventBufferPin w) 82 : { 83 0 : const char *event_name = "unknown wait event"; 84 : 85 0 : switch (w) 86 : { 87 0 : case WAIT_EVENT_BUFFER_PIN: 88 0 : event_name = "BufferPin"; 89 0 : break; 90 : /* no default case, so that compiler will warn */ 91 : } 92 : 93 0 : return event_name; 94 : } 95 : 96 : static const char * 97 1086 : pgstat_get_wait_client(WaitEventClient w) 98 : { 99 1086 : const char *event_name = "unknown wait event"; 100 : 101 1086 : switch (w) 102 : { 103 92 : case WAIT_EVENT_CLIENT_READ: 104 92 : event_name = "ClientRead"; 105 92 : break; 106 0 : case WAIT_EVENT_CLIENT_WRITE: 107 0 : event_name = "ClientWrite"; 108 0 : break; 109 0 : case WAIT_EVENT_GSS_OPEN_SERVER: 110 0 : event_name = "GssOpenServer"; 111 0 : break; 112 0 : case WAIT_EVENT_LIBPQWALRECEIVER_CONNECT: 113 0 : event_name = "LibpqwalreceiverConnect"; 114 0 : break; 115 0 : case WAIT_EVENT_LIBPQWALRECEIVER_RECEIVE: 116 0 : event_name = "LibpqwalreceiverReceive"; 117 0 : break; 118 0 : case WAIT_EVENT_SSL_OPEN_SERVER: 119 0 : event_name = "SslOpenServer"; 120 0 : break; 121 4 : case WAIT_EVENT_WAIT_FOR_STANDBY_CONFIRMATION: 122 4 : event_name = "WaitForStandbyConfirmation"; 123 4 : break; 124 988 : case WAIT_EVENT_WAL_SENDER_WAIT_FOR_WAL: 125 988 : event_name = "WalSenderWaitForWal"; 126 988 : break; 127 2 : case WAIT_EVENT_WAL_SENDER_WRITE_DATA: 128 2 : event_name = "WalSenderWriteData"; 129 2 : break; 130 : /* no default case, so that compiler will warn */ 131 : } 132 : 133 1086 : return event_name; 134 : } 135 : 136 : static const char * 137 8 : pgstat_get_wait_io(WaitEventIO w) 138 : { 139 8 : const char *event_name = "unknown wait event"; 140 : 141 8 : switch (w) 142 : { 143 0 : case WAIT_EVENT_BASEBACKUP_READ: 144 0 : event_name = "BasebackupRead"; 145 0 : break; 146 0 : case WAIT_EVENT_BASEBACKUP_SYNC: 147 0 : event_name = "BasebackupSync"; 148 0 : break; 149 0 : case WAIT_EVENT_BASEBACKUP_WRITE: 150 0 : event_name = "BasebackupWrite"; 151 0 : break; 152 0 : case WAIT_EVENT_BUFFILE_READ: 153 0 : event_name = "BuffileRead"; 154 0 : break; 155 0 : case WAIT_EVENT_BUFFILE_TRUNCATE: 156 0 : event_name = "BuffileTruncate"; 157 0 : break; 158 0 : case WAIT_EVENT_BUFFILE_WRITE: 159 0 : event_name = "BuffileWrite"; 160 0 : break; 161 0 : case WAIT_EVENT_CONTROL_FILE_READ: 162 0 : event_name = "ControlFileRead"; 163 0 : break; 164 0 : case WAIT_EVENT_CONTROL_FILE_SYNC: 165 0 : event_name = "ControlFileSync"; 166 0 : break; 167 0 : case WAIT_EVENT_CONTROL_FILE_SYNC_UPDATE: 168 0 : event_name = "ControlFileSyncUpdate"; 169 0 : break; 170 0 : case WAIT_EVENT_CONTROL_FILE_WRITE: 171 0 : event_name = "ControlFileWrite"; 172 0 : break; 173 0 : case WAIT_EVENT_CONTROL_FILE_WRITE_UPDATE: 174 0 : event_name = "ControlFileWriteUpdate"; 175 0 : break; 176 0 : case WAIT_EVENT_COPY_FILE_READ: 177 0 : event_name = "CopyFileRead"; 178 0 : break; 179 0 : case WAIT_EVENT_COPY_FILE_WRITE: 180 0 : event_name = "CopyFileWrite"; 181 0 : break; 182 0 : case WAIT_EVENT_DATA_FILE_EXTEND: 183 0 : event_name = "DataFileExtend"; 184 0 : break; 185 0 : case WAIT_EVENT_DATA_FILE_FLUSH: 186 0 : event_name = "DataFileFlush"; 187 0 : break; 188 0 : case WAIT_EVENT_DATA_FILE_IMMEDIATE_SYNC: 189 0 : event_name = "DataFileImmediateSync"; 190 0 : break; 191 0 : case WAIT_EVENT_DATA_FILE_PREFETCH: 192 0 : event_name = "DataFilePrefetch"; 193 0 : break; 194 0 : case WAIT_EVENT_DATA_FILE_READ: 195 0 : event_name = "DataFileRead"; 196 0 : break; 197 0 : case WAIT_EVENT_DATA_FILE_SYNC: 198 0 : event_name = "DataFileSync"; 199 0 : break; 200 0 : case WAIT_EVENT_DATA_FILE_TRUNCATE: 201 0 : event_name = "DataFileTruncate"; 202 0 : break; 203 0 : case WAIT_EVENT_DATA_FILE_WRITE: 204 0 : event_name = "DataFileWrite"; 205 0 : break; 206 0 : case WAIT_EVENT_DSM_ALLOCATE: 207 0 : event_name = "DsmAllocate"; 208 0 : break; 209 0 : case WAIT_EVENT_DSM_FILL_ZERO_WRITE: 210 0 : event_name = "DsmFillZeroWrite"; 211 0 : break; 212 0 : case WAIT_EVENT_LOCK_FILE_ADDTODATADIR_READ: 213 0 : event_name = "LockFileAddtodatadirRead"; 214 0 : break; 215 0 : case WAIT_EVENT_LOCK_FILE_ADDTODATADIR_SYNC: 216 0 : event_name = "LockFileAddtodatadirSync"; 217 0 : break; 218 0 : case WAIT_EVENT_LOCK_FILE_ADDTODATADIR_WRITE: 219 0 : event_name = "LockFileAddtodatadirWrite"; 220 0 : break; 221 0 : case WAIT_EVENT_LOCK_FILE_CREATE_READ: 222 0 : event_name = "LockFileCreateRead"; 223 0 : break; 224 0 : case WAIT_EVENT_LOCK_FILE_CREATE_SYNC: 225 0 : event_name = "LockFileCreateSync"; 226 0 : break; 227 0 : case WAIT_EVENT_LOCK_FILE_CREATE_WRITE: 228 0 : event_name = "LockFileCreateWrite"; 229 0 : break; 230 0 : case WAIT_EVENT_LOCK_FILE_RECHECKDATADIR_READ: 231 0 : event_name = "LockFileRecheckdatadirRead"; 232 0 : break; 233 0 : case WAIT_EVENT_LOGICAL_REWRITE_CHECKPOINT_SYNC: 234 0 : event_name = "LogicalRewriteCheckpointSync"; 235 0 : break; 236 0 : case WAIT_EVENT_LOGICAL_REWRITE_MAPPING_SYNC: 237 0 : event_name = "LogicalRewriteMappingSync"; 238 0 : break; 239 0 : case WAIT_EVENT_LOGICAL_REWRITE_MAPPING_WRITE: 240 0 : event_name = "LogicalRewriteMappingWrite"; 241 0 : break; 242 0 : case WAIT_EVENT_LOGICAL_REWRITE_SYNC: 243 0 : event_name = "LogicalRewriteSync"; 244 0 : break; 245 0 : case WAIT_EVENT_LOGICAL_REWRITE_TRUNCATE: 246 0 : event_name = "LogicalRewriteTruncate"; 247 0 : break; 248 0 : case WAIT_EVENT_LOGICAL_REWRITE_WRITE: 249 0 : event_name = "LogicalRewriteWrite"; 250 0 : break; 251 0 : case WAIT_EVENT_RELATION_MAP_READ: 252 0 : event_name = "RelationMapRead"; 253 0 : break; 254 0 : case WAIT_EVENT_RELATION_MAP_REPLACE: 255 0 : event_name = "RelationMapReplace"; 256 0 : break; 257 0 : case WAIT_EVENT_RELATION_MAP_WRITE: 258 0 : event_name = "RelationMapWrite"; 259 0 : break; 260 0 : case WAIT_EVENT_REORDER_BUFFER_READ: 261 0 : event_name = "ReorderBufferRead"; 262 0 : break; 263 6 : case WAIT_EVENT_REORDER_BUFFER_WRITE: 264 6 : event_name = "ReorderBufferWrite"; 265 6 : break; 266 0 : case WAIT_EVENT_REORDER_LOGICAL_MAPPING_READ: 267 0 : event_name = "ReorderLogicalMappingRead"; 268 0 : break; 269 0 : case WAIT_EVENT_REPLICATION_SLOT_READ: 270 0 : event_name = "ReplicationSlotRead"; 271 0 : break; 272 0 : case WAIT_EVENT_REPLICATION_SLOT_RESTORE_SYNC: 273 0 : event_name = "ReplicationSlotRestoreSync"; 274 0 : break; 275 0 : case WAIT_EVENT_REPLICATION_SLOT_SYNC: 276 0 : event_name = "ReplicationSlotSync"; 277 0 : break; 278 0 : case WAIT_EVENT_REPLICATION_SLOT_WRITE: 279 0 : event_name = "ReplicationSlotWrite"; 280 0 : break; 281 0 : case WAIT_EVENT_SLRU_FLUSH_SYNC: 282 0 : event_name = "SlruFlushSync"; 283 0 : break; 284 0 : case WAIT_EVENT_SLRU_READ: 285 0 : event_name = "SlruRead"; 286 0 : break; 287 0 : case WAIT_EVENT_SLRU_SYNC: 288 0 : event_name = "SlruSync"; 289 0 : break; 290 0 : case WAIT_EVENT_SLRU_WRITE: 291 0 : event_name = "SlruWrite"; 292 0 : break; 293 0 : case WAIT_EVENT_SNAPBUILD_READ: 294 0 : event_name = "SnapbuildRead"; 295 0 : break; 296 0 : case WAIT_EVENT_SNAPBUILD_SYNC: 297 0 : event_name = "SnapbuildSync"; 298 0 : break; 299 0 : case WAIT_EVENT_SNAPBUILD_WRITE: 300 0 : event_name = "SnapbuildWrite"; 301 0 : break; 302 0 : case WAIT_EVENT_TIMELINE_HISTORY_FILE_SYNC: 303 0 : event_name = "TimelineHistoryFileSync"; 304 0 : break; 305 0 : case WAIT_EVENT_TIMELINE_HISTORY_FILE_WRITE: 306 0 : event_name = "TimelineHistoryFileWrite"; 307 0 : break; 308 0 : case WAIT_EVENT_TIMELINE_HISTORY_READ: 309 0 : event_name = "TimelineHistoryRead"; 310 0 : break; 311 0 : case WAIT_EVENT_TIMELINE_HISTORY_SYNC: 312 0 : event_name = "TimelineHistorySync"; 313 0 : break; 314 0 : case WAIT_EVENT_TIMELINE_HISTORY_WRITE: 315 0 : event_name = "TimelineHistoryWrite"; 316 0 : break; 317 0 : case WAIT_EVENT_TWOPHASE_FILE_READ: 318 0 : event_name = "TwophaseFileRead"; 319 0 : break; 320 0 : case WAIT_EVENT_TWOPHASE_FILE_SYNC: 321 0 : event_name = "TwophaseFileSync"; 322 0 : break; 323 0 : case WAIT_EVENT_TWOPHASE_FILE_WRITE: 324 0 : event_name = "TwophaseFileWrite"; 325 0 : break; 326 0 : case WAIT_EVENT_VERSION_FILE_SYNC: 327 0 : event_name = "VersionFileSync"; 328 0 : break; 329 0 : case WAIT_EVENT_VERSION_FILE_WRITE: 330 0 : event_name = "VersionFileWrite"; 331 0 : break; 332 0 : case WAIT_EVENT_WALSENDER_TIMELINE_HISTORY_READ: 333 0 : event_name = "WalsenderTimelineHistoryRead"; 334 0 : break; 335 0 : case WAIT_EVENT_WAL_BOOTSTRAP_SYNC: 336 0 : event_name = "WalBootstrapSync"; 337 0 : break; 338 0 : case WAIT_EVENT_WAL_BOOTSTRAP_WRITE: 339 0 : event_name = "WalBootstrapWrite"; 340 0 : break; 341 0 : case WAIT_EVENT_WAL_COPY_READ: 342 0 : event_name = "WalCopyRead"; 343 0 : break; 344 0 : case WAIT_EVENT_WAL_COPY_SYNC: 345 0 : event_name = "WalCopySync"; 346 0 : break; 347 0 : case WAIT_EVENT_WAL_COPY_WRITE: 348 0 : event_name = "WalCopyWrite"; 349 0 : break; 350 0 : case WAIT_EVENT_WAL_INIT_SYNC: 351 0 : event_name = "WalInitSync"; 352 0 : break; 353 0 : case WAIT_EVENT_WAL_INIT_WRITE: 354 0 : event_name = "WalInitWrite"; 355 0 : break; 356 0 : case WAIT_EVENT_WAL_READ: 357 0 : event_name = "WalRead"; 358 0 : break; 359 0 : case WAIT_EVENT_WAL_SUMMARY_READ: 360 0 : event_name = "WalSummaryRead"; 361 0 : break; 362 0 : case WAIT_EVENT_WAL_SUMMARY_WRITE: 363 0 : event_name = "WalSummaryWrite"; 364 0 : break; 365 0 : case WAIT_EVENT_WAL_SYNC: 366 0 : event_name = "WalSync"; 367 0 : break; 368 0 : case WAIT_EVENT_WAL_SYNC_METHOD_ASSIGN: 369 0 : event_name = "WalSyncMethodAssign"; 370 0 : break; 371 2 : case WAIT_EVENT_WAL_WRITE: 372 2 : event_name = "WalWrite"; 373 2 : break; 374 : /* no default case, so that compiler will warn */ 375 : } 376 : 377 8 : return event_name; 378 : } 379 : 380 : static const char * 381 6 : pgstat_get_wait_ipc(WaitEventIPC w) 382 : { 383 6 : const char *event_name = "unknown wait event"; 384 : 385 6 : switch (w) 386 : { 387 0 : case WAIT_EVENT_APPEND_READY: 388 0 : event_name = "AppendReady"; 389 0 : break; 390 0 : case WAIT_EVENT_ARCHIVE_CLEANUP_COMMAND: 391 0 : event_name = "ArchiveCleanupCommand"; 392 0 : break; 393 4 : case WAIT_EVENT_ARCHIVE_COMMAND: 394 4 : event_name = "ArchiveCommand"; 395 4 : break; 396 0 : case WAIT_EVENT_BACKEND_TERMINATION: 397 0 : event_name = "BackendTermination"; 398 0 : break; 399 0 : case WAIT_EVENT_BACKUP_WAIT_WAL_ARCHIVE: 400 0 : event_name = "BackupWaitWalArchive"; 401 0 : break; 402 0 : case WAIT_EVENT_BGWORKER_SHUTDOWN: 403 0 : event_name = "BgworkerShutdown"; 404 0 : break; 405 0 : case WAIT_EVENT_BGWORKER_STARTUP: 406 0 : event_name = "BgworkerStartup"; 407 0 : break; 408 0 : case WAIT_EVENT_BTREE_PAGE: 409 0 : event_name = "BtreePage"; 410 0 : break; 411 0 : case WAIT_EVENT_BUFFER_IO: 412 0 : event_name = "BufferIo"; 413 0 : break; 414 0 : case WAIT_EVENT_CHECKPOINT_DELAY_COMPLETE: 415 0 : event_name = "CheckpointDelayComplete"; 416 0 : break; 417 0 : case WAIT_EVENT_CHECKPOINT_DELAY_START: 418 0 : event_name = "CheckpointDelayStart"; 419 0 : break; 420 2 : case WAIT_EVENT_CHECKPOINT_DONE: 421 2 : event_name = "CheckpointDone"; 422 2 : break; 423 0 : case WAIT_EVENT_CHECKPOINT_START: 424 0 : event_name = "CheckpointStart"; 425 0 : break; 426 0 : case WAIT_EVENT_EXECUTE_GATHER: 427 0 : event_name = "ExecuteGather"; 428 0 : break; 429 0 : case WAIT_EVENT_HASH_BATCH_ALLOCATE: 430 0 : event_name = "HashBatchAllocate"; 431 0 : break; 432 0 : case WAIT_EVENT_HASH_BATCH_ELECT: 433 0 : event_name = "HashBatchElect"; 434 0 : break; 435 0 : case WAIT_EVENT_HASH_BATCH_LOAD: 436 0 : event_name = "HashBatchLoad"; 437 0 : break; 438 0 : case WAIT_EVENT_HASH_BUILD_ALLOCATE: 439 0 : event_name = "HashBuildAllocate"; 440 0 : break; 441 0 : case WAIT_EVENT_HASH_BUILD_ELECT: 442 0 : event_name = "HashBuildElect"; 443 0 : break; 444 0 : case WAIT_EVENT_HASH_BUILD_HASH_INNER: 445 0 : event_name = "HashBuildHashInner"; 446 0 : break; 447 0 : case WAIT_EVENT_HASH_BUILD_HASH_OUTER: 448 0 : event_name = "HashBuildHashOuter"; 449 0 : break; 450 0 : case WAIT_EVENT_HASH_GROW_BATCHES_DECIDE: 451 0 : event_name = "HashGrowBatchesDecide"; 452 0 : break; 453 0 : case WAIT_EVENT_HASH_GROW_BATCHES_ELECT: 454 0 : event_name = "HashGrowBatchesElect"; 455 0 : break; 456 0 : case WAIT_EVENT_HASH_GROW_BATCHES_FINISH: 457 0 : event_name = "HashGrowBatchesFinish"; 458 0 : break; 459 0 : case WAIT_EVENT_HASH_GROW_BATCHES_REALLOCATE: 460 0 : event_name = "HashGrowBatchesReallocate"; 461 0 : break; 462 0 : case WAIT_EVENT_HASH_GROW_BATCHES_REPARTITION: 463 0 : event_name = "HashGrowBatchesRepartition"; 464 0 : break; 465 0 : case WAIT_EVENT_HASH_GROW_BUCKETS_ELECT: 466 0 : event_name = "HashGrowBucketsElect"; 467 0 : break; 468 0 : case WAIT_EVENT_HASH_GROW_BUCKETS_REALLOCATE: 469 0 : event_name = "HashGrowBucketsReallocate"; 470 0 : break; 471 0 : case WAIT_EVENT_HASH_GROW_BUCKETS_REINSERT: 472 0 : event_name = "HashGrowBucketsReinsert"; 473 0 : break; 474 0 : case WAIT_EVENT_LOGICAL_APPLY_SEND_DATA: 475 0 : event_name = "LogicalApplySendData"; 476 0 : break; 477 0 : case WAIT_EVENT_LOGICAL_PARALLEL_APPLY_STATE_CHANGE: 478 0 : event_name = "LogicalParallelApplyStateChange"; 479 0 : break; 480 0 : case WAIT_EVENT_LOGICAL_SYNC_DATA: 481 0 : event_name = "LogicalSyncData"; 482 0 : break; 483 0 : case WAIT_EVENT_LOGICAL_SYNC_STATE_CHANGE: 484 0 : event_name = "LogicalSyncStateChange"; 485 0 : break; 486 0 : case WAIT_EVENT_MESSAGE_QUEUE_INTERNAL: 487 0 : event_name = "MessageQueueInternal"; 488 0 : break; 489 0 : case WAIT_EVENT_MESSAGE_QUEUE_PUT_MESSAGE: 490 0 : event_name = "MessageQueuePutMessage"; 491 0 : break; 492 0 : case WAIT_EVENT_MESSAGE_QUEUE_RECEIVE: 493 0 : event_name = "MessageQueueReceive"; 494 0 : break; 495 0 : case WAIT_EVENT_MESSAGE_QUEUE_SEND: 496 0 : event_name = "MessageQueueSend"; 497 0 : break; 498 0 : case WAIT_EVENT_MULTIXACT_CREATION: 499 0 : event_name = "MultixactCreation"; 500 0 : break; 501 0 : case WAIT_EVENT_PARALLEL_BITMAP_SCAN: 502 0 : event_name = "ParallelBitmapScan"; 503 0 : break; 504 0 : case WAIT_EVENT_PARALLEL_CREATE_INDEX_SCAN: 505 0 : event_name = "ParallelCreateIndexScan"; 506 0 : break; 507 0 : case WAIT_EVENT_PARALLEL_FINISH: 508 0 : event_name = "ParallelFinish"; 509 0 : break; 510 0 : case WAIT_EVENT_PROCARRAY_GROUP_UPDATE: 511 0 : event_name = "ProcarrayGroupUpdate"; 512 0 : break; 513 0 : case WAIT_EVENT_PROC_SIGNAL_BARRIER: 514 0 : event_name = "ProcSignalBarrier"; 515 0 : break; 516 0 : case WAIT_EVENT_PROMOTE: 517 0 : event_name = "Promote"; 518 0 : break; 519 0 : case WAIT_EVENT_RECOVERY_CONFLICT_SNAPSHOT: 520 0 : event_name = "RecoveryConflictSnapshot"; 521 0 : break; 522 0 : case WAIT_EVENT_RECOVERY_CONFLICT_TABLESPACE: 523 0 : event_name = "RecoveryConflictTablespace"; 524 0 : break; 525 0 : case WAIT_EVENT_RECOVERY_END_COMMAND: 526 0 : event_name = "RecoveryEndCommand"; 527 0 : break; 528 0 : case WAIT_EVENT_RECOVERY_PAUSE: 529 0 : event_name = "RecoveryPause"; 530 0 : break; 531 0 : case WAIT_EVENT_REPLICATION_ORIGIN_DROP: 532 0 : event_name = "ReplicationOriginDrop"; 533 0 : break; 534 0 : case WAIT_EVENT_REPLICATION_SLOT_DROP: 535 0 : event_name = "ReplicationSlotDrop"; 536 0 : break; 537 0 : case WAIT_EVENT_RESTORE_COMMAND: 538 0 : event_name = "RestoreCommand"; 539 0 : break; 540 0 : case WAIT_EVENT_SAFE_SNAPSHOT: 541 0 : event_name = "SafeSnapshot"; 542 0 : break; 543 0 : case WAIT_EVENT_SYNC_REP: 544 0 : event_name = "SyncRep"; 545 0 : break; 546 0 : case WAIT_EVENT_WAL_RECEIVER_EXIT: 547 0 : event_name = "WalReceiverExit"; 548 0 : break; 549 0 : case WAIT_EVENT_WAL_RECEIVER_WAIT_START: 550 0 : event_name = "WalReceiverWaitStart"; 551 0 : break; 552 0 : case WAIT_EVENT_WAL_SUMMARY_READY: 553 0 : event_name = "WalSummaryReady"; 554 0 : break; 555 0 : case WAIT_EVENT_XACT_GROUP_UPDATE: 556 0 : event_name = "XactGroupUpdate"; 557 0 : break; 558 : /* no default case, so that compiler will warn */ 559 : } 560 : 561 6 : return event_name; 562 : } 563 : 564 : static const char * 565 40 : pgstat_get_wait_timeout(WaitEventTimeout w) 566 : { 567 40 : const char *event_name = "unknown wait event"; 568 : 569 40 : switch (w) 570 : { 571 6 : case WAIT_EVENT_BASE_BACKUP_THROTTLE: 572 6 : event_name = "BaseBackupThrottle"; 573 6 : break; 574 20 : case WAIT_EVENT_CHECKPOINT_WRITE_DELAY: 575 20 : event_name = "CheckpointWriteDelay"; 576 20 : break; 577 14 : case WAIT_EVENT_PG_SLEEP: 578 14 : event_name = "PgSleep"; 579 14 : break; 580 0 : case WAIT_EVENT_RECOVERY_APPLY_DELAY: 581 0 : event_name = "RecoveryApplyDelay"; 582 0 : break; 583 0 : case WAIT_EVENT_RECOVERY_RETRIEVE_RETRY_INTERVAL: 584 0 : event_name = "RecoveryRetrieveRetryInterval"; 585 0 : break; 586 0 : case WAIT_EVENT_REGISTER_SYNC_REQUEST: 587 0 : event_name = "RegisterSyncRequest"; 588 0 : break; 589 0 : case WAIT_EVENT_SPIN_DELAY: 590 0 : event_name = "SpinDelay"; 591 0 : break; 592 0 : case WAIT_EVENT_VACUUM_DELAY: 593 0 : event_name = "VacuumDelay"; 594 0 : break; 595 0 : case WAIT_EVENT_VACUUM_TRUNCATE: 596 0 : event_name = "VacuumTruncate"; 597 0 : break; 598 0 : case WAIT_EVENT_WAL_SUMMARIZER_ERROR: 599 0 : event_name = "WalSummarizerError"; 600 0 : break; 601 : /* no default case, so that compiler will warn */ 602 : } 603 : 604 40 : return event_name; 605 : } 606 :