From 2aeaf80e578ed48af88d54caf2ffcf7ca62617e8 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Mon, 3 Jul 2023 11:01:02 +0900 Subject: Refactor some code related to wait events "BufferPin" and "Extension" The following changes are done: - Addition of WaitEventBufferPin and WaitEventExtension, that hold a list of wait events related to each category. - Addition of two functions that encapsulate the list of wait events for each category. - Rename BUFFER_PIN to BUFFERPIN (only this wait event class used an underscore, requiring a specific rule in the automation script). These changes make a bit easier the automatic generation of all the code and documentation related to wait events, as all the wait event categories are now controlled by consistent structures and functions. Author: Bertrand Drouvot Discussion: https://postgr.es/m/c6f35117-4b20-4c78-1df5-d3056010dcf5@gmail.com Discussion: https://postgr.es/m/77a86b3a-c4a8-5f5d-69b9-d70bbf2e9b98@gmail.com --- src/include/utils/wait_event.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/include') diff --git a/src/include/utils/wait_event.h b/src/include/utils/wait_event.h index 518d3b0a1f7..dc01d4e84df 100644 --- a/src/include/utils/wait_event.h +++ b/src/include/utils/wait_event.h @@ -17,7 +17,7 @@ */ #define PG_WAIT_LWLOCK 0x01000000U #define PG_WAIT_LOCK 0x03000000U -#define PG_WAIT_BUFFER_PIN 0x04000000U +#define PG_WAIT_BUFFERPIN 0x04000000U #define PG_WAIT_ACTIVITY 0x05000000U #define PG_WAIT_CLIENT 0x06000000U #define PG_WAIT_EXTENSION 0x07000000U @@ -50,6 +50,15 @@ typedef enum WAIT_EVENT_WAL_WRITER_MAIN } WaitEventActivity; +/* ---------- + * Wait Events - BUFFERPIN + * ---------- + */ +typedef enum +{ + WAIT_EVENT_BUFFER_PIN = PG_WAIT_BUFFERPIN +} WaitEventBufferPin; + /* ---------- * Wait Events - Client * @@ -70,6 +79,15 @@ typedef enum WAIT_EVENT_WAL_SENDER_WRITE_DATA, } WaitEventClient; +/* ---------- + * Wait Events - EXTENSION + * ---------- + */ +typedef enum +{ + WAIT_EVENT_EXTENSION = PG_WAIT_EXTENSION +} WaitEventExtension; + /* ---------- * Wait Events - IPC * -- cgit v1.2.3