PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "storage/lmgr.h"
#include "storage/lwlock.h"
#include "storage/spin.h"
#include "utils/wait_event.h"
#include "pgstat_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 |
uint32 * | my_wait_event_info = &local_my_wait_event_info |
static HTAB * | WaitEventCustomHashByInfo |
static HTAB * | WaitEventCustomHashByName |
static WaitEventCustomCounterData * | WaitEventCustomCounter |
#define WAIT_EVENT_CLASS_MASK 0xFF000000 |
Definition at line 42 of file wait_event.c.
#define WAIT_EVENT_CUSTOM_HASH_INIT_SIZE 16 |
Definition at line 66 of file wait_event.c.
#define WAIT_EVENT_CUSTOM_HASH_MAX_SIZE 128 |
Definition at line 67 of file wait_event.c.
#define WAIT_EVENT_CUSTOM_INITIAL_ID 1 |
Definition at line 94 of file wait_event.c.
#define WAIT_EVENT_ID_MASK 0x0000FFFF |
Definition at line 43 of file wait_event.c.
typedef struct WaitEventCustomCounterData WaitEventCustomCounterData |
typedef struct WaitEventCustomEntryByInfo WaitEventCustomEntryByInfo |
typedef struct WaitEventCustomEntryByName WaitEventCustomEntryByName |
|
static |
Definition at line 276 of file wait_event.c.
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().
char** GetWaitEventCustomNames | ( | uint32 | classId, |
int * | nwaitevents | ||
) |
Definition at line 306 of file wait_event.c.
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().
|
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 431 of file wait_event.c.
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().
const char* pgstat_get_wait_event_type | ( | uint32 | wait_event_info | ) |
Definition at line 373 of file wait_event.c.
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().
|
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 361 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 349 of file wait_event.c.
References my_wait_event_info.
Referenced by InitAuxiliaryProcess(), and InitProcess().
Definition at line 175 of file wait_event.c.
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().
void WaitEventCustomShmemInit | ( | void | ) |
Definition at line 119 of file wait_event.c.
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().
Size WaitEventCustomShmemSize | ( | void | ) |
Definition at line 103 of file wait_event.c.
References add_size(), hash_estimate_size(), MAXALIGN, and WAIT_EVENT_CUSTOM_HASH_MAX_SIZE.
Referenced by CalculateShmemSize().
uint32 WaitEventExtensionNew | ( | const char * | wait_event_name | ) |
Definition at line 163 of file wait_event.c.
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().
uint32 WaitEventInjectionPointNew | ( | const char * | wait_event_name | ) |
Definition at line 169 of file wait_event.c.
References PG_WAIT_INJECTIONPOINT, and WaitEventCustomNew().
Referenced by injection_wait().
|
static |
Definition at line 39 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 40 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 WaitEventCustomNew(), and WaitEventCustomShmemInit().
|
static |
Definition at line 63 of file wait_event.c.
Referenced by GetWaitEventCustomIdentifier(), WaitEventCustomNew(), and WaitEventCustomShmemInit().
|
static |
Definition at line 64 of file wait_event.c.
Referenced by GetWaitEventCustomNames(), WaitEventCustomNew(), and WaitEventCustomShmemInit().