|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "fmgr.h"#include "funcapi.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/guc.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 |
| #define | NUM_INJECTION_POINTS_LIST 3 |
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 |
| static shmem_request_hook_type | prev_shmem_request_hook = NULL |
| static shmem_startup_hook_type | prev_shmem_startup_hook = NULL |
| #define INJ_MAX_WAIT 8 |
Definition at line 39 of file injection_points.c.
| #define INJ_NAME_MAXLEN 64 |
Definition at line 40 of file injection_points.c.
| #define NUM_INJECTION_POINTS_LIST 3 |
| typedef struct InjectionPointCondition InjectionPointCondition |
| typedef enum InjectionPointConditionType InjectionPointConditionType |
| typedef struct InjectionPointSharedState InjectionPointSharedState |
| Enumerator | |
|---|---|
| INJ_CONDITION_ALWAYS | |
| INJ_CONDITION_PID | |
Definition at line 51 of file injection_points.c.
| void _PG_init | ( | void | ) |
Definition at line 598 of file injection_points.c.
References injection_shmem_request(), injection_shmem_startup(), prev_shmem_request_hook, prev_shmem_startup_hook, process_shared_preload_libraries_in_progress, shmem_request_hook, and shmem_startup_hook.
| void injection_error | ( | const char * | name, |
| const void * | private_data, | ||
| void * | arg | ||
| ) |
Definition at line 233 of file injection_points.c.
References arg, elog, ERROR, injection_point_allowed(), and name.
|
static |
Definition at line 172 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, | ||
| void * | arg | ||
| ) |
Definition at line 249 of file injection_points.c.
References arg, elog, injection_point_allowed(), name, and NOTICE.
|
static |
Definition at line 192 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 118 of file injection_points.c.
References ConditionVariableInit(), and SpinLockInit.
Referenced by injection_init_shmem(), and injection_shmem_startup().
| Datum injection_points_attach | ( | PG_FUNCTION_ARGS | ) |
Definition at line 333 of file injection_points.c.
References generate_unaccent_rules::action, elog, ERROR, function, 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_attach_func | ( | PG_FUNCTION_ARGS | ) |
Definition at line 377 of file injection_points.c.
References elog, ERROR, function, InjectionPointAttach(), name, PG_ARGISNULL, PG_GETARG_BYTEA_PP, PG_GETARG_TEXT_PP, PG_RETURN_VOID, text_to_cstring(), VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
| Datum injection_points_cached | ( | PG_FUNCTION_ARGS | ) |
Definition at line 455 of file injection_points.c.
References arg, INJECTION_POINT_CACHED, name, PG_ARGISNULL, PG_GETARG_TEXT_PP, PG_RETURN_VOID, and text_to_cstring().
|
static |
Definition at line 214 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 539 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_list | ( | PG_FUNCTION_ARGS | ) |
Definition at line 564 of file injection_points.c.
References cstring_to_text(), InjectionPointData::function, InitMaterializedSRF(), InjectionPointList(), lfirst, InjectionPointData::library, InjectionPointData::name, NUM_INJECTION_POINTS_LIST, PointerGetDatum(), ReturnSetInfo::setDesc, ReturnSetInfo::setResult, tuplestore_putvalues(), and values.
| Datum injection_points_load | ( | PG_FUNCTION_ARGS | ) |
Definition at line 416 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 433 of file injection_points.c.
References arg, INJECTION_POINT, name, PG_ARGISNULL, PG_GETARG_TEXT_PP, PG_RETURN_VOID, and text_to_cstring().
| Datum injection_points_set_local | ( | PG_FUNCTION_ARGS | ) |
Definition at line 517 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 477 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.
|
static |
Definition at line 130 of file injection_points.c.
References MAXALIGN, prev_shmem_request_hook, and RequestAddinShmemSpace().
Referenced by _PG_init().
|
static |
Definition at line 142 of file injection_points.c.
References inj_state, injection_point_init_state(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), prev_shmem_startup_hook, and ShmemInitStruct().
Referenced by _PG_init().
| void injection_wait | ( | const char * | name, |
| const void * | private_data, | ||
| void * | arg | ||
| ) |
Definition at line 266 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_attach_func | ) |
| PG_FUNCTION_INFO_V1 | ( | injection_points_cached | ) |
| PG_FUNCTION_INFO_V1 | ( | injection_points_detach | ) |
| PG_FUNCTION_INFO_V1 | ( | injection_points_list | ) |
| 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 70 of file injection_points.c.
Referenced by injection_points_attach(), injection_points_cleanup(), and injection_points_detach().
|
static |
Definition at line 94 of file injection_points.c.
Referenced by injection_init_shmem(), injection_points_load(), injection_points_set_local(), injection_points_wakeup(), injection_shmem_startup(), and injection_wait().
|
static |
Definition at line 107 of file injection_points.c.
Referenced by injection_points_attach(), injection_points_cleanup(), and injection_points_set_local().
| PG_MODULE_MAGIC |
Definition at line 36 of file injection_points.c.
|
static |
Definition at line 110 of file injection_points.c.
Referenced by _PG_init(), and injection_shmem_request().
|
static |
Definition at line 111 of file injection_points.c.
Referenced by _PG_init(), and injection_shmem_startup().