PostgreSQL Source Code  git master
wait_event.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PG_WAIT_LWLOCK   0x01000000U
 
#define PG_WAIT_LOCK   0x03000000U
 
#define PG_WAIT_BUFFER_PIN   0x04000000U
 
#define PG_WAIT_ACTIVITY   0x05000000U
 
#define PG_WAIT_CLIENT   0x06000000U
 
#define PG_WAIT_EXTENSION   0x07000000U
 
#define PG_WAIT_IPC   0x08000000U
 
#define PG_WAIT_TIMEOUT   0x09000000U
 
#define PG_WAIT_IO   0x0A000000U
 

Enumerations

enum  WaitEventActivity {
  WAIT_EVENT_ARCHIVER_MAIN = PG_WAIT_ACTIVITY , WAIT_EVENT_AUTOVACUUM_MAIN , WAIT_EVENT_BGWRITER_HIBERNATE , WAIT_EVENT_BGWRITER_MAIN ,
  WAIT_EVENT_CHECKPOINTER_MAIN , WAIT_EVENT_LOGICAL_APPLY_MAIN , WAIT_EVENT_LOGICAL_LAUNCHER_MAIN , WAIT_EVENT_PGSTAT_MAIN ,
  WAIT_EVENT_RECOVERY_WAL_STREAM , WAIT_EVENT_SYSLOGGER_MAIN , WAIT_EVENT_WAL_RECEIVER_MAIN , WAIT_EVENT_WAL_SENDER_MAIN ,
  WAIT_EVENT_WAL_WRITER_MAIN
}
 
enum  WaitEventClient {
  WAIT_EVENT_CLIENT_READ = PG_WAIT_CLIENT , WAIT_EVENT_CLIENT_WRITE , WAIT_EVENT_GSS_OPEN_SERVER , WAIT_EVENT_LIBPQWALRECEIVER_CONNECT ,
  WAIT_EVENT_LIBPQWALRECEIVER_RECEIVE , WAIT_EVENT_SSL_OPEN_SERVER , WAIT_EVENT_WAL_SENDER_WAIT_WAL , WAIT_EVENT_WAL_SENDER_WRITE_DATA
}
 
enum  WaitEventIPC {
  WAIT_EVENT_APPEND_READY = PG_WAIT_IPC , WAIT_EVENT_ARCHIVE_CLEANUP_COMMAND , WAIT_EVENT_ARCHIVE_COMMAND , WAIT_EVENT_BACKEND_TERMINATION ,
  WAIT_EVENT_BACKUP_WAIT_WAL_ARCHIVE , WAIT_EVENT_BGWORKER_SHUTDOWN , WAIT_EVENT_BGWORKER_STARTUP , WAIT_EVENT_BTREE_PAGE ,
  WAIT_EVENT_BUFFER_IO , WAIT_EVENT_CHECKPOINT_DONE , WAIT_EVENT_CHECKPOINT_START , WAIT_EVENT_EXECUTE_GATHER ,
  WAIT_EVENT_HASH_BATCH_ALLOCATE , WAIT_EVENT_HASH_BATCH_ELECT , WAIT_EVENT_HASH_BATCH_LOAD , WAIT_EVENT_HASH_BUILD_ALLOCATE ,
  WAIT_EVENT_HASH_BUILD_ELECT , WAIT_EVENT_HASH_BUILD_HASH_INNER , WAIT_EVENT_HASH_BUILD_HASH_OUTER , WAIT_EVENT_HASH_GROW_BATCHES_ALLOCATE ,
  WAIT_EVENT_HASH_GROW_BATCHES_DECIDE , WAIT_EVENT_HASH_GROW_BATCHES_ELECT , WAIT_EVENT_HASH_GROW_BATCHES_FINISH , WAIT_EVENT_HASH_GROW_BATCHES_REPARTITION ,
  WAIT_EVENT_HASH_GROW_BUCKETS_ALLOCATE , WAIT_EVENT_HASH_GROW_BUCKETS_ELECT , WAIT_EVENT_HASH_GROW_BUCKETS_REINSERT , WAIT_EVENT_LOGICAL_SYNC_DATA ,
  WAIT_EVENT_LOGICAL_SYNC_STATE_CHANGE , WAIT_EVENT_MQ_INTERNAL , WAIT_EVENT_MQ_PUT_MESSAGE , WAIT_EVENT_MQ_RECEIVE ,
  WAIT_EVENT_MQ_SEND , WAIT_EVENT_PARALLEL_BITMAP_SCAN , WAIT_EVENT_PARALLEL_CREATE_INDEX_SCAN , WAIT_EVENT_PARALLEL_FINISH ,
  WAIT_EVENT_PROCARRAY_GROUP_UPDATE , WAIT_EVENT_PROC_SIGNAL_BARRIER , WAIT_EVENT_PROMOTE , WAIT_EVENT_RECOVERY_CONFLICT_SNAPSHOT ,
  WAIT_EVENT_RECOVERY_CONFLICT_TABLESPACE , WAIT_EVENT_RECOVERY_END_COMMAND , WAIT_EVENT_RECOVERY_PAUSE , WAIT_EVENT_REPLICATION_ORIGIN_DROP ,
  WAIT_EVENT_REPLICATION_SLOT_DROP , WAIT_EVENT_RESTORE_COMMAND , WAIT_EVENT_SAFE_SNAPSHOT , WAIT_EVENT_SYNC_REP ,
  WAIT_EVENT_WAL_RECEIVER_EXIT , WAIT_EVENT_WAL_RECEIVER_WAIT_START , WAIT_EVENT_XACT_GROUP_UPDATE
}
 
enum  WaitEventTimeout {
  WAIT_EVENT_BASE_BACKUP_THROTTLE = PG_WAIT_TIMEOUT , WAIT_EVENT_PG_SLEEP , WAIT_EVENT_RECOVERY_APPLY_DELAY , WAIT_EVENT_RECOVERY_RETRIEVE_RETRY_INTERVAL ,
  WAIT_EVENT_VACUUM_DELAY , WAIT_EVENT_VACUUM_TRUNCATE
}
 
enum  WaitEventIO {
  WAIT_EVENT_BASEBACKUP_READ = PG_WAIT_IO , WAIT_EVENT_BUFFILE_READ , WAIT_EVENT_BUFFILE_WRITE , WAIT_EVENT_BUFFILE_TRUNCATE ,
  WAIT_EVENT_CONTROL_FILE_READ , WAIT_EVENT_CONTROL_FILE_SYNC , WAIT_EVENT_CONTROL_FILE_SYNC_UPDATE , WAIT_EVENT_CONTROL_FILE_WRITE ,
  WAIT_EVENT_CONTROL_FILE_WRITE_UPDATE , WAIT_EVENT_COPY_FILE_READ , WAIT_EVENT_COPY_FILE_WRITE , WAIT_EVENT_DATA_FILE_EXTEND ,
  WAIT_EVENT_DATA_FILE_FLUSH , WAIT_EVENT_DATA_FILE_IMMEDIATE_SYNC , WAIT_EVENT_DATA_FILE_PREFETCH , WAIT_EVENT_DATA_FILE_READ ,
  WAIT_EVENT_DATA_FILE_SYNC , WAIT_EVENT_DATA_FILE_TRUNCATE , WAIT_EVENT_DATA_FILE_WRITE , WAIT_EVENT_DSM_FILL_ZERO_WRITE ,
  WAIT_EVENT_LOCK_FILE_ADDTODATADIR_READ , WAIT_EVENT_LOCK_FILE_ADDTODATADIR_SYNC , WAIT_EVENT_LOCK_FILE_ADDTODATADIR_WRITE , WAIT_EVENT_LOCK_FILE_CREATE_READ ,
  WAIT_EVENT_LOCK_FILE_CREATE_SYNC , WAIT_EVENT_LOCK_FILE_CREATE_WRITE , WAIT_EVENT_LOCK_FILE_RECHECKDATADIR_READ , WAIT_EVENT_LOGICAL_REWRITE_CHECKPOINT_SYNC ,
  WAIT_EVENT_LOGICAL_REWRITE_MAPPING_SYNC , WAIT_EVENT_LOGICAL_REWRITE_MAPPING_WRITE , WAIT_EVENT_LOGICAL_REWRITE_SYNC , WAIT_EVENT_LOGICAL_REWRITE_TRUNCATE ,
  WAIT_EVENT_LOGICAL_REWRITE_WRITE , WAIT_EVENT_RELATION_MAP_READ , WAIT_EVENT_RELATION_MAP_SYNC , WAIT_EVENT_RELATION_MAP_WRITE ,
  WAIT_EVENT_REORDER_BUFFER_READ , WAIT_EVENT_REORDER_BUFFER_WRITE , WAIT_EVENT_REORDER_LOGICAL_MAPPING_READ , WAIT_EVENT_REPLICATION_SLOT_READ ,
  WAIT_EVENT_REPLICATION_SLOT_RESTORE_SYNC , WAIT_EVENT_REPLICATION_SLOT_SYNC , WAIT_EVENT_REPLICATION_SLOT_WRITE , WAIT_EVENT_SLRU_FLUSH_SYNC ,
  WAIT_EVENT_SLRU_READ , WAIT_EVENT_SLRU_SYNC , WAIT_EVENT_SLRU_WRITE , WAIT_EVENT_SNAPBUILD_READ ,
  WAIT_EVENT_SNAPBUILD_SYNC , WAIT_EVENT_SNAPBUILD_WRITE , WAIT_EVENT_TIMELINE_HISTORY_FILE_SYNC , WAIT_EVENT_TIMELINE_HISTORY_FILE_WRITE ,
  WAIT_EVENT_TIMELINE_HISTORY_READ , WAIT_EVENT_TIMELINE_HISTORY_SYNC , WAIT_EVENT_TIMELINE_HISTORY_WRITE , WAIT_EVENT_TWOPHASE_FILE_READ ,
  WAIT_EVENT_TWOPHASE_FILE_SYNC , WAIT_EVENT_TWOPHASE_FILE_WRITE , WAIT_EVENT_WALSENDER_TIMELINE_HISTORY_READ , WAIT_EVENT_WAL_BOOTSTRAP_SYNC ,
  WAIT_EVENT_WAL_BOOTSTRAP_WRITE , WAIT_EVENT_WAL_COPY_READ , WAIT_EVENT_WAL_COPY_SYNC , WAIT_EVENT_WAL_COPY_WRITE ,
  WAIT_EVENT_WAL_INIT_SYNC , WAIT_EVENT_WAL_INIT_WRITE , WAIT_EVENT_WAL_READ , WAIT_EVENT_WAL_SYNC ,
  WAIT_EVENT_WAL_SYNC_METHOD_ASSIGN , WAIT_EVENT_WAL_WRITE
}
 

Functions

const char * pgstat_get_wait_event (uint32 wait_event_info)
 
const char * pgstat_get_wait_event_type (uint32 wait_event_info)
 
static void pgstat_report_wait_start (uint32 wait_event_info)
 
static void pgstat_report_wait_end (void)
 
void pgstat_set_wait_event_storage (uint32 *wait_event_info)
 
void pgstat_reset_wait_event_storage (void)
 

Variables

PGDLLIMPORT uint32my_wait_event_info
 

Macro Definition Documentation

◆ PG_WAIT_ACTIVITY

#define PG_WAIT_ACTIVITY   0x05000000U

Definition at line 21 of file wait_event.h.

◆ PG_WAIT_BUFFER_PIN

#define PG_WAIT_BUFFER_PIN   0x04000000U

Definition at line 20 of file wait_event.h.

◆ PG_WAIT_CLIENT

#define PG_WAIT_CLIENT   0x06000000U

Definition at line 22 of file wait_event.h.

◆ PG_WAIT_EXTENSION

#define PG_WAIT_EXTENSION   0x07000000U

Definition at line 23 of file wait_event.h.

◆ PG_WAIT_IO

#define PG_WAIT_IO   0x0A000000U

Definition at line 26 of file wait_event.h.

◆ PG_WAIT_IPC

#define PG_WAIT_IPC   0x08000000U

Definition at line 24 of file wait_event.h.

◆ PG_WAIT_LOCK

#define PG_WAIT_LOCK   0x03000000U

Definition at line 19 of file wait_event.h.

◆ PG_WAIT_LWLOCK

#define PG_WAIT_LWLOCK   0x01000000U

Definition at line 18 of file wait_event.h.

◆ PG_WAIT_TIMEOUT

#define PG_WAIT_TIMEOUT   0x09000000U

Definition at line 25 of file wait_event.h.

Enumeration Type Documentation

◆ WaitEventActivity

Enumerator
WAIT_EVENT_ARCHIVER_MAIN 
WAIT_EVENT_AUTOVACUUM_MAIN 
WAIT_EVENT_BGWRITER_HIBERNATE 
WAIT_EVENT_BGWRITER_MAIN 
WAIT_EVENT_CHECKPOINTER_MAIN 
WAIT_EVENT_LOGICAL_APPLY_MAIN 
WAIT_EVENT_LOGICAL_LAUNCHER_MAIN 
WAIT_EVENT_PGSTAT_MAIN 
WAIT_EVENT_RECOVERY_WAL_STREAM 
WAIT_EVENT_SYSLOGGER_MAIN 
WAIT_EVENT_WAL_RECEIVER_MAIN 
WAIT_EVENT_WAL_SENDER_MAIN 
WAIT_EVENT_WAL_WRITER_MAIN 

Definition at line 36 of file wait_event.h.

37 {
WaitEventActivity
Definition: wait_event.h:37
@ WAIT_EVENT_SYSLOGGER_MAIN
Definition: wait_event.h:47
@ WAIT_EVENT_BGWRITER_MAIN
Definition: wait_event.h:41
@ WAIT_EVENT_WAL_WRITER_MAIN
Definition: wait_event.h:50
@ WAIT_EVENT_WAL_SENDER_MAIN
Definition: wait_event.h:49
@ WAIT_EVENT_LOGICAL_LAUNCHER_MAIN
Definition: wait_event.h:44
@ WAIT_EVENT_CHECKPOINTER_MAIN
Definition: wait_event.h:42
@ WAIT_EVENT_BGWRITER_HIBERNATE
Definition: wait_event.h:40
@ WAIT_EVENT_WAL_RECEIVER_MAIN
Definition: wait_event.h:48
@ WAIT_EVENT_ARCHIVER_MAIN
Definition: wait_event.h:38
@ WAIT_EVENT_LOGICAL_APPLY_MAIN
Definition: wait_event.h:43
@ WAIT_EVENT_RECOVERY_WAL_STREAM
Definition: wait_event.h:46
@ WAIT_EVENT_PGSTAT_MAIN
Definition: wait_event.h:45
@ WAIT_EVENT_AUTOVACUUM_MAIN
Definition: wait_event.h:39
#define PG_WAIT_ACTIVITY
Definition: wait_event.h:21

◆ WaitEventClient

Enumerator
WAIT_EVENT_CLIENT_READ 
WAIT_EVENT_CLIENT_WRITE 
WAIT_EVENT_GSS_OPEN_SERVER 
WAIT_EVENT_LIBPQWALRECEIVER_CONNECT 
WAIT_EVENT_LIBPQWALRECEIVER_RECEIVE 
WAIT_EVENT_SSL_OPEN_SERVER 
WAIT_EVENT_WAL_SENDER_WAIT_WAL 
WAIT_EVENT_WAL_SENDER_WRITE_DATA 

Definition at line 61 of file wait_event.h.

62 {
#define PG_WAIT_CLIENT
Definition: wait_event.h:22
WaitEventClient
Definition: wait_event.h:62
@ WAIT_EVENT_CLIENT_READ
Definition: wait_event.h:63
@ WAIT_EVENT_GSS_OPEN_SERVER
Definition: wait_event.h:65
@ WAIT_EVENT_SSL_OPEN_SERVER
Definition: wait_event.h:68
@ WAIT_EVENT_LIBPQWALRECEIVER_RECEIVE
Definition: wait_event.h:67
@ WAIT_EVENT_LIBPQWALRECEIVER_CONNECT
Definition: wait_event.h:66
@ WAIT_EVENT_WAL_SENDER_WRITE_DATA
Definition: wait_event.h:70
@ WAIT_EVENT_CLIENT_WRITE
Definition: wait_event.h:64
@ WAIT_EVENT_WAL_SENDER_WAIT_WAL
Definition: wait_event.h:69

◆ WaitEventIO

Enumerator
WAIT_EVENT_BASEBACKUP_READ 
WAIT_EVENT_BUFFILE_READ 
WAIT_EVENT_BUFFILE_WRITE 
WAIT_EVENT_BUFFILE_TRUNCATE 
WAIT_EVENT_CONTROL_FILE_READ 
WAIT_EVENT_CONTROL_FILE_SYNC 
WAIT_EVENT_CONTROL_FILE_SYNC_UPDATE 
WAIT_EVENT_CONTROL_FILE_WRITE 
WAIT_EVENT_CONTROL_FILE_WRITE_UPDATE 
WAIT_EVENT_COPY_FILE_READ 
WAIT_EVENT_COPY_FILE_WRITE 
WAIT_EVENT_DATA_FILE_EXTEND 
WAIT_EVENT_DATA_FILE_FLUSH 
WAIT_EVENT_DATA_FILE_IMMEDIATE_SYNC 
WAIT_EVENT_DATA_FILE_PREFETCH 
WAIT_EVENT_DATA_FILE_READ 
WAIT_EVENT_DATA_FILE_SYNC 
WAIT_EVENT_DATA_FILE_TRUNCATE 
WAIT_EVENT_DATA_FILE_WRITE 
WAIT_EVENT_DSM_FILL_ZERO_WRITE 
WAIT_EVENT_LOCK_FILE_ADDTODATADIR_READ 
WAIT_EVENT_LOCK_FILE_ADDTODATADIR_SYNC 
WAIT_EVENT_LOCK_FILE_ADDTODATADIR_WRITE 
WAIT_EVENT_LOCK_FILE_CREATE_READ 
WAIT_EVENT_LOCK_FILE_CREATE_SYNC 
WAIT_EVENT_LOCK_FILE_CREATE_WRITE 
WAIT_EVENT_LOCK_FILE_RECHECKDATADIR_READ 
WAIT_EVENT_LOGICAL_REWRITE_CHECKPOINT_SYNC 
WAIT_EVENT_LOGICAL_REWRITE_MAPPING_SYNC 
WAIT_EVENT_LOGICAL_REWRITE_MAPPING_WRITE 
WAIT_EVENT_LOGICAL_REWRITE_SYNC 
WAIT_EVENT_LOGICAL_REWRITE_TRUNCATE 
WAIT_EVENT_LOGICAL_REWRITE_WRITE 
WAIT_EVENT_RELATION_MAP_READ 
WAIT_EVENT_RELATION_MAP_SYNC 
WAIT_EVENT_RELATION_MAP_WRITE 
WAIT_EVENT_REORDER_BUFFER_READ 
WAIT_EVENT_REORDER_BUFFER_WRITE 
WAIT_EVENT_REORDER_LOGICAL_MAPPING_READ 
WAIT_EVENT_REPLICATION_SLOT_READ 
WAIT_EVENT_REPLICATION_SLOT_RESTORE_SYNC 
WAIT_EVENT_REPLICATION_SLOT_SYNC 
WAIT_EVENT_REPLICATION_SLOT_WRITE 
WAIT_EVENT_SLRU_FLUSH_SYNC 
WAIT_EVENT_SLRU_READ 
WAIT_EVENT_SLRU_SYNC 
WAIT_EVENT_SLRU_WRITE 
WAIT_EVENT_SNAPBUILD_READ 
WAIT_EVENT_SNAPBUILD_SYNC 
WAIT_EVENT_SNAPBUILD_WRITE 
WAIT_EVENT_TIMELINE_HISTORY_FILE_SYNC 
WAIT_EVENT_TIMELINE_HISTORY_FILE_WRITE 
WAIT_EVENT_TIMELINE_HISTORY_READ 
WAIT_EVENT_TIMELINE_HISTORY_SYNC 
WAIT_EVENT_TIMELINE_HISTORY_WRITE 
WAIT_EVENT_TWOPHASE_FILE_READ 
WAIT_EVENT_TWOPHASE_FILE_SYNC 
WAIT_EVENT_TWOPHASE_FILE_WRITE 
WAIT_EVENT_WALSENDER_TIMELINE_HISTORY_READ 
WAIT_EVENT_WAL_BOOTSTRAP_SYNC 
WAIT_EVENT_WAL_BOOTSTRAP_WRITE 
WAIT_EVENT_WAL_COPY_READ 
WAIT_EVENT_WAL_COPY_SYNC 
WAIT_EVENT_WAL_COPY_WRITE 
WAIT_EVENT_WAL_INIT_SYNC 
WAIT_EVENT_WAL_INIT_WRITE 
WAIT_EVENT_WAL_READ 
WAIT_EVENT_WAL_SYNC 
WAIT_EVENT_WAL_SYNC_METHOD_ASSIGN 
WAIT_EVENT_WAL_WRITE 

Definition at line 157 of file wait_event.h.

158 {
229 } WaitEventIO;
WaitEventIO
Definition: wait_event.h:158
@ WAIT_EVENT_LOGICAL_REWRITE_MAPPING_SYNC
Definition: wait_event.h:187
@ WAIT_EVENT_RELATION_MAP_WRITE
Definition: wait_event.h:194
@ WAIT_EVENT_WAL_COPY_SYNC
Definition: wait_event.h:221
@ WAIT_EVENT_LOCK_FILE_ADDTODATADIR_WRITE
Definition: wait_event.h:181
@ WAIT_EVENT_CONTROL_FILE_READ
Definition: wait_event.h:163
@ WAIT_EVENT_DATA_FILE_IMMEDIATE_SYNC
Definition: wait_event.h:172
@ WAIT_EVENT_REORDER_BUFFER_READ
Definition: wait_event.h:195
@ WAIT_EVENT_BUFFILE_WRITE
Definition: wait_event.h:161
@ WAIT_EVENT_RELATION_MAP_READ
Definition: wait_event.h:192
@ WAIT_EVENT_CONTROL_FILE_WRITE_UPDATE
Definition: wait_event.h:167
@ WAIT_EVENT_DATA_FILE_READ
Definition: wait_event.h:174
@ WAIT_EVENT_DATA_FILE_WRITE
Definition: wait_event.h:177
@ WAIT_EVENT_COPY_FILE_READ
Definition: wait_event.h:168
@ WAIT_EVENT_LOCK_FILE_CREATE_SYNC
Definition: wait_event.h:183
@ WAIT_EVENT_TIMELINE_HISTORY_FILE_WRITE
Definition: wait_event.h:210
@ WAIT_EVENT_LOCK_FILE_CREATE_READ
Definition: wait_event.h:182
@ WAIT_EVENT_LOGICAL_REWRITE_WRITE
Definition: wait_event.h:191
@ WAIT_EVENT_BASEBACKUP_READ
Definition: wait_event.h:159
@ WAIT_EVENT_WAL_COPY_WRITE
Definition: wait_event.h:222
@ WAIT_EVENT_RELATION_MAP_SYNC
Definition: wait_event.h:193
@ WAIT_EVENT_DSM_FILL_ZERO_WRITE
Definition: wait_event.h:178
@ WAIT_EVENT_TIMELINE_HISTORY_WRITE
Definition: wait_event.h:213
@ WAIT_EVENT_WAL_COPY_READ
Definition: wait_event.h:220
@ WAIT_EVENT_WAL_SYNC_METHOD_ASSIGN
Definition: wait_event.h:227
@ WAIT_EVENT_REPLICATION_SLOT_READ
Definition: wait_event.h:198
@ WAIT_EVENT_SNAPBUILD_SYNC
Definition: wait_event.h:207
@ WAIT_EVENT_DATA_FILE_FLUSH
Definition: wait_event.h:171
@ WAIT_EVENT_LOCK_FILE_CREATE_WRITE
Definition: wait_event.h:184
@ WAIT_EVENT_LOCK_FILE_RECHECKDATADIR_READ
Definition: wait_event.h:185
@ WAIT_EVENT_DATA_FILE_EXTEND
Definition: wait_event.h:170
@ WAIT_EVENT_WAL_SYNC
Definition: wait_event.h:226
@ WAIT_EVENT_CONTROL_FILE_WRITE
Definition: wait_event.h:166
@ WAIT_EVENT_SLRU_SYNC
Definition: wait_event.h:204
@ WAIT_EVENT_TWOPHASE_FILE_READ
Definition: wait_event.h:214
@ WAIT_EVENT_CONTROL_FILE_SYNC
Definition: wait_event.h:164
@ WAIT_EVENT_TWOPHASE_FILE_WRITE
Definition: wait_event.h:216
@ WAIT_EVENT_SLRU_READ
Definition: wait_event.h:203
@ WAIT_EVENT_BUFFILE_TRUNCATE
Definition: wait_event.h:162
@ WAIT_EVENT_WAL_WRITE
Definition: wait_event.h:228
@ WAIT_EVENT_COPY_FILE_WRITE
Definition: wait_event.h:169
@ WAIT_EVENT_REPLICATION_SLOT_WRITE
Definition: wait_event.h:201
@ WAIT_EVENT_WAL_INIT_SYNC
Definition: wait_event.h:223
@ WAIT_EVENT_REORDER_LOGICAL_MAPPING_READ
Definition: wait_event.h:197
@ WAIT_EVENT_REORDER_BUFFER_WRITE
Definition: wait_event.h:196
@ WAIT_EVENT_TIMELINE_HISTORY_FILE_SYNC
Definition: wait_event.h:209
@ WAIT_EVENT_LOGICAL_REWRITE_MAPPING_WRITE
Definition: wait_event.h:188
@ WAIT_EVENT_CONTROL_FILE_SYNC_UPDATE
Definition: wait_event.h:165
@ WAIT_EVENT_WALSENDER_TIMELINE_HISTORY_READ
Definition: wait_event.h:217
@ WAIT_EVENT_SNAPBUILD_WRITE
Definition: wait_event.h:208
@ WAIT_EVENT_TWOPHASE_FILE_SYNC
Definition: wait_event.h:215
@ WAIT_EVENT_DATA_FILE_TRUNCATE
Definition: wait_event.h:176
@ WAIT_EVENT_SLRU_FLUSH_SYNC
Definition: wait_event.h:202
@ WAIT_EVENT_DATA_FILE_PREFETCH
Definition: wait_event.h:173
@ WAIT_EVENT_TIMELINE_HISTORY_READ
Definition: wait_event.h:211
@ WAIT_EVENT_BUFFILE_READ
Definition: wait_event.h:160
@ WAIT_EVENT_LOCK_FILE_ADDTODATADIR_READ
Definition: wait_event.h:179
@ WAIT_EVENT_TIMELINE_HISTORY_SYNC
Definition: wait_event.h:212
@ WAIT_EVENT_LOCK_FILE_ADDTODATADIR_SYNC
Definition: wait_event.h:180
@ WAIT_EVENT_DATA_FILE_SYNC
Definition: wait_event.h:175
@ WAIT_EVENT_REPLICATION_SLOT_RESTORE_SYNC
Definition: wait_event.h:199
@ WAIT_EVENT_LOGICAL_REWRITE_TRUNCATE
Definition: wait_event.h:190
@ WAIT_EVENT_SLRU_WRITE
Definition: wait_event.h:205
@ WAIT_EVENT_REPLICATION_SLOT_SYNC
Definition: wait_event.h:200
@ WAIT_EVENT_LOGICAL_REWRITE_CHECKPOINT_SYNC
Definition: wait_event.h:186
@ WAIT_EVENT_WAL_INIT_WRITE
Definition: wait_event.h:224
@ WAIT_EVENT_WAL_READ
Definition: wait_event.h:225
@ WAIT_EVENT_SNAPBUILD_READ
Definition: wait_event.h:206
@ WAIT_EVENT_WAL_BOOTSTRAP_SYNC
Definition: wait_event.h:218
@ WAIT_EVENT_LOGICAL_REWRITE_SYNC
Definition: wait_event.h:189
@ WAIT_EVENT_WAL_BOOTSTRAP_WRITE
Definition: wait_event.h:219
#define PG_WAIT_IO
Definition: wait_event.h:26

◆ WaitEventIPC

Enumerator
WAIT_EVENT_APPEND_READY 
WAIT_EVENT_ARCHIVE_CLEANUP_COMMAND 
WAIT_EVENT_ARCHIVE_COMMAND 
WAIT_EVENT_BACKEND_TERMINATION 
WAIT_EVENT_BACKUP_WAIT_WAL_ARCHIVE 
WAIT_EVENT_BGWORKER_SHUTDOWN 
WAIT_EVENT_BGWORKER_STARTUP 
WAIT_EVENT_BTREE_PAGE 
WAIT_EVENT_BUFFER_IO 
WAIT_EVENT_CHECKPOINT_DONE 
WAIT_EVENT_CHECKPOINT_START 
WAIT_EVENT_EXECUTE_GATHER 
WAIT_EVENT_HASH_BATCH_ALLOCATE 
WAIT_EVENT_HASH_BATCH_ELECT 
WAIT_EVENT_HASH_BATCH_LOAD 
WAIT_EVENT_HASH_BUILD_ALLOCATE 
WAIT_EVENT_HASH_BUILD_ELECT 
WAIT_EVENT_HASH_BUILD_HASH_INNER 
WAIT_EVENT_HASH_BUILD_HASH_OUTER 
WAIT_EVENT_HASH_GROW_BATCHES_ALLOCATE 
WAIT_EVENT_HASH_GROW_BATCHES_DECIDE 
WAIT_EVENT_HASH_GROW_BATCHES_ELECT 
WAIT_EVENT_HASH_GROW_BATCHES_FINISH 
WAIT_EVENT_HASH_GROW_BATCHES_REPARTITION 
WAIT_EVENT_HASH_GROW_BUCKETS_ALLOCATE 
WAIT_EVENT_HASH_GROW_BUCKETS_ELECT 
WAIT_EVENT_HASH_GROW_BUCKETS_REINSERT 
WAIT_EVENT_LOGICAL_SYNC_DATA 
WAIT_EVENT_LOGICAL_SYNC_STATE_CHANGE 
WAIT_EVENT_MQ_INTERNAL 
WAIT_EVENT_MQ_PUT_MESSAGE 
WAIT_EVENT_MQ_RECEIVE 
WAIT_EVENT_MQ_SEND 
WAIT_EVENT_PARALLEL_BITMAP_SCAN 
WAIT_EVENT_PARALLEL_CREATE_INDEX_SCAN 
WAIT_EVENT_PARALLEL_FINISH 
WAIT_EVENT_PROCARRAY_GROUP_UPDATE 
WAIT_EVENT_PROC_SIGNAL_BARRIER 
WAIT_EVENT_PROMOTE 
WAIT_EVENT_RECOVERY_CONFLICT_SNAPSHOT 
WAIT_EVENT_RECOVERY_CONFLICT_TABLESPACE 
WAIT_EVENT_RECOVERY_END_COMMAND 
WAIT_EVENT_RECOVERY_PAUSE 
WAIT_EVENT_REPLICATION_ORIGIN_DROP 
WAIT_EVENT_REPLICATION_SLOT_DROP 
WAIT_EVENT_RESTORE_COMMAND 
WAIT_EVENT_SAFE_SNAPSHOT 
WAIT_EVENT_SYNC_REP 
WAIT_EVENT_WAL_RECEIVER_EXIT 
WAIT_EVENT_WAL_RECEIVER_WAIT_START 
WAIT_EVENT_XACT_GROUP_UPDATE 

Definition at line 80 of file wait_event.h.

81 {
133 } WaitEventIPC;
WaitEventIPC
Definition: wait_event.h:81
@ WAIT_EVENT_REPLICATION_ORIGIN_DROP
Definition: wait_event.h:125
@ WAIT_EVENT_HASH_GROW_BUCKETS_ALLOCATE
Definition: wait_event.h:106
@ WAIT_EVENT_CHECKPOINT_START
Definition: wait_event.h:92
@ WAIT_EVENT_PROMOTE
Definition: wait_event.h:120
@ WAIT_EVENT_SAFE_SNAPSHOT
Definition: wait_event.h:128
@ WAIT_EVENT_BACKUP_WAIT_WAL_ARCHIVE
Definition: wait_event.h:86
@ WAIT_EVENT_RESTORE_COMMAND
Definition: wait_event.h:127
@ WAIT_EVENT_PARALLEL_BITMAP_SCAN
Definition: wait_event.h:115
@ WAIT_EVENT_MQ_INTERNAL
Definition: wait_event.h:111
@ WAIT_EVENT_MQ_PUT_MESSAGE
Definition: wait_event.h:112
@ WAIT_EVENT_ARCHIVE_COMMAND
Definition: wait_event.h:84
@ WAIT_EVENT_BUFFER_IO
Definition: wait_event.h:90
@ WAIT_EVENT_SYNC_REP
Definition: wait_event.h:129
@ WAIT_EVENT_PARALLEL_CREATE_INDEX_SCAN
Definition: wait_event.h:116
@ WAIT_EVENT_HASH_GROW_BUCKETS_REINSERT
Definition: wait_event.h:108
@ WAIT_EVENT_BGWORKER_STARTUP
Definition: wait_event.h:88
@ WAIT_EVENT_HASH_BUILD_ELECT
Definition: wait_event.h:98
@ WAIT_EVENT_XACT_GROUP_UPDATE
Definition: wait_event.h:132
@ WAIT_EVENT_MQ_SEND
Definition: wait_event.h:114
@ WAIT_EVENT_HASH_BUILD_HASH_INNER
Definition: wait_event.h:99
@ WAIT_EVENT_HASH_BATCH_LOAD
Definition: wait_event.h:96
@ WAIT_EVENT_LOGICAL_SYNC_STATE_CHANGE
Definition: wait_event.h:110
@ WAIT_EVENT_APPEND_READY
Definition: wait_event.h:82
@ WAIT_EVENT_BTREE_PAGE
Definition: wait_event.h:89
@ WAIT_EVENT_HASH_GROW_BATCHES_DECIDE
Definition: wait_event.h:102
@ WAIT_EVENT_HASH_GROW_BATCHES_ALLOCATE
Definition: wait_event.h:101
@ WAIT_EVENT_PROCARRAY_GROUP_UPDATE
Definition: wait_event.h:118
@ WAIT_EVENT_BACKEND_TERMINATION
Definition: wait_event.h:85
@ WAIT_EVENT_CHECKPOINT_DONE
Definition: wait_event.h:91
@ WAIT_EVENT_RECOVERY_CONFLICT_TABLESPACE
Definition: wait_event.h:122
@ WAIT_EVENT_HASH_GROW_BATCHES_FINISH
Definition: wait_event.h:104
@ WAIT_EVENT_HASH_GROW_BUCKETS_ELECT
Definition: wait_event.h:107
@ WAIT_EVENT_BGWORKER_SHUTDOWN
Definition: wait_event.h:87
@ WAIT_EVENT_REPLICATION_SLOT_DROP
Definition: wait_event.h:126
@ WAIT_EVENT_PARALLEL_FINISH
Definition: wait_event.h:117
@ WAIT_EVENT_ARCHIVE_CLEANUP_COMMAND
Definition: wait_event.h:83
@ WAIT_EVENT_WAL_RECEIVER_WAIT_START
Definition: wait_event.h:131
@ WAIT_EVENT_RECOVERY_CONFLICT_SNAPSHOT
Definition: wait_event.h:121
@ WAIT_EVENT_HASH_BUILD_HASH_OUTER
Definition: wait_event.h:100
@ WAIT_EVENT_WAL_RECEIVER_EXIT
Definition: wait_event.h:130
@ WAIT_EVENT_HASH_BATCH_ALLOCATE
Definition: wait_event.h:94
@ WAIT_EVENT_HASH_GROW_BATCHES_REPARTITION
Definition: wait_event.h:105
@ WAIT_EVENT_HASH_BATCH_ELECT
Definition: wait_event.h:95
@ WAIT_EVENT_PROC_SIGNAL_BARRIER
Definition: wait_event.h:119
@ WAIT_EVENT_RECOVERY_PAUSE
Definition: wait_event.h:124
@ WAIT_EVENT_RECOVERY_END_COMMAND
Definition: wait_event.h:123
@ WAIT_EVENT_LOGICAL_SYNC_DATA
Definition: wait_event.h:109
@ WAIT_EVENT_HASH_BUILD_ALLOCATE
Definition: wait_event.h:97
@ WAIT_EVENT_EXECUTE_GATHER
Definition: wait_event.h:93
@ WAIT_EVENT_HASH_GROW_BATCHES_ELECT
Definition: wait_event.h:103
@ WAIT_EVENT_MQ_RECEIVE
Definition: wait_event.h:113
#define PG_WAIT_IPC
Definition: wait_event.h:24

◆ WaitEventTimeout

Enumerator
WAIT_EVENT_BASE_BACKUP_THROTTLE 
WAIT_EVENT_PG_SLEEP 
WAIT_EVENT_RECOVERY_APPLY_DELAY 
WAIT_EVENT_RECOVERY_RETRIEVE_RETRY_INTERVAL 
WAIT_EVENT_VACUUM_DELAY 
WAIT_EVENT_VACUUM_TRUNCATE 

Definition at line 141 of file wait_event.h.

142 {
#define PG_WAIT_TIMEOUT
Definition: wait_event.h:25
WaitEventTimeout
Definition: wait_event.h:142
@ WAIT_EVENT_VACUUM_TRUNCATE
Definition: wait_event.h:148
@ WAIT_EVENT_BASE_BACKUP_THROTTLE
Definition: wait_event.h:143
@ WAIT_EVENT_PG_SLEEP
Definition: wait_event.h:144
@ WAIT_EVENT_RECOVERY_APPLY_DELAY
Definition: wait_event.h:145
@ WAIT_EVENT_VACUUM_DELAY
Definition: wait_event.h:147
@ WAIT_EVENT_RECOVERY_RETRIEVE_RETRY_INTERVAL
Definition: wait_event.h:146

Function Documentation

◆ pgstat_get_wait_event()

const char* pgstat_get_wait_event ( uint32  wait_event_info)

Definition at line 129 of file wait_event.c.

130 {
131  uint32 classId;
132  uint16 eventId;
133  const char *event_name;
134 
135  /* report process as not waiting. */
136  if (wait_event_info == 0)
137  return NULL;
138 
139  classId = wait_event_info & 0xFF000000;
140  eventId = wait_event_info & 0x0000FFFF;
141 
142  switch (classId)
143  {
144  case PG_WAIT_LWLOCK:
145  event_name = GetLWLockIdentifier(classId, eventId);
146  break;
147  case PG_WAIT_LOCK:
148  event_name = GetLockNameFromTagType(eventId);
149  break;
150  case PG_WAIT_BUFFER_PIN:
151  event_name = "BufferPin";
152  break;
153  case PG_WAIT_ACTIVITY:
154  {
155  WaitEventActivity w = (WaitEventActivity) wait_event_info;
156 
157  event_name = pgstat_get_wait_activity(w);
158  break;
159  }
160  case PG_WAIT_CLIENT:
161  {
162  WaitEventClient w = (WaitEventClient) wait_event_info;
163 
164  event_name = pgstat_get_wait_client(w);
165  break;
166  }
167  case PG_WAIT_EXTENSION:
168  event_name = "Extension";
169  break;
170  case PG_WAIT_IPC:
171  {
172  WaitEventIPC w = (WaitEventIPC) wait_event_info;
173 
174  event_name = pgstat_get_wait_ipc(w);
175  break;
176  }
177  case PG_WAIT_TIMEOUT:
178  {
179  WaitEventTimeout w = (WaitEventTimeout) wait_event_info;
180 
181  event_name = pgstat_get_wait_timeout(w);
182  break;
183  }
184  case PG_WAIT_IO:
185  {
186  WaitEventIO w = (WaitEventIO) wait_event_info;
187 
188  event_name = pgstat_get_wait_io(w);
189  break;
190  }
191  default:
192  event_name = "unknown wait event";
193  break;
194  }
195 
196  return event_name;
197 }
unsigned short uint16
Definition: c.h:440
unsigned int uint32
Definition: c.h:441
const char * GetLockNameFromTagType(uint16 locktag_type)
Definition: lmgr.c:1191
const char * GetLWLockIdentifier(uint32 classId, uint16 eventId)
Definition: lwlock.c:800
static const char * pgstat_get_wait_timeout(WaitEventTimeout w)
Definition: wait_event.c:479
static const char * pgstat_get_wait_activity(WaitEventActivity w)
Definition: wait_event.c:206
static const char * pgstat_get_wait_io(WaitEventIO w)
Definition: wait_event.c:516
static const char * pgstat_get_wait_client(WaitEventClient w)
Definition: wait_event.c:264
static const char * pgstat_get_wait_ipc(WaitEventIPC w)
Definition: wait_event.c:307
#define PG_WAIT_LWLOCK
Definition: wait_event.h:18
#define PG_WAIT_EXTENSION
Definition: wait_event.h:23
#define PG_WAIT_BUFFER_PIN
Definition: wait_event.h:20
#define PG_WAIT_LOCK
Definition: wait_event.h:19

References GetLockNameFromTagType(), GetLWLockIdentifier(), PG_WAIT_ACTIVITY, PG_WAIT_BUFFER_PIN, PG_WAIT_CLIENT, PG_WAIT_EXTENSION, PG_WAIT_IO, PG_WAIT_IPC, PG_WAIT_LOCK, PG_WAIT_LWLOCK, PG_WAIT_TIMEOUT, pgstat_get_wait_activity(), pgstat_get_wait_client(), pgstat_get_wait_io(), pgstat_get_wait_ipc(), and pgstat_get_wait_timeout().

Referenced by pg_stat_get_activity(), and pg_stat_get_backend_wait_event().

◆ pgstat_get_wait_event_type()

const char* pgstat_get_wait_event_type ( uint32  wait_event_info)

Definition at line 74 of file wait_event.c.

75 {
76  uint32 classId;
77  const char *event_type;
78 
79  /* report process as not waiting. */
80  if (wait_event_info == 0)
81  return NULL;
82 
83  classId = wait_event_info & 0xFF000000;
84 
85  switch (classId)
86  {
87  case PG_WAIT_LWLOCK:
88  event_type = "LWLock";
89  break;
90  case PG_WAIT_LOCK:
91  event_type = "Lock";
92  break;
93  case PG_WAIT_BUFFER_PIN:
94  event_type = "BufferPin";
95  break;
96  case PG_WAIT_ACTIVITY:
97  event_type = "Activity";
98  break;
99  case PG_WAIT_CLIENT:
100  event_type = "Client";
101  break;
102  case PG_WAIT_EXTENSION:
103  event_type = "Extension";
104  break;
105  case PG_WAIT_IPC:
106  event_type = "IPC";
107  break;
108  case PG_WAIT_TIMEOUT:
109  event_type = "Timeout";
110  break;
111  case PG_WAIT_IO:
112  event_type = "IO";
113  break;
114  default:
115  event_type = "???";
116  break;
117  }
118 
119  return event_type;
120 }

References PG_WAIT_ACTIVITY, PG_WAIT_BUFFER_PIN, PG_WAIT_CLIENT, PG_WAIT_EXTENSION, PG_WAIT_IO, PG_WAIT_IPC, PG_WAIT_LOCK, PG_WAIT_LWLOCK, and PG_WAIT_TIMEOUT.

Referenced by pg_stat_get_activity(), and pg_stat_get_backend_wait_event_type().

◆ pgstat_report_wait_end()

static void pgstat_report_wait_end ( void  )
inlinestatic

Definition at line 278 of file wait_event.h.

279 {
280  /* see pgstat_report_wait_start() */
281  *(volatile uint32 *) my_wait_event_info = 0;
282 }
PGDLLIMPORT uint32 * my_wait_event_info
Definition: wait_event.c:38

References my_wait_event_info.

Referenced by AbortSubTransaction(), AbortTransaction(), AddToDataDirLockFile(), ApplyLogicalMappingFile(), assign_xlog_sync_method(), AutoVacLauncherMain(), BackgroundWriterMain(), basebackup_read_file(), BootStrapXLOG(), CheckpointerMain(), CheckPointLogicalRewriteHeap(), copy_file(), CreateLockFile(), dsm_impl_mmap(), ExecuteRecoveryCommand(), FilePrefetch(), FileRead(), FileSync(), FileTruncate(), FileWrite(), FileWriteback(), heap_xlog_logical_rewrite(), issue_xlog_fsync(), load_relmap_file(), LWLockReportWaitEnd(), pgarch_archiveXlog(), ProcArrayGroupClearXid(), ReadControlFile(), readTimeLineHistory(), ReadTwoPhaseFile(), RecheckDataDirLockFile(), RecreateTwoPhaseFile(), ReorderBufferSerializeChange(), RestoreArchivedFile(), RestoreSlotFromDisk(), SaveSlotToPath(), SendTimeLineHistory(), ShutdownAuxiliaryProcess(), SlruPhysicalReadPage(), SlruPhysicalWritePage(), SnapBuildRestore(), SnapBuildSerialize(), TransactionGroupUpdateXidStatus(), update_controlfile(), WaitEventSetWait(), WaitExceedsMaxStandbyDelay(), WALRead(), WalSndErrorCleanup(), WalWriterMain(), write_relmap_file(), WriteControlFile(), writeTimeLineHistory(), writeTimeLineHistoryFile(), XLogFileCopy(), XLogFileInitInternal(), XLogPageRead(), and XLogWrite().

◆ pgstat_report_wait_start()

◆ pgstat_reset_wait_event_storage()

void pgstat_reset_wait_event_storage ( void  )

Definition at line 62 of file wait_event.c.

63 {
65 }
static uint32 local_my_wait_event_info
Definition: wait_event.c:37
uint32 * my_wait_event_info
Definition: wait_event.c:38

References local_my_wait_event_info, and my_wait_event_info.

Referenced by AuxiliaryProcKill(), and ProcKill().

◆ pgstat_set_wait_event_storage()

void pgstat_set_wait_event_storage ( uint32 wait_event_info)

Definition at line 50 of file wait_event.c.

51 {
52  my_wait_event_info = wait_event_info;
53 }

References my_wait_event_info.

Referenced by InitAuxiliaryProcess(), and InitProcess().

Variable Documentation

◆ my_wait_event_info