|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "common/hashfn.h"#include "funcapi.h"#include "storage/dsm_registry.h"#include "utils/builtins.h"#include "utils/pgstat_internal.h"
Go to the source code of this file.
Data Structures | |
| struct | PgStat_StatCustomVarEntry |
| struct | PgStatShared_CustomVarEntry |
Macros | |
| #define | TEST_CUSTOM_VAR_MAGIC_NUMBER (0xBEEFBEEF) |
| #define | PGSTAT_KIND_TEST_CUSTOM_VAR_STATS 25 |
| #define | TEST_CUSTOM_AUX_DATA_DESC "pg_stat/test_custom_var_stats_desc.stats" |
| #define | PGSTAT_CUSTOM_VAR_STATS_IDX(name) hash_bytes_extended((const unsigned char *) name, strlen(name), 0) |
Typedefs | |
| typedef struct PgStat_StatCustomVarEntry | PgStat_StatCustomVarEntry |
| typedef struct PgStatShared_CustomVarEntry | PgStatShared_CustomVarEntry |
Variables | |
| static FILE * | fd_description = NULL |
| static pgoff_t | fd_description_offset = 0 |
| static dsa_area * | custom_stats_description_dsa = NULL |
| static const PgStat_KindInfo | custom_stats |
| #define PGSTAT_CUSTOM_VAR_STATS_IDX | ( | name | ) | hash_bytes_extended((const unsigned char *) name, strlen(name), 0) |
Definition at line 44 of file test_custom_var_stats.c.
| #define PGSTAT_KIND_TEST_CUSTOM_VAR_STATS 25 |
Definition at line 36 of file test_custom_var_stats.c.
| #define TEST_CUSTOM_AUX_DATA_DESC "pg_stat/test_custom_var_stats_desc.stats" |
Definition at line 39 of file test_custom_var_stats.c.
| #define TEST_CUSTOM_VAR_MAGIC_NUMBER (0xBEEFBEEF) |
Definition at line 26 of file test_custom_var_stats.c.
Definition at line 128 of file test_custom_var_stats.c.
References custom_stats, PGSTAT_KIND_TEST_CUSTOM_VAR_STATS, pgstat_register_kind(), and process_shared_preload_libraries_in_progress.
| PG_FUNCTION_INFO_V1 | ( | test_custom_stats_var_create | ) |
| PG_FUNCTION_INFO_V1 | ( | test_custom_stats_var_drop | ) |
| PG_FUNCTION_INFO_V1 | ( | test_custom_stats_var_report | ) |
| PG_FUNCTION_INFO_V1 | ( | test_custom_stats_var_update | ) |
| PG_MODULE_MAGIC_EXT | ( | . | name = "test_custom_var_stats", |
| . | version = PG_VERSION |
||
| ) |
| Datum test_custom_stats_var_create | ( | PG_FUNCTION_ARGS | ) |
Definition at line 511 of file test_custom_var_stats.c.
References custom_stats_description_dsa, description, PgStatShared_CustomVarEntry::description, dsa_allocate, dsa_get_address(), ereport, errcode(), errdetail(), errmsg(), ERROR, fb(), GetNamedDSA(), InvalidDsaPointer, InvalidOid, NAMEDATALEN, PG_GETARG_TEXT_PP, PG_RETURN_VOID, PGSTAT_CUSTOM_VAR_STATS_IDX, pgstat_get_entry_ref_locked(), PGSTAT_KIND_TEST_CUSTOM_VAR_STATS, pgstat_unlock_entry(), PgStat_EntryRef::shared_stats, PgStatShared_CustomVarEntry::stats, and text_to_cstring().
| Datum test_custom_stats_var_drop | ( | PG_FUNCTION_ARGS | ) |
Definition at line 594 of file test_custom_var_stats.c.
References fb(), InvalidOid, PG_GETARG_TEXT_PP, PG_RETURN_VOID, PGSTAT_CUSTOM_VAR_STATS_IDX, pgstat_drop_entry(), PGSTAT_KIND_TEST_CUSTOM_VAR_STATS, pgstat_request_entry_refs_gc(), and text_to_cstring().
|
static |
Definition at line 489 of file test_custom_var_stats.c.
References fb(), InvalidOid, PGSTAT_CUSTOM_VAR_STATS_IDX, pgstat_fetch_entry(), and PGSTAT_KIND_TEST_CUSTOM_VAR_STATS.
Referenced by test_custom_stats_var_report().
|
static |
Definition at line 407 of file test_custom_var_stats.c.
References DEBUG2, elog, ereport, errcode_for_file_access(), errmsg(), errmsg_internal(), fb(), fd_description, fd_description_offset, FreeFile(), LOG, STATS_DISCARD, STATS_READ, STATS_WRITE, and TEST_CUSTOM_AUX_DATA_DESC.
|
static |
Definition at line 153 of file test_custom_var_stats.c.
References fb(), PgStat_StatCustomVarEntry::numcalls, PgStat_EntryRef::pending, pgstat_lock_entry(), pgstat_unlock_entry(), PgStat_EntryRef::shared_stats, and PgStatShared_CustomVarEntry::stats.
|
static |
Definition at line 278 of file test_custom_var_stats.c.
References AllocateFile(), custom_stats_description_dsa, PgStatShared_CustomVarEntry::description, dsa_allocate, dsa_get_address(), elog, ereport, errcode_for_file_access(), errmsg(), fb(), fd_description, fseeko, GetNamedDSA(), InvalidDsaPointer, len, LOG, palloc(), pfree(), PG_BINARY_R, PGSTAT_KIND_TEST_CUSTOM_VAR_STATS, pgstat_read_chunk(), pgstat_read_chunk_s, pgstat_reset_of_kind(), TEST_CUSTOM_AUX_DATA_DESC, TEST_CUSTOM_VAR_MAGIC_NUMBER, and WARNING.
| Datum test_custom_stats_var_report | ( | PG_FUNCTION_ARGS | ) |
Definition at line 615 of file test_custom_var_stats.c.
References BlessTupleDesc(), cstring_to_text(), custom_stats_description_dsa, description, PgStatShared_CustomVarEntry::description, dsa_get_address(), DsaPointerIsValid, elog, ERROR, fb(), get_call_result_type(), GetNamedDSA(), heap_form_tuple(), HeapTupleGetDatum(), Int64GetDatum(), InvalidOid, MemoryContextSwitchTo(), PG_GETARG_TEXT_PP, PGSTAT_CUSTOM_VAR_STATS_IDX, pgstat_get_entry_ref(), PGSTAT_KIND_TEST_CUSTOM_VAR_STATS, PointerGetDatum(), PgStat_EntryRef::shared_stats, SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, test_custom_stats_var_fetch_entry(), text_to_cstring(), TYPEFUNC_COMPOSITE, and values.
|
static |
Definition at line 193 of file test_custom_var_stats.c.
References AllocateFile(), custom_stats_description_dsa, description, PgStatShared_CustomVarEntry::description, dsa_get_address(), DsaPointerIsValid, ereport, errcode_for_file_access(), errmsg(), fb(), fd_description, fd_description_offset, GetNamedDSA(), len, LOG, PG_BINARY_W, pgstat_write_chunk(), pgstat_write_chunk_s, TEST_CUSTOM_AUX_DATA_DESC, and TEST_CUSTOM_VAR_MAGIC_NUMBER.
| Datum test_custom_stats_var_update | ( | PG_FUNCTION_ARGS | ) |
Definition at line 570 of file test_custom_var_stats.c.
References fb(), InvalidOid, PgStat_EntryRef::pending, PG_GETARG_TEXT_PP, PG_RETURN_VOID, PGSTAT_CUSTOM_VAR_STATS_IDX, PGSTAT_KIND_TEST_CUSTOM_VAR_STATS, pgstat_prep_pending_entry(), and text_to_cstring().
|
static |
Definition at line 106 of file test_custom_var_stats.c.
Referenced by _PG_init().
Definition at line 77 of file test_custom_var_stats.c.
Referenced by test_custom_stats_var_create(), test_custom_stats_var_from_serialized_data(), test_custom_stats_var_report(), and test_custom_stats_var_to_serialized_data().
Definition at line 71 of file test_custom_var_stats.c.
Referenced by test_custom_stats_var_finish(), test_custom_stats_var_from_serialized_data(), and test_custom_stats_var_to_serialized_data().
|
static |
Definition at line 74 of file test_custom_var_stats.c.
Referenced by test_custom_stats_var_finish(), and test_custom_stats_var_to_serialized_data().