PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "fmgr.h"
#include "common/hashfn.h"
#include "injection_stats.h"
#include "pgstat.h"
#include "utils/builtins.h"
#include "utils/pgstat_internal.h"
Go to the source code of this file.
Data Structures | |
struct | PgStat_StatInjEntry |
struct | PgStatShared_InjectionPoint |
Macros | |
#define | PGSTAT_INJ_IDX(name) hash_bytes_extended((const unsigned char *) name, strlen(name), 0) |
#define | PGSTAT_KIND_INJECTION 129 |
Typedefs | |
typedef struct PgStat_StatInjEntry | PgStat_StatInjEntry |
typedef struct PgStatShared_InjectionPoint | PgStatShared_InjectionPoint |
Functions | |
static bool | injection_stats_flush_cb (PgStat_EntryRef *entry_ref, bool nowait) |
static PgStat_StatInjEntry * | pgstat_fetch_stat_injentry (const char *name) |
void | pgstat_register_inj (void) |
void | pgstat_create_inj (const char *name) |
void | pgstat_drop_inj (const char *name) |
void | pgstat_report_inj (const char *name) |
PG_FUNCTION_INFO_V1 (injection_points_stats_numcalls) | |
Datum | injection_points_stats_numcalls (PG_FUNCTION_ARGS) |
Variables | |
static const PgStat_KindInfo | injection_stats |
static bool | inj_stats_loaded = false |
#define PGSTAT_INJ_IDX | ( | name | ) | hash_bytes_extended((const unsigned char *) name, strlen(name), 0) |
Definition at line 57 of file injection_stats.c.
#define PGSTAT_KIND_INJECTION 129 |
Definition at line 62 of file injection_stats.c.
typedef struct PgStat_StatInjEntry PgStat_StatInjEntry |
typedef struct PgStatShared_InjectionPoint PgStatShared_InjectionPoint |
Datum injection_points_stats_numcalls | ( | PG_FUNCTION_ARGS | ) |
Definition at line 189 of file injection_stats.c.
References name, PgStat_StatInjEntry::numcalls, PG_GETARG_TEXT_PP, PG_RETURN_INT64, PG_RETURN_NULL, pgstat_fetch_stat_injentry(), and text_to_cstring().
|
static |
Definition at line 71 of file injection_stats.c.
References PgStat_StatInjEntry::numcalls, PgStat_EntryRef::pending, pgstat_lock_entry(), PgStat_EntryRef::shared_stats, and PgStatShared_InjectionPoint::stats.
PG_FUNCTION_INFO_V1 | ( | injection_points_stats_numcalls | ) |
void pgstat_create_inj | ( | const char * | name | ) |
Definition at line 121 of file injection_stats.c.
References inj_stats_enabled, inj_stats_loaded, InvalidOid, name, pgstat_get_entry_ref_locked(), PGSTAT_INJ_IDX, PGSTAT_KIND_INJECTION, pgstat_unlock_entry(), PgStat_EntryRef::shared_stats, and PgStatShared_InjectionPoint::stats.
Referenced by injection_points_attach().
void pgstat_drop_inj | ( | const char * | name | ) |
Definition at line 143 of file injection_stats.c.
References inj_stats_enabled, inj_stats_loaded, InvalidOid, name, pgstat_drop_entry(), PGSTAT_INJ_IDX, PGSTAT_KIND_INJECTION, and pgstat_request_entry_refs_gc().
Referenced by injection_points_cleanup(), and injection_points_detach().
|
static |
Definition at line 91 of file injection_stats.c.
References inj_stats_enabled, inj_stats_loaded, InvalidOid, name, pgstat_fetch_entry(), PGSTAT_INJ_IDX, and PGSTAT_KIND_INJECTION.
Referenced by injection_points_stats_numcalls().
void pgstat_register_inj | ( | void | ) |
Definition at line 109 of file injection_stats.c.
References inj_stats_loaded, injection_stats, PGSTAT_KIND_INJECTION, and pgstat_register_kind().
Referenced by _PG_init().
void pgstat_report_inj | ( | const char * | name | ) |
Definition at line 161 of file injection_stats.c.
References inj_stats_enabled, inj_stats_loaded, InvalidOid, name, PgStat_StatInjEntry::numcalls, pgstat_get_entry_ref_locked(), PGSTAT_INJ_IDX, PGSTAT_KIND_INJECTION, pgstat_unlock_entry(), PgStat_EntryRef::shared_stats, and PgStatShared_InjectionPoint::stats.
Referenced by injection_error(), injection_notice(), and injection_wait().
|
static |
Definition at line 65 of file injection_stats.c.
Referenced by pgstat_create_inj(), pgstat_drop_inj(), pgstat_fetch_stat_injentry(), pgstat_register_inj(), and pgstat_report_inj().
|
static |
Definition at line 39 of file injection_stats.c.
Referenced by pgstat_register_inj().