summaryrefslogtreecommitdiff
path: root/src/include/utils/wait_event.h
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2024-06-27 19:21:05 -0700
committerNoah Misch <noah@leadboat.com>2024-06-27 19:21:05 -0700
commitbb93640a681c2cc709e9836e169c8f3eb556df57 (patch)
treebdd9c37008aa9d200cfbfd264ee3b24794f5aa1a /src/include/utils/wait_event.h
parent0844b3968985447ed0a6937cfc8639e379da2fe6 (diff)
Add wait event type "InjectionPoint", a custom type like "Extension".
Both injection points and customization of type "Extension" are new in v17, so this just changes a detail of an unreleased feature. Reported by Robert Haas. Reviewed by Michael Paquier. Discussion: https://postgr.es/m/CA+TgmobfMU5pdXP36D5iAwxV5WKE_vuDLtp_1QyH+H5jMMt21g@mail.gmail.com
Diffstat (limited to 'src/include/utils/wait_event.h')
-rw-r--r--src/include/utils/wait_event.h27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/include/utils/wait_event.h b/src/include/utils/wait_event.h
index 1b735d4a0e7..9f18a753d47 100644
--- a/src/include/utils/wait_event.h
+++ b/src/include/utils/wait_event.h
@@ -24,6 +24,7 @@
#define PG_WAIT_IPC 0x08000000U
#define PG_WAIT_TIMEOUT 0x09000000U
#define PG_WAIT_IO 0x0A000000U
+#define PG_WAIT_INJECTIONPOINT 0x0B000000U
/* enums for wait events */
#include "utils/wait_event_types.h"
@@ -38,26 +39,28 @@ extern void pgstat_reset_wait_event_storage(void);
extern PGDLLIMPORT uint32 *my_wait_event_info;
-/* ----------
- * Wait Events - Extension
+/*
+ * Wait Events - Extension, InjectionPoint
*
- * Use this category when the server process is waiting for some condition
- * defined by an extension module.
+ * Use InjectionPoint when the server process is waiting in an injection
+ * point. Use Extension for other cases of the server process waiting for
+ * some condition defined by an extension module.
*
- * Extensions can define their own wait events in this category. They should
- * call WaitEventExtensionNew() with a wait event string. If the wait event
- * associated to a string is already allocated, it returns the wait event
- * information to use. If not, it gets one wait event ID allocated from
+ * Extensions can define their own wait events in these categories. They
+ * should call one of these functions with a wait event string. If the wait
+ * event associated to a string is already allocated, it returns the wait
+ * event information to use. If not, it gets one wait event ID allocated from
* a shared counter, associates the string to the ID in the shared dynamic
* hash and returns the wait event information.
*
* The ID retrieved can be used with pgstat_report_wait_start() or equivalent.
*/
-extern void WaitEventExtensionShmemInit(void);
-extern Size WaitEventExtensionShmemSize(void);
-
extern uint32 WaitEventExtensionNew(const char *wait_event_name);
-extern char **GetWaitEventExtensionNames(int *nwaitevents);
+extern uint32 WaitEventInjectionPointNew(const char *wait_event_name);
+
+extern void WaitEventCustomShmemInit(void);
+extern Size WaitEventCustomShmemSize(void);
+extern char **GetWaitEventCustomNames(uint32 classId, int *nwaitevents);
/* ----------
* pgstat_report_wait_start() -