PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
injection_stats.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

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)
 
void pgstat_register_inj_fixed (void)
 
void pgstat_report_inj_fixed (uint32 numattach, uint32 numdetach, uint32 numrun, uint32 numcached, uint32 numloaded)
 

Variables

bool inj_stats_enabled
 

Function Documentation

◆ pgstat_create_inj()

void pgstat_create_inj ( const char *  name)

Definition at line 124 of file injection_stats.c.

125{
126 PgStat_EntryRef *entry_ref;
128
129 /* leave if disabled */
131 return;
132
134 PGSTAT_INJ_IDX(name), NULL);
135
136 shstatent = (PgStatShared_InjectionPoint *) entry_ref->shared_stats;
137
138 /* initialize shared memory data */
139 memset(&shstatent->stats, 0, sizeof(shstatent->stats));
140}
bool inj_stats_enabled
static bool inj_stats_loaded
#define PGSTAT_INJ_IDX(name)
#define PGSTAT_KIND_INJECTION
PgStat_EntryRef * pgstat_prep_pending_entry(PgStat_Kind kind, Oid dboid, uint64 objid, bool *created_entry)
Definition: pgstat.c:1284
#define InvalidOid
Definition: postgres_ext.h:37
PgStat_StatInjEntry stats
PgStatShared_Common * shared_stats
const char * name

References inj_stats_enabled, inj_stats_loaded, InvalidOid, name, PGSTAT_INJ_IDX, PGSTAT_KIND_INJECTION, pgstat_prep_pending_entry(), PgStat_EntryRef::shared_stats, and PgStatShared_InjectionPoint::stats.

Referenced by injection_points_attach().

◆ pgstat_drop_inj()

void pgstat_drop_inj ( const char *  name)

Definition at line 146 of file injection_stats.c.

147{
148 /* leave if disabled */
150 return;
151
155}
void pgstat_request_entry_refs_gc(void)
Definition: pgstat_shmem.c:700
bool pgstat_drop_entry(PgStat_Kind kind, Oid dboid, uint64 objid)
Definition: pgstat_shmem.c:953

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().

◆ pgstat_register_inj()

void pgstat_register_inj ( void  )

Definition at line 112 of file injection_stats.c.

113{
115
116 /* mark stats as loaded */
117 inj_stats_loaded = true;
118}
static const PgStat_KindInfo injection_stats
void pgstat_register_kind(PgStat_Kind kind, const PgStat_KindInfo *kind_info)
Definition: pgstat.c:1482

References inj_stats_loaded, injection_stats, PGSTAT_KIND_INJECTION, and pgstat_register_kind().

Referenced by _PG_init().

◆ pgstat_register_inj_fixed()

void pgstat_register_inj_fixed ( void  )

Definition at line 129 of file injection_stats_fixed.c.

130{
132
133 /* mark stats as loaded */
134 inj_fixed_loaded = true;
135}
static bool inj_fixed_loaded
#define PGSTAT_KIND_INJECTION_FIXED
static const PgStat_KindInfo injection_stats_fixed

References inj_fixed_loaded, injection_stats_fixed, PGSTAT_KIND_INJECTION_FIXED, and pgstat_register_kind().

Referenced by _PG_init().

◆ pgstat_report_inj()

void pgstat_report_inj ( const char *  name)

Definition at line 164 of file injection_stats.c.

165{
166 PgStat_EntryRef *entry_ref;
168 PgStat_StatInjEntry *statent;
169
170 /* leave if disabled */
172 return;
173
175 PGSTAT_INJ_IDX(name), NULL);
176
177 shstatent = (PgStatShared_InjectionPoint *) entry_ref->shared_stats;
178 statent = &shstatent->stats;
179
180 /* Update the injection point statistics */
181 statent->numcalls++;
182}
PgStat_Counter numcalls

References inj_stats_enabled, inj_stats_loaded, InvalidOid, name, PgStat_StatInjEntry::numcalls, PGSTAT_INJ_IDX, PGSTAT_KIND_INJECTION, pgstat_prep_pending_entry(), PgStat_EntryRef::shared_stats, and PgStatShared_InjectionPoint::stats.

Referenced by injection_error(), injection_notice(), and injection_wait().

◆ pgstat_report_inj_fixed()

void pgstat_report_inj_fixed ( uint32  numattach,
uint32  numdetach,
uint32  numrun,
uint32  numcached,
uint32  numloaded 
)

Definition at line 141 of file injection_stats_fixed.c.

146{
148
149 /* leave if disabled */
151 return;
152
154
156 stats_shmem->stats.numattach += numattach;
157 stats_shmem->stats.numdetach += numdetach;
158 stats_shmem->stats.numrun += numrun;
159 stats_shmem->stats.numcached += numcached;
160 stats_shmem->stats.numloaded += numloaded;
162}
static void * pgstat_get_custom_shmem_data(PgStat_Kind kind)
static void pgstat_end_changecount_write(uint32 *cc)
static void pgstat_begin_changecount_write(uint32 *cc)

References PgStatShared_InjectionPointFixed::changecount, inj_fixed_loaded, inj_stats_enabled, PgStat_StatInjFixedEntry::numattach, PgStat_StatInjFixedEntry::numcached, PgStat_StatInjFixedEntry::numdetach, PgStat_StatInjFixedEntry::numloaded, PgStat_StatInjFixedEntry::numrun, pgstat_begin_changecount_write(), pgstat_end_changecount_write(), pgstat_get_custom_shmem_data(), PGSTAT_KIND_INJECTION_FIXED, and PgStatShared_InjectionPointFixed::stats.

Referenced by injection_points_attach(), injection_points_cached(), injection_points_detach(), injection_points_load(), and injection_points_run().

Variable Documentation

◆ inj_stats_enabled