PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "miscadmin.h"
#include "port/pg_bitutils.h"
#include "storage/lmgr.h"
#include "storage/lwlock.h"
#include "storage/spin.h"
#include "utils/memutils.h"
#include "utils/wait_event.h"
#include "pgstat_wait_event.c"
Go to the source code of this file.
Data Structures | |
struct | WaitEventExtensionEntryById |
struct | WaitEventExtensionEntryByName |
struct | WaitEventExtensionCounterData |
Macros | |
#define | WAIT_EVENT_CLASS_MASK 0xFF000000 |
#define | WAIT_EVENT_ID_MASK 0x0000FFFF |
#define | WAIT_EVENT_EXTENSION_HASH_INIT_SIZE 16 |
#define | WAIT_EVENT_EXTENSION_HASH_MAX_SIZE 128 |
#define | NUM_BUILTIN_WAIT_EVENT_EXTENSION (WAIT_EVENT_EXTENSION_FIRST_USER_DEFINED - WAIT_EVENT_EXTENSION) |
#define | WAIT_EVENT_EXTENSION_INFO(eventId) (PG_WAIT_EXTENSION | eventId) |
Typedefs | |
typedef struct WaitEventExtensionEntryById | WaitEventExtensionEntryById |
typedef struct WaitEventExtensionEntryByName | WaitEventExtensionEntryByName |
typedef struct WaitEventExtensionCounterData | WaitEventExtensionCounterData |
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 const char * | GetWaitEventExtensionIdentifier (uint16 eventId) |
Size | WaitEventExtensionShmemSize (void) |
void | WaitEventExtensionShmemInit (void) |
uint32 | WaitEventExtensionNew (const char *wait_event_name) |
char ** | GetWaitEventExtensionNames (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 |
uint32 * | my_wait_event_info = &local_my_wait_event_info |
static HTAB * | WaitEventExtensionHashById |
static HTAB * | WaitEventExtensionHashByName |
static WaitEventExtensionCounterData * | WaitEventExtensionCounter |
#define NUM_BUILTIN_WAIT_EVENT_EXTENSION (WAIT_EVENT_EXTENSION_FIRST_USER_DEFINED - WAIT_EVENT_EXTENSION) |
Definition at line 94 of file wait_event.c.
#define WAIT_EVENT_CLASS_MASK 0xFF000000 |
Definition at line 45 of file wait_event.c.
#define WAIT_EVENT_EXTENSION_HASH_INIT_SIZE 16 |
Definition at line 66 of file wait_event.c.
#define WAIT_EVENT_EXTENSION_HASH_MAX_SIZE 128 |
Definition at line 67 of file wait_event.c.
#define WAIT_EVENT_EXTENSION_INFO | ( | eventId | ) | (PG_WAIT_EXTENSION | eventId) |
Definition at line 98 of file wait_event.c.
#define WAIT_EVENT_ID_MASK 0x0000FFFF |
Definition at line 46 of file wait_event.c.
typedef struct WaitEventExtensionCounterData WaitEventExtensionCounterData |
typedef struct WaitEventExtensionEntryById WaitEventExtensionEntryById |
typedef struct WaitEventExtensionEntryByName WaitEventExtensionEntryByName |
|
static |
Definition at line 243 of file wait_event.c.
References elog(), ERROR, HASH_FIND, hash_search(), LW_SHARED, LWLockAcquire(), LWLockRelease(), NUM_BUILTIN_WAIT_EVENT_EXTENSION, WaitEventExtensionEntryById::wait_event_name, and WaitEventExtensionHashById.
Referenced by pgstat_get_wait_event().
char** GetWaitEventExtensionNames | ( | int * | nwaitevents | ) |
Definition at line 273 of file wait_event.c.
References Assert(), hash_get_num_entries(), hash_seq_init(), hash_seq_search(), LW_SHARED, LWLockAcquire(), LWLockRelease(), palloc(), pstrdup(), WaitEventExtensionEntryByName::wait_event_name, and WaitEventExtensionHashByName.
Referenced by pg_get_wait_events().
|
static |
Referenced by pgstat_get_wait_event().
|
static |
Referenced by pgstat_get_wait_event().
|
static |
Referenced by pgstat_get_wait_event().
const char* pgstat_get_wait_event | ( | uint32 | wait_event_info | ) |
Definition at line 395 of file wait_event.c.
References GetLockNameFromTagType(), GetLWLockIdentifier(), GetWaitEventExtensionIdentifier(), PG_WAIT_ACTIVITY, PG_WAIT_BUFFERPIN, 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_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().
const char* pgstat_get_wait_event_type | ( | uint32 | wait_event_info | ) |
Definition at line 340 of file wait_event.c.
References PG_WAIT_ACTIVITY, PG_WAIT_BUFFERPIN, PG_WAIT_CLIENT, PG_WAIT_EXTENSION, PG_WAIT_IO, PG_WAIT_IPC, PG_WAIT_LOCK, PG_WAIT_LWLOCK, PG_WAIT_TIMEOUT, and WAIT_EVENT_CLASS_MASK.
Referenced by pg_stat_get_activity(), and pg_stat_get_backend_wait_event_type().
|
static |
Referenced by pgstat_get_wait_event().
|
static |
Referenced by pgstat_get_wait_event().
|
static |
Referenced by pgstat_get_wait_event().
void pgstat_reset_wait_event_storage | ( | void | ) |
Definition at line 328 of file wait_event.c.
References local_my_wait_event_info, and my_wait_event_info.
Referenced by AuxiliaryProcKill(), and ProcKill().
void pgstat_set_wait_event_storage | ( | uint32 * | wait_event_info | ) |
Definition at line 316 of file wait_event.c.
References my_wait_event_info.
Referenced by InitAuxiliaryProcess(), and InitProcess().
uint32 WaitEventExtensionNew | ( | const char * | wait_event_name | ) |
Definition at line 164 of file wait_event.c.
References Assert(), elog(), ereport, errcode(), errmsg(), ERROR, WaitEventExtensionEntryByName::event_id, HASH_ENTER, HASH_FIND, hash_search(), LW_EXCLUSIVE, LW_SHARED, LWLockAcquire(), LWLockRelease(), WaitEventExtensionCounterData::mutex, NAMEDATALEN, WaitEventExtensionCounterData::nextId, SpinLockAcquire, SpinLockRelease, strlcpy(), WAIT_EVENT_EXTENSION_HASH_MAX_SIZE, WAIT_EVENT_EXTENSION_INFO, WaitEventExtensionEntryById::wait_event_name, WaitEventExtensionCounter, WaitEventExtensionHashById, and WaitEventExtensionHashByName.
Referenced by worker_spi_main().
void WaitEventExtensionShmemInit | ( | void | ) |
Definition at line 122 of file wait_event.c.
References HASHCTL::entrysize, HASH_BLOBS, HASH_ELEM, HASH_STRINGS, HASHCTL::keysize, WaitEventExtensionCounterData::mutex, NAMEDATALEN, WaitEventExtensionCounterData::nextId, NUM_BUILTIN_WAIT_EVENT_EXTENSION, ShmemInitHash(), ShmemInitStruct(), SpinLockInit, WAIT_EVENT_EXTENSION_HASH_INIT_SIZE, WAIT_EVENT_EXTENSION_HASH_MAX_SIZE, WaitEventExtensionCounter, WaitEventExtensionHashById, and WaitEventExtensionHashByName.
Referenced by CreateSharedMemoryAndSemaphores().
Size WaitEventExtensionShmemSize | ( | void | ) |
Definition at line 106 of file wait_event.c.
References add_size(), hash_estimate_size(), MAXALIGN, and WAIT_EVENT_EXTENSION_HASH_MAX_SIZE.
Referenced by CalculateShmemSize().
|
static |
Definition at line 42 of file wait_event.c.
Referenced by pgstat_reset_wait_event_storage().
uint32* my_wait_event_info = &local_my_wait_event_info |
Definition at line 43 of file wait_event.c.
Referenced by pgstat_report_wait_end(), pgstat_report_wait_start(), pgstat_reset_wait_event_storage(), and pgstat_set_wait_event_storage().
|
static |
Definition at line 91 of file wait_event.c.
Referenced by WaitEventExtensionNew(), and WaitEventExtensionShmemInit().
|
static |
Definition at line 63 of file wait_event.c.
Referenced by GetWaitEventExtensionIdentifier(), WaitEventExtensionNew(), and WaitEventExtensionShmemInit().
|
static |
Definition at line 64 of file wait_event.c.
Referenced by GetWaitEventExtensionNames(), WaitEventExtensionNew(), and WaitEventExtensionShmemInit().