PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "fmgr.h"
#include "miscadmin.h"
#include "storage/condition_variable.h"
#include "storage/dsm_registry.h"
#include "storage/ipc.h"
#include "storage/lwlock.h"
#include "storage/shmem.h"
#include "utils/builtins.h"
#include "utils/injection_point.h"
#include "utils/wait_event.h"
Go to the source code of this file.
Data Structures | |
struct | InjectionPointCondition |
struct | InjectionPointSharedState |
Macros | |
#define | INJ_MAX_WAIT 8 |
#define | INJ_NAME_MAXLEN 64 |
#define | INJ_MAX_CONDITION 4 |
Typedefs | |
typedef struct InjectionPointCondition | InjectionPointCondition |
typedef struct InjectionPointSharedState | InjectionPointSharedState |
Functions | |
PGDLLEXPORT void | injection_error (const char *name) |
PGDLLEXPORT void | injection_notice (const char *name) |
PGDLLEXPORT void | injection_wait (const char *name) |
static void | injection_point_init_state (void *ptr) |
static void | injection_init_shmem (void) |
static bool | injection_point_allowed (const char *name) |
static void | injection_points_cleanup (int code, Datum arg) |
PG_FUNCTION_INFO_V1 (injection_points_attach) | |
Datum | injection_points_attach (PG_FUNCTION_ARGS) |
PG_FUNCTION_INFO_V1 (injection_points_run) | |
Datum | injection_points_run (PG_FUNCTION_ARGS) |
PG_FUNCTION_INFO_V1 (injection_points_wakeup) | |
Datum | injection_points_wakeup (PG_FUNCTION_ARGS) |
PG_FUNCTION_INFO_V1 (injection_points_set_local) | |
Datum | injection_points_set_local (PG_FUNCTION_ARGS) |
PG_FUNCTION_INFO_V1 (injection_points_detach) | |
Datum | injection_points_detach (PG_FUNCTION_ARGS) |
Variables | |
PG_MODULE_MAGIC | |
static InjectionPointSharedState * | inj_state = NULL |
static bool | injection_point_local = false |
#define INJ_MAX_CONDITION 4 |
Definition at line 36 of file injection_points.c.
#define INJ_MAX_WAIT 8 |
Definition at line 34 of file injection_points.c.
#define INJ_NAME_MAXLEN 64 |
Definition at line 35 of file injection_points.c.
typedef struct InjectionPointCondition InjectionPointCondition |
typedef struct InjectionPointSharedState InjectionPointSharedState |
void injection_error | ( | const char * | name | ) |
Definition at line 187 of file injection_points.c.
References elog, ERROR, injection_point_allowed(), and name.
|
static |
Definition at line 102 of file injection_points.c.
References GetNamedDSMSegment(), inj_state, and injection_point_init_state().
Referenced by injection_point_allowed(), injection_points_detach(), injection_points_set_local(), injection_points_wakeup(), and injection_wait().
void injection_notice | ( | const char * | name | ) |
Definition at line 196 of file injection_points.c.
References elog, injection_point_allowed(), name, and NOTICE.
|
static |
Definition at line 123 of file injection_points.c.
References InjectionPointSharedState::conditions, i, INJ_MAX_CONDITION, inj_state, injection_init_shmem(), InjectionPointSharedState::lock, MyProcPid, name, InjectionPointCondition::name, InjectionPointCondition::pid, SpinLockAcquire, and SpinLockRelease.
Referenced by injection_error(), injection_notice(), and injection_wait().
|
static |
Definition at line 87 of file injection_points.c.
References ConditionVariableInit(), and SpinLockInit.
Referenced by injection_init_shmem().
Datum injection_points_attach | ( | PG_FUNCTION_ARGS | ) |
Definition at line 272 of file injection_points.c.
References generate_unaccent_rules::action, InjectionPointSharedState::conditions, elog, ERROR, FATAL, i, INJ_MAX_CONDITION, INJ_NAME_MAXLEN, inj_state, injection_point_local, InjectionPointAttach(), InjectionPointSharedState::lock, MyProcPid, name, InjectionPointCondition::name, PG_GETARG_TEXT_PP, PG_RETURN_VOID, InjectionPointCondition::pid, SpinLockAcquire, SpinLockRelease, strlcpy(), and text_to_cstring().
|
static |
Definition at line 160 of file injection_points.c.
References InjectionPointSharedState::conditions, i, INJ_MAX_CONDITION, inj_state, injection_point_local, InjectionPointDetach(), InjectionPointSharedState::lock, MyProcPid, InjectionPointCondition::name, InjectionPointCondition::pid, SpinLockAcquire, and SpinLockRelease.
Referenced by injection_points_set_local().
Datum injection_points_detach | ( | PG_FUNCTION_ARGS | ) |
Definition at line 402 of file injection_points.c.
References InjectionPointSharedState::conditions, i, INJ_MAX_CONDITION, inj_state, injection_init_shmem(), InjectionPointDetach(), InjectionPointSharedState::lock, name, InjectionPointCondition::name, PG_GETARG_TEXT_PP, PG_RETURN_VOID, InjectionPointCondition::pid, SpinLockAcquire, SpinLockRelease, and text_to_cstring().
Datum injection_points_run | ( | PG_FUNCTION_ARGS | ) |
Definition at line 326 of file injection_points.c.
References INJECTION_POINT, name, PG_GETARG_TEXT_PP, PG_RETURN_VOID, and text_to_cstring().
Datum injection_points_set_local | ( | PG_FUNCTION_ARGS | ) |
Definition at line 380 of file injection_points.c.
References before_shmem_exit(), inj_state, injection_init_shmem(), injection_point_local, injection_points_cleanup(), and PG_RETURN_VOID.
Datum injection_points_wakeup | ( | PG_FUNCTION_ARGS | ) |
Definition at line 340 of file injection_points.c.
References ConditionVariableBroadcast(), elog, ERROR, i, INJ_MAX_WAIT, inj_state, injection_init_shmem(), InjectionPointSharedState::lock, name, InjectionPointSharedState::name, PG_GETARG_TEXT_PP, PG_RETURN_VOID, SpinLockAcquire, SpinLockRelease, text_to_cstring(), InjectionPointSharedState::wait_counts, and InjectionPointSharedState::wait_point.
void injection_wait | ( | const char * | name | ) |
Definition at line 206 of file injection_points.c.
References ConditionVariableCancelSleep(), ConditionVariablePrepareToSleep(), ConditionVariableSleep(), elog, ERROR, i, INJ_MAX_WAIT, INJ_NAME_MAXLEN, inj_state, injection_init_shmem(), injection_point_allowed(), InjectionPointSharedState::lock, name, InjectionPointSharedState::name, SpinLockAcquire, SpinLockRelease, strlcpy(), InjectionPointSharedState::wait_counts, InjectionPointSharedState::wait_point, and WaitEventExtensionNew().
PG_FUNCTION_INFO_V1 | ( | injection_points_attach | ) |
PG_FUNCTION_INFO_V1 | ( | injection_points_detach | ) |
PG_FUNCTION_INFO_V1 | ( | injection_points_run | ) |
PG_FUNCTION_INFO_V1 | ( | injection_points_set_local | ) |
PG_FUNCTION_INFO_V1 | ( | injection_points_wakeup | ) |
|
static |
Definition at line 74 of file injection_points.c.
Referenced by injection_init_shmem(), injection_point_allowed(), injection_points_attach(), injection_points_cleanup(), injection_points_detach(), injection_points_set_local(), injection_points_wakeup(), and injection_wait().
Definition at line 81 of file injection_points.c.
Referenced by injection_points_attach(), injection_points_cleanup(), and injection_points_set_local().
PG_MODULE_MAGIC |
Definition at line 31 of file injection_points.c.