PostgreSQL Source Code  git master
wait_event.c File Reference
#include "postgres.h"
#include "port/pg_bitutils.h"
#include "storage/lmgr.h"
#include "storage/lwlock.h"
#include "storage/spin.h"
#include "utils/wait_event.h"
#include "pgstat_wait_event.c"
Include dependency graph for wait_event.c:

Go to the source code of this file.

Data Structures

struct  WaitEventCustomEntryByInfo
 
struct  WaitEventCustomEntryByName
 
struct  WaitEventCustomCounterData
 

Macros

#define WAIT_EVENT_CLASS_MASK   0xFF000000
 
#define WAIT_EVENT_ID_MASK   0x0000FFFF
 
#define WAIT_EVENT_CUSTOM_HASH_INIT_SIZE   16
 
#define WAIT_EVENT_CUSTOM_HASH_MAX_SIZE   128
 
#define WAIT_EVENT_CUSTOM_INITIAL_ID   1
 

Typedefs

typedef struct WaitEventCustomEntryByInfo WaitEventCustomEntryByInfo
 
typedef struct WaitEventCustomEntryByName WaitEventCustomEntryByName
 
typedef struct WaitEventCustomCounterData WaitEventCustomCounterData
 

Functions

static const char * pgstat_get_wait_activity (WaitEventActivity w)
 
static const char * pgstat_get_wait_bufferpin (WaitEventBufferPin w)
 
static const char * pgstat_get_wait_client (WaitEventClient w)
 
static const char * pgstat_get_wait_ipc (WaitEventIPC w)
 
static const char * pgstat_get_wait_timeout (WaitEventTimeout w)
 
static const char * pgstat_get_wait_io (WaitEventIO w)
 
static uint32 WaitEventCustomNew (uint32 classId, const char *wait_event_name)
 
static const char * GetWaitEventCustomIdentifier (uint32 wait_event_info)
 
Size WaitEventCustomShmemSize (void)
 
void WaitEventCustomShmemInit (void)
 
uint32 WaitEventExtensionNew (const char *wait_event_name)
 
uint32 WaitEventInjectionPointNew (const char *wait_event_name)
 
char ** GetWaitEventCustomNames (uint32 classId, int *nwaitevents)
 
void pgstat_set_wait_event_storage (uint32 *wait_event_info)
 
void pgstat_reset_wait_event_storage (void)
 
const char * pgstat_get_wait_event_type (uint32 wait_event_info)
 
const char * pgstat_get_wait_event (uint32 wait_event_info)
 

Variables

static uint32 local_my_wait_event_info
 
uint32my_wait_event_info = &local_my_wait_event_info
 
static HTABWaitEventCustomHashByInfo
 
static HTABWaitEventCustomHashByName
 
static WaitEventCustomCounterDataWaitEventCustomCounter
 

Macro Definition Documentation

◆ WAIT_EVENT_CLASS_MASK

#define WAIT_EVENT_CLASS_MASK   0xFF000000

Definition at line 43 of file wait_event.c.

◆ WAIT_EVENT_CUSTOM_HASH_INIT_SIZE

#define WAIT_EVENT_CUSTOM_HASH_INIT_SIZE   16

Definition at line 67 of file wait_event.c.

◆ WAIT_EVENT_CUSTOM_HASH_MAX_SIZE

#define WAIT_EVENT_CUSTOM_HASH_MAX_SIZE   128

Definition at line 68 of file wait_event.c.

◆ WAIT_EVENT_CUSTOM_INITIAL_ID

#define WAIT_EVENT_CUSTOM_INITIAL_ID   1

Definition at line 95 of file wait_event.c.

◆ WAIT_EVENT_ID_MASK

#define WAIT_EVENT_ID_MASK   0x0000FFFF

Definition at line 44 of file wait_event.c.

Typedef Documentation

◆ WaitEventCustomCounterData

◆ WaitEventCustomEntryByInfo

◆ WaitEventCustomEntryByName

Function Documentation

◆ GetWaitEventCustomIdentifier()

static const char * GetWaitEventCustomIdentifier ( uint32  wait_event_info)
static

Definition at line 277 of file wait_event.c.

278 {
279  bool found;
281 
282  /* Built-in event? */
283  if (wait_event_info == PG_WAIT_EXTENSION)
284  return "Extension";
285 
286  /* It is a user-defined wait event, so lookup hash table. */
287  LWLockAcquire(WaitEventCustomLock, LW_SHARED);
288  entry = (WaitEventCustomEntryByInfo *)
289  hash_search(WaitEventCustomHashByInfo, &wait_event_info,
290  HASH_FIND, &found);
291  LWLockRelease(WaitEventCustomLock);
292 
293  if (!entry)
294  elog(ERROR,
295  "could not find custom name for wait event information %u",
296  wait_event_info);
297 
298  return entry->wait_event_name;
299 }
void * hash_search(HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr)
Definition: dynahash.c:955
#define ERROR
Definition: elog.h:39
#define elog(elevel,...)
Definition: elog.h:224
@ HASH_FIND
Definition: hsearch.h:113
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
Definition: lwlock.c:1168
void LWLockRelease(LWLock *lock)
Definition: lwlock.c:1781
@ LW_SHARED
Definition: lwlock.h:115
char wait_event_name[NAMEDATALEN]
Definition: wait_event.c:74
static HTAB * WaitEventCustomHashByInfo
Definition: wait_event.c:64
#define PG_WAIT_EXTENSION
Definition: wait_event.h:23

References elog, ERROR, HASH_FIND, hash_search(), LW_SHARED, LWLockAcquire(), LWLockRelease(), PG_WAIT_EXTENSION, WaitEventCustomEntryByInfo::wait_event_name, and WaitEventCustomHashByInfo.

Referenced by pgstat_get_wait_event().

◆ GetWaitEventCustomNames()

char** GetWaitEventCustomNames ( uint32  classId,
int *  nwaitevents 
)

Definition at line 307 of file wait_event.c.

308 {
309  char **waiteventnames;
311  HASH_SEQ_STATUS hash_seq;
312  int index;
313  int els;
314 
315  LWLockAcquire(WaitEventCustomLock, LW_SHARED);
316 
317  /* Now we can safely count the number of entries */
319 
320  /* Allocate enough space for all entries */
321  waiteventnames = palloc(els * sizeof(char *));
322 
323  /* Now scan the hash table to copy the data */
325 
326  index = 0;
327  while ((hentry = (WaitEventCustomEntryByName *) hash_seq_search(&hash_seq)) != NULL)
328  {
329  if ((hentry->wait_event_info & WAIT_EVENT_CLASS_MASK) != classId)
330  continue;
331  waiteventnames[index] = pstrdup(hentry->wait_event_name);
332  index++;
333  }
334 
335  LWLockRelease(WaitEventCustomLock);
336 
337  *nwaitevents = index;
338  return waiteventnames;
339 }
long hash_get_num_entries(HTAB *hashp)
Definition: dynahash.c:1341
void * hash_seq_search(HASH_SEQ_STATUS *status)
Definition: dynahash.c:1395
void hash_seq_init(HASH_SEQ_STATUS *status, HTAB *hashp)
Definition: dynahash.c:1385
char * pstrdup(const char *in)
Definition: mcxt.c:1696
void * palloc(Size size)
Definition: mcxt.c:1317
char wait_event_name[NAMEDATALEN]
Definition: wait_event.c:79
Definition: type.h:95
static HTAB * WaitEventCustomHashByName
Definition: wait_event.c:65
#define WAIT_EVENT_CLASS_MASK
Definition: wait_event.c:43

References hash_get_num_entries(), hash_seq_init(), hash_seq_search(), LW_SHARED, LWLockAcquire(), LWLockRelease(), palloc(), pstrdup(), WAIT_EVENT_CLASS_MASK, WaitEventCustomEntryByName::wait_event_info, WaitEventCustomEntryByName::wait_event_name, and WaitEventCustomHashByName.

Referenced by pg_get_wait_events().

◆ pgstat_get_wait_activity()

static const char* pgstat_get_wait_activity ( WaitEventActivity  w)
static

Referenced by pgstat_get_wait_event().

◆ pgstat_get_wait_bufferpin()

static const char* pgstat_get_wait_bufferpin ( WaitEventBufferPin  w)
static

Referenced by pgstat_get_wait_event().

◆ pgstat_get_wait_client()

static const char* pgstat_get_wait_client ( WaitEventClient  w)
static

Referenced by pgstat_get_wait_event().

◆ pgstat_get_wait_event()

const char* pgstat_get_wait_event ( uint32  wait_event_info)

Definition at line 432 of file wait_event.c.

433 {
434  uint32 classId;
435  uint16 eventId;
436  const char *event_name;
437 
438  /* report process as not waiting. */
439  if (wait_event_info == 0)
440  return NULL;
441 
442  classId = wait_event_info & WAIT_EVENT_CLASS_MASK;
443  eventId = wait_event_info & WAIT_EVENT_ID_MASK;
444 
445  switch (classId)
446  {
447  case PG_WAIT_LWLOCK:
448  event_name = GetLWLockIdentifier(classId, eventId);
449  break;
450  case PG_WAIT_LOCK:
451  event_name = GetLockNameFromTagType(eventId);
452  break;
453  case PG_WAIT_EXTENSION:
455  event_name = GetWaitEventCustomIdentifier(wait_event_info);
456  break;
457  case PG_WAIT_BUFFERPIN:
458  {
459  WaitEventBufferPin w = (WaitEventBufferPin) wait_event_info;
460 
461  event_name = pgstat_get_wait_bufferpin(w);
462  break;
463  }
464  case PG_WAIT_ACTIVITY:
465  {
466  WaitEventActivity w = (WaitEventActivity) wait_event_info;
467 
468  event_name = pgstat_get_wait_activity(w);
469  break;
470  }
471  case PG_WAIT_CLIENT:
472  {
473  WaitEventClient w = (WaitEventClient) wait_event_info;
474 
475  event_name = pgstat_get_wait_client(w);
476  break;
477  }
478  case PG_WAIT_IPC:
479  {
480  WaitEventIPC w = (WaitEventIPC) wait_event_info;
481 
482  event_name = pgstat_get_wait_ipc(w);
483  break;
484  }
485  case PG_WAIT_TIMEOUT:
486  {
487  WaitEventTimeout w = (WaitEventTimeout) wait_event_info;
488 
489  event_name = pgstat_get_wait_timeout(w);
490  break;
491  }
492  case PG_WAIT_IO:
493  {
494  WaitEventIO w = (WaitEventIO) wait_event_info;
495 
496  event_name = pgstat_get_wait_io(w);
497  break;
498  }
499  default:
500  event_name = "unknown wait event";
501  break;
502  }
503 
504  return event_name;
505 }
unsigned short uint16
Definition: c.h:505
unsigned int uint32
Definition: c.h:506
const char * GetLockNameFromTagType(uint16 locktag_type)
Definition: lmgr.c:1330
const char * GetLWLockIdentifier(uint32 classId, uint16 eventId)
Definition: lwlock.c:767
static const char * pgstat_get_wait_ipc(WaitEventIPC w)
static const char * pgstat_get_wait_io(WaitEventIO w)
static const char * pgstat_get_wait_bufferpin(WaitEventBufferPin w)
static const char * GetWaitEventCustomIdentifier(uint32 wait_event_info)
Definition: wait_event.c:277
static const char * pgstat_get_wait_timeout(WaitEventTimeout w)
static const char * pgstat_get_wait_client(WaitEventClient w)
#define WAIT_EVENT_ID_MASK
Definition: wait_event.c:44
static const char * pgstat_get_wait_activity(WaitEventActivity w)
#define PG_WAIT_TIMEOUT
Definition: wait_event.h:25
#define PG_WAIT_INJECTIONPOINT
Definition: wait_event.h:27
#define PG_WAIT_LWLOCK
Definition: wait_event.h:18
#define PG_WAIT_BUFFERPIN
Definition: wait_event.h:20
#define PG_WAIT_IPC
Definition: wait_event.h:24
#define PG_WAIT_CLIENT
Definition: wait_event.h:22
#define PG_WAIT_ACTIVITY
Definition: wait_event.h:21
#define PG_WAIT_LOCK
Definition: wait_event.h:19
#define PG_WAIT_IO
Definition: wait_event.h:26

References GetLockNameFromTagType(), GetLWLockIdentifier(), GetWaitEventCustomIdentifier(), PG_WAIT_ACTIVITY, PG_WAIT_BUFFERPIN, PG_WAIT_CLIENT, PG_WAIT_EXTENSION, PG_WAIT_INJECTIONPOINT, PG_WAIT_IO, PG_WAIT_IPC, PG_WAIT_LOCK, PG_WAIT_LWLOCK, PG_WAIT_TIMEOUT, pgstat_get_wait_activity(), pgstat_get_wait_bufferpin(), pgstat_get_wait_client(), pgstat_get_wait_io(), pgstat_get_wait_ipc(), pgstat_get_wait_timeout(), WAIT_EVENT_CLASS_MASK, and WAIT_EVENT_ID_MASK.

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 374 of file wait_event.c.

375 {
376  uint32 classId;
377  const char *event_type;
378 
379  /* report process as not waiting. */
380  if (wait_event_info == 0)
381  return NULL;
382 
383  classId = wait_event_info & WAIT_EVENT_CLASS_MASK;
384 
385  switch (classId)
386  {
387  case PG_WAIT_LWLOCK:
388  event_type = "LWLock";
389  break;
390  case PG_WAIT_LOCK:
391  event_type = "Lock";
392  break;
393  case PG_WAIT_BUFFERPIN:
394  event_type = "BufferPin";
395  break;
396  case PG_WAIT_ACTIVITY:
397  event_type = "Activity";
398  break;
399  case PG_WAIT_CLIENT:
400  event_type = "Client";
401  break;
402  case PG_WAIT_EXTENSION:
403  event_type = "Extension";
404  break;
405  case PG_WAIT_IPC:
406  event_type = "IPC";
407  break;
408  case PG_WAIT_TIMEOUT:
409  event_type = "Timeout";
410  break;
411  case PG_WAIT_IO:
412  event_type = "IO";
413  break;
415  event_type = "InjectionPoint";
416  break;
417  default:
418  event_type = "???";
419  break;
420  }
421 
422  return event_type;
423 }

References PG_WAIT_ACTIVITY, PG_WAIT_BUFFERPIN, PG_WAIT_CLIENT, PG_WAIT_EXTENSION, PG_WAIT_INJECTIONPOINT, PG_WAIT_IO, PG_WAIT_IPC, PG_WAIT_LOCK, PG_WAIT_LWLOCK, PG_WAIT_TIMEOUT, and WAIT_EVENT_CLASS_MASK.

Referenced by pg_isolation_test_session_is_blocked(), pg_stat_get_activity(), pg_stat_get_backend_wait_event_type(), and WaitEventCustomNew().

◆ pgstat_get_wait_io()

static const char* pgstat_get_wait_io ( WaitEventIO  w)
static

Referenced by pgstat_get_wait_event().

◆ pgstat_get_wait_ipc()

static const char* pgstat_get_wait_ipc ( WaitEventIPC  w)
static

Referenced by pgstat_get_wait_event().

◆ pgstat_get_wait_timeout()

static const char* pgstat_get_wait_timeout ( WaitEventTimeout  w)
static

Referenced by pgstat_get_wait_event().

◆ pgstat_reset_wait_event_storage()

void pgstat_reset_wait_event_storage ( void  )

Definition at line 362 of file wait_event.c.

363 {
365 }
static uint32 local_my_wait_event_info
Definition: wait_event.c:40
uint32 * my_wait_event_info
Definition: wait_event.c:41

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 350 of file wait_event.c.

351 {
352  my_wait_event_info = wait_event_info;
353 }

References my_wait_event_info.

Referenced by InitAuxiliaryProcess(), and InitProcess().

◆ WaitEventCustomNew()

static uint32 WaitEventCustomNew ( uint32  classId,
const char *  wait_event_name 
)
static

Definition at line 176 of file wait_event.c.

177 {
178  uint16 eventId;
179  bool found;
180  WaitEventCustomEntryByName *entry_by_name;
181  WaitEventCustomEntryByInfo *entry_by_info;
182  uint32 wait_event_info;
183 
184  /* Check the limit of the length of the event name */
185  if (strlen(wait_event_name) >= NAMEDATALEN)
186  elog(ERROR,
187  "cannot use custom wait event string longer than %u characters",
188  NAMEDATALEN - 1);
189 
190  /*
191  * Check if the wait event info associated to the name is already defined,
192  * and return it if so.
193  */
194  LWLockAcquire(WaitEventCustomLock, LW_SHARED);
195  entry_by_name = (WaitEventCustomEntryByName *)
196  hash_search(WaitEventCustomHashByName, wait_event_name,
197  HASH_FIND, &found);
198  LWLockRelease(WaitEventCustomLock);
199  if (found)
200  {
201  uint32 oldClassId;
202 
203  oldClassId = entry_by_name->wait_event_info & WAIT_EVENT_CLASS_MASK;
204  if (oldClassId != classId)
205  ereport(ERROR,
207  errmsg("wait event \"%s\" already exists in type \"%s\"",
208  wait_event_name,
209  pgstat_get_wait_event_type(entry_by_name->wait_event_info))));
210  return entry_by_name->wait_event_info;
211  }
212 
213  /*
214  * Allocate and register a new wait event. Recheck if the event name
215  * exists, as it could be possible that a concurrent process has inserted
216  * one with the same name since the LWLock acquired again here was
217  * previously released.
218  */
219  LWLockAcquire(WaitEventCustomLock, LW_EXCLUSIVE);
220  entry_by_name = (WaitEventCustomEntryByName *)
221  hash_search(WaitEventCustomHashByName, wait_event_name,
222  HASH_FIND, &found);
223  if (found)
224  {
225  uint32 oldClassId;
226 
227  LWLockRelease(WaitEventCustomLock);
228  oldClassId = entry_by_name->wait_event_info & WAIT_EVENT_CLASS_MASK;
229  if (oldClassId != classId)
230  ereport(ERROR,
232  errmsg("wait event \"%s\" already exists in type \"%s\"",
233  wait_event_name,
234  pgstat_get_wait_event_type(entry_by_name->wait_event_info))));
235  return entry_by_name->wait_event_info;
236  }
237 
238  /* Allocate a new event Id */
240 
242  {
244  ereport(ERROR,
245  errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
246  errmsg("too many custom wait events"));
247  }
248 
249  eventId = WaitEventCustomCounter->nextId++;
250 
252 
253  /* Register the new wait event */
254  wait_event_info = classId | eventId;
255  entry_by_info = (WaitEventCustomEntryByInfo *)
256  hash_search(WaitEventCustomHashByInfo, &wait_event_info,
257  HASH_ENTER, &found);
258  Assert(!found);
259  strlcpy(entry_by_info->wait_event_name, wait_event_name,
260  sizeof(entry_by_info->wait_event_name));
261 
262  entry_by_name = (WaitEventCustomEntryByName *)
263  hash_search(WaitEventCustomHashByName, wait_event_name,
264  HASH_ENTER, &found);
265  Assert(!found);
266  entry_by_name->wait_event_info = wait_event_info;
267 
268  LWLockRelease(WaitEventCustomLock);
269 
270  return wait_event_info;
271 }
#define Assert(condition)
Definition: c.h:858
int errcode(int sqlerrcode)
Definition: elog.c:853
int errmsg(const char *fmt,...)
Definition: elog.c:1070
#define ereport(elevel,...)
Definition: elog.h:149
@ HASH_ENTER
Definition: hsearch.h:114
@ LW_EXCLUSIVE
Definition: lwlock.h:114
#define NAMEDATALEN
size_t strlcpy(char *dst, const char *src, size_t siz)
Definition: strlcpy.c:45
#define SpinLockRelease(lock)
Definition: spin.h:64
#define SpinLockAcquire(lock)
Definition: spin.h:62
#define ERRCODE_DUPLICATE_OBJECT
Definition: streamutil.c:32
#define WAIT_EVENT_CUSTOM_HASH_MAX_SIZE
Definition: wait_event.c:68
static WaitEventCustomCounterData * WaitEventCustomCounter
Definition: wait_event.c:92
const char * pgstat_get_wait_event_type(uint32 wait_event_info)
Definition: wait_event.c:374

References Assert, elog, ereport, errcode(), ERRCODE_DUPLICATE_OBJECT, errmsg(), ERROR, HASH_ENTER, HASH_FIND, hash_search(), LW_EXCLUSIVE, LW_SHARED, LWLockAcquire(), LWLockRelease(), WaitEventCustomCounterData::mutex, NAMEDATALEN, WaitEventCustomCounterData::nextId, pgstat_get_wait_event_type(), SpinLockAcquire, SpinLockRelease, strlcpy(), WAIT_EVENT_CLASS_MASK, WAIT_EVENT_CUSTOM_HASH_MAX_SIZE, WaitEventCustomEntryByName::wait_event_info, WaitEventCustomEntryByInfo::wait_event_name, WaitEventCustomCounter, WaitEventCustomHashByInfo, and WaitEventCustomHashByName.

Referenced by WaitEventExtensionNew(), and WaitEventInjectionPointNew().

◆ WaitEventCustomShmemInit()

void WaitEventCustomShmemInit ( void  )

Definition at line 120 of file wait_event.c.

121 {
122  bool found;
123  HASHCTL info;
124 
126  ShmemInitStruct("WaitEventCustomCounterData",
127  sizeof(WaitEventCustomCounterData), &found);
128 
129  if (!found)
130  {
131  /* initialize the allocation counter and its spinlock. */
134  }
135 
136  /* initialize or attach the hash tables to store custom wait events */
137  info.keysize = sizeof(uint32);
138  info.entrysize = sizeof(WaitEventCustomEntryByInfo);
140  ShmemInitHash("WaitEventCustom hash by wait event information",
143  &info,
145 
146  /* key is a NULL-terminated string */
147  info.keysize = sizeof(char[NAMEDATALEN]);
148  info.entrysize = sizeof(WaitEventCustomEntryByName);
150  ShmemInitHash("WaitEventCustom hash by name",
153  &info,
155 }
#define HASH_STRINGS
Definition: hsearch.h:96
#define HASH_ELEM
Definition: hsearch.h:95
#define HASH_BLOBS
Definition: hsearch.h:97
void * ShmemInitStruct(const char *name, Size size, bool *foundPtr)
Definition: shmem.c:387
HTAB * ShmemInitHash(const char *name, long init_size, long max_size, HASHCTL *infoP, int hash_flags)
Definition: shmem.c:332
#define SpinLockInit(lock)
Definition: spin.h:60
Size keysize
Definition: hsearch.h:75
Size entrysize
Definition: hsearch.h:76
struct WaitEventCustomEntryByName WaitEventCustomEntryByName
#define WAIT_EVENT_CUSTOM_HASH_INIT_SIZE
Definition: wait_event.c:67
struct WaitEventCustomEntryByInfo WaitEventCustomEntryByInfo
#define WAIT_EVENT_CUSTOM_INITIAL_ID
Definition: wait_event.c:95

References HASHCTL::entrysize, HASH_BLOBS, HASH_ELEM, HASH_STRINGS, HASHCTL::keysize, WaitEventCustomCounterData::mutex, NAMEDATALEN, WaitEventCustomCounterData::nextId, ShmemInitHash(), ShmemInitStruct(), SpinLockInit, WAIT_EVENT_CUSTOM_HASH_INIT_SIZE, WAIT_EVENT_CUSTOM_HASH_MAX_SIZE, WAIT_EVENT_CUSTOM_INITIAL_ID, WaitEventCustomCounter, WaitEventCustomHashByInfo, and WaitEventCustomHashByName.

Referenced by CreateOrAttachShmemStructs().

◆ WaitEventCustomShmemSize()

Size WaitEventCustomShmemSize ( void  )

Definition at line 104 of file wait_event.c.

105 {
106  Size sz;
107 
108  sz = MAXALIGN(sizeof(WaitEventCustomCounterData));
110  sizeof(WaitEventCustomEntryByInfo)));
112  sizeof(WaitEventCustomEntryByName)));
113  return sz;
114 }
#define MAXALIGN(LEN)
Definition: c.h:811
size_t Size
Definition: c.h:605
Size hash_estimate_size(long num_entries, Size entrysize)
Definition: dynahash.c:783
Size add_size(Size s1, Size s2)
Definition: shmem.c:493

References add_size(), hash_estimate_size(), MAXALIGN, and WAIT_EVENT_CUSTOM_HASH_MAX_SIZE.

Referenced by CalculateShmemSize().

◆ WaitEventExtensionNew()

uint32 WaitEventExtensionNew ( const char *  wait_event_name)

Definition at line 164 of file wait_event.c.

165 {
166  return WaitEventCustomNew(PG_WAIT_EXTENSION, wait_event_name);
167 }
static uint32 WaitEventCustomNew(uint32 classId, const char *wait_event_name)
Definition: wait_event.c:176

References PG_WAIT_EXTENSION, and WaitEventCustomNew().

Referenced by connect_pg_server(), dblink_connect(), dblink_get_conn(), dblink_init(), GetConnection(), pgfdw_get_cleanup_result(), test_shm_mq_pipelined(), wait_for_workers_to_become_ready(), and worker_spi_main().

◆ WaitEventInjectionPointNew()

uint32 WaitEventInjectionPointNew ( const char *  wait_event_name)

Definition at line 170 of file wait_event.c.

171 {
172  return WaitEventCustomNew(PG_WAIT_INJECTIONPOINT, wait_event_name);
173 }

References PG_WAIT_INJECTIONPOINT, and WaitEventCustomNew().

Referenced by injection_wait().

Variable Documentation

◆ local_my_wait_event_info

uint32 local_my_wait_event_info
static

Definition at line 40 of file wait_event.c.

Referenced by pgstat_reset_wait_event_storage().

◆ my_wait_event_info

◆ WaitEventCustomCounter

WaitEventCustomCounterData* WaitEventCustomCounter
static

Definition at line 92 of file wait_event.c.

Referenced by WaitEventCustomNew(), and WaitEventCustomShmemInit().

◆ WaitEventCustomHashByInfo

HTAB* WaitEventCustomHashByInfo
static

◆ WaitEventCustomHashByName

HTAB* WaitEventCustomHashByName
static