PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "fmgr.h"
#include "miscadmin.h"
#include "nodes/pg_list.h"
#include "nodes/value.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/memutils.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 |
Typedefs | |
typedef enum InjectionPointConditionType | InjectionPointConditionType |
typedef struct InjectionPointCondition | InjectionPointCondition |
typedef struct InjectionPointSharedState | InjectionPointSharedState |
Enumerations | |
enum | InjectionPointConditionType { INJ_CONDITION_ALWAYS = 0 , INJ_CONDITION_PID } |
Variables | |
PG_MODULE_MAGIC | |
static List * | inj_list_local = NIL |
static InjectionPointSharedState * | inj_state = NULL |
static bool | injection_point_local = false |
#define INJ_MAX_WAIT 8 |
Definition at line 37 of file injection_points.c.
#define INJ_NAME_MAXLEN 64 |
Definition at line 38 of file injection_points.c.
typedef struct InjectionPointCondition InjectionPointCondition |
typedef enum InjectionPointConditionType InjectionPointConditionType |
typedef struct InjectionPointSharedState InjectionPointSharedState |
void injection_error | ( | const char * | name, |
const void * | private_data | ||
) |
Definition at line 178 of file injection_points.c.
References elog, ERROR, injection_point_allowed(), and name.
|
static |
Definition at line 117 of file injection_points.c.
References GetNamedDSMSegment(), inj_state, and injection_point_init_state().
Referenced by injection_points_load(), injection_points_set_local(), injection_points_wakeup(), and injection_wait().
void injection_notice | ( | const char * | name, |
const void * | private_data | ||
) |
Definition at line 189 of file injection_points.c.
References elog, injection_point_allowed(), name, and NOTICE.
|
static |
Definition at line 137 of file injection_points.c.
References INJ_CONDITION_ALWAYS, INJ_CONDITION_PID, MyProcPid, InjectionPointCondition::pid, and InjectionPointCondition::type.
Referenced by injection_error(), injection_notice(), and injection_wait().
|
static |
Definition at line 103 of file injection_points.c.
References ConditionVariableInit(), and SpinLockInit.
Referenced by injection_init_shmem().
Datum injection_points_attach | ( | PG_FUNCTION_ARGS | ) |
Definition at line 268 of file injection_points.c.
References generate_unaccent_rules::action, elog, ERROR, INJ_CONDITION_PID, inj_list_local, injection_point_local, InjectionPointAttach(), lappend(), makeString(), MemoryContextSwitchTo(), MyProcPid, name, PG_GETARG_TEXT_PP, PG_RETURN_VOID, InjectionPointCondition::pid, pstrdup(), text_to_cstring(), TopMemoryContext, and InjectionPointCondition::type.
Datum injection_points_cached | ( | PG_FUNCTION_ARGS | ) |
Definition at line 341 of file injection_points.c.
References INJECTION_POINT_CACHED, name, PG_GETARG_TEXT_PP, PG_RETURN_VOID, and text_to_cstring().
|
static |
Definition at line 159 of file injection_points.c.
References inj_list_local, injection_point_local, InjectionPointDetach(), lfirst, name, and strVal.
Referenced by injection_points_set_local().
Datum injection_points_detach | ( | PG_FUNCTION_ARGS | ) |
Definition at line 417 of file injection_points.c.
References elog, ERROR, inj_list_local, InjectionPointDetach(), list_delete(), makeString(), MemoryContextSwitchTo(), name, NIL, PG_GETARG_TEXT_PP, PG_RETURN_VOID, text_to_cstring(), and TopMemoryContext.
Datum injection_points_load | ( | PG_FUNCTION_ARGS | ) |
Definition at line 310 of file injection_points.c.
References inj_state, injection_init_shmem(), INJECTION_POINT_LOAD, name, PG_GETARG_TEXT_PP, PG_RETURN_VOID, and text_to_cstring().
Datum injection_points_run | ( | PG_FUNCTION_ARGS | ) |
Definition at line 327 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 395 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 355 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, |
const void * | private_data | ||
) |
Definition at line 201 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 WaitEventInjectionPointNew().
PG_FUNCTION_INFO_V1 | ( | injection_points_attach | ) |
PG_FUNCTION_INFO_V1 | ( | injection_points_cached | ) |
PG_FUNCTION_INFO_V1 | ( | injection_points_detach | ) |
PG_FUNCTION_INFO_V1 | ( | injection_points_load | ) |
PG_FUNCTION_INFO_V1 | ( | injection_points_run | ) |
PG_FUNCTION_INFO_V1 | ( | injection_points_set_local | ) |
PG_FUNCTION_INFO_V1 | ( | injection_points_wakeup | ) |
Definition at line 68 of file injection_points.c.
Referenced by injection_points_attach(), injection_points_cleanup(), and injection_points_detach().
|
static |
Definition at line 87 of file injection_points.c.
Referenced by injection_init_shmem(), injection_points_load(), injection_points_set_local(), injection_points_wakeup(), and injection_wait().
Definition at line 97 of file injection_points.c.
Referenced by injection_points_attach(), injection_points_cleanup(), and injection_points_set_local().
PG_MODULE_MAGIC |
Definition at line 34 of file injection_points.c.