|
PostgreSQL Source Code git master
|
#include "common/hashfn_unstable.h"#include "lib/dshash.h"#include "lib/ilist.h"#include "pgstat.h"#include "storage/lwlock.h"#include "utils/dsa.h"

Go to the source code of this file.
Data Structures | |
| struct | PgStat_HashKey |
| struct | PgStatShared_HashEntry |
| struct | PgStatShared_Common |
| struct | PgStat_EntryRef |
| struct | PgStat_SubXactStatus |
| struct | PgStat_KindInfo |
| struct | PgStatShared_Archiver |
| struct | PgStatShared_BgWriter |
| struct | PgStatShared_Checkpointer |
| struct | PgStatShared_IO |
| struct | PgStatShared_SLRU |
| struct | PgStatShared_Wal |
| struct | PgStatShared_Database |
| struct | PgStatShared_Relation |
| struct | PgStatShared_Function |
| struct | PgStatShared_Subscription |
| struct | PgStatShared_ReplSlot |
| struct | PgStatShared_Backend |
| struct | PgStat_ShmemControl |
| struct | PgStat_Snapshot |
| struct | PgStat_LocalState |
Macros | |
| #define | SLRU_NUM_ELEMENTS lengthof(slru_names) |
| #define | pgstat_assert_is_up() ((void)true) |
| #define | PGSTAT_BACKEND_FLUSH_IO (1 << 0) /* Flush I/O statistics */ |
| #define | PGSTAT_BACKEND_FLUSH_WAL (1 << 1) /* Flush WAL statistics */ |
| #define | PGSTAT_BACKEND_FLUSH_ALL (PGSTAT_BACKEND_FLUSH_IO | PGSTAT_BACKEND_FLUSH_WAL) |
| #define | pgstat_read_chunk_s(fpin, ptr) pgstat_read_chunk(fpin, ptr, sizeof(*ptr)) |
| #define | pgstat_write_chunk_s(fpout, ptr) pgstat_write_chunk(fpout, ptr, sizeof(*ptr)) |
Enumerations | |
| enum | PgStat_StatsFileOp { STATS_WRITE , STATS_READ , STATS_DISCARD } |
Variables | |
| static const char *const | slru_names [] |
| PGDLLIMPORT bool | pgstat_report_fixed |
| PGDLLIMPORT PgStat_LocalState | pgStatLocal |
Definition at line 668 of file pgstat_internal.h.
| #define PGSTAT_BACKEND_FLUSH_ALL (PGSTAT_BACKEND_FLUSH_IO | PGSTAT_BACKEND_FLUSH_WAL) |
Definition at line 697 of file pgstat_internal.h.
| #define PGSTAT_BACKEND_FLUSH_IO (1 << 0) /* Flush I/O statistics */ |
Definition at line 695 of file pgstat_internal.h.
| #define PGSTAT_BACKEND_FLUSH_WAL (1 << 1) /* Flush WAL statistics */ |
Definition at line 696 of file pgstat_internal.h.
| #define pgstat_read_chunk_s | ( | fpin, | |
| ptr | |||
| ) | pgstat_read_chunk(fpin, ptr, sizeof(*ptr)) |
Definition at line 871 of file pgstat_internal.h.
| #define pgstat_write_chunk_s | ( | fpout, | |
| ptr | |||
| ) | pgstat_write_chunk(fpout, ptr, sizeof(*ptr)) |
Definition at line 872 of file pgstat_internal.h.
| #define SLRU_NUM_ELEMENTS lengthof(slru_names) |
Definition at line 406 of file pgstat_internal.h.
| Enumerator | |
|---|---|
| STATS_WRITE | |
| STATS_READ | |
| STATS_DISCARD | |
Definition at line 73 of file pgstat_internal.h.
|
extern |
Definition at line 608 of file pgstat_relation.c.
References Assert, fb(), PgStat_SubXactStatus::first, pfree(), pgstat_get_xact_stack_level(), restore_truncdrop_counters(), save_truncdrop_counters(), and trans.
Referenced by AtEOSubXact_PgStat().
Definition at line 285 of file pgstat_database.c.
References fb(), pgStatXactCommit, and pgStatXactRollback.
Referenced by AtEOXact_PgStat().
|
extern |
Definition at line 550 of file pgstat_relation.c.
References Assert, fb(), PgStat_SubXactStatus::first, restore_truncdrop_counters(), and trans.
Referenced by AtEOXact_PgStat().
|
extern |
Definition at line 689 of file pgstat_relation.c.
References Assert, TwoPhasePgStatRecord::deleted_pre_truncdrop, fb(), PgStat_SubXactStatus::first, TwoPhasePgStatRecord::id, TwoPhasePgStatRecord::inserted_pre_truncdrop, PG_USED_FOR_ASSERTS_ONLY, RegisterTwoPhaseRecord(), TwoPhasePgStatRecord::shared, trans, TwoPhasePgStatRecord::truncdropped, TwoPhasePgStatRecord::tuples_deleted, TwoPhasePgStatRecord::tuples_inserted, TwoPhasePgStatRecord::tuples_updated, TWOPHASE_RM_PGSTAT_ID, and TwoPhasePgStatRecord::updated_pre_truncdrop.
Referenced by AtPrepare_PgStat().
Definition at line 66 of file pgstat_archiver.c.
References fb(), and LWLockInitialize().
|
extern |
Definition at line 74 of file pgstat_archiver.c.
References PgStat_ShmemControl::archiver, fb(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), pgstat_copy_changecounted_stats(), pgStatLocal, and PgStat_LocalState::shmem.
Definition at line 89 of file pgstat_archiver.c.
References PgStat_ShmemControl::archiver, PgStat_Snapshot::archiver, fb(), LW_SHARED, LWLockAcquire(), LWLockRelease(), pgstat_copy_changecounted_stats(), pgStatLocal, reset(), PgStat_LocalState::shmem, and PgStat_LocalState::snapshot.
Definition at line 251 of file pgstat_shmem.c.
References Assert, PgStat_LocalState::dsa, dsa_attach_in_place(), dsa_pin_mapping(), dsh_params, dshash_attach(), fb(), PgStat_ShmemControl::hash_handle, MemoryContextSwitchTo(), pgStatLocal, PgStat_ShmemControl::raw_dsa_area, PgStat_LocalState::shared_hash, PgStat_LocalState::shmem, and TopMemoryContext.
Referenced by pgstat_initialize().
Definition at line 314 of file pgstat_backend.c.
References PGSTAT_BACKEND_FLUSH_ALL, and pgstat_flush_backend().
|
extern |
Definition at line 401 of file pgstat_backend.c.
Definition at line 906 of file pgstat_internal.h.
References CHECK_FOR_INTERRUPTS, fb(), and pg_read_barrier.
Referenced by pgstat_copy_changecounted_stats().
Definition at line 884 of file pgstat_internal.h.
References Assert, pg_write_barrier, and START_CRIT_SECTION.
Referenced by pgstat_report_archiver(), pgstat_report_bgwriter(), pgstat_report_checkpointer(), and test_custom_stats_fixed_update().
Definition at line 80 of file pgstat_bgwriter.c.
References fb(), and LWLockInitialize().
|
extern |
Definition at line 88 of file pgstat_bgwriter.c.
References PgStat_ShmemControl::bgwriter, fb(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), pgstat_copy_changecounted_stats(), pgStatLocal, and PgStat_LocalState::shmem.
Definition at line 103 of file pgstat_bgwriter.c.
References PgStat_ShmemControl::bgwriter, PgStat_Snapshot::bgwriter, BGWRITER_COMP, fb(), LW_SHARED, LWLockAcquire(), LWLockRelease(), pgstat_copy_changecounted_stats(), pgStatLocal, reset(), PgStat_LocalState::shmem, and PgStat_LocalState::snapshot.
Definition at line 89 of file pgstat_checkpointer.c.
References fb(), and LWLockInitialize().
|
extern |
Definition at line 97 of file pgstat_checkpointer.c.
References PgStat_ShmemControl::checkpointer, fb(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), pgstat_copy_changecounted_stats(), pgStatLocal, and PgStat_LocalState::shmem.
Definition at line 112 of file pgstat_checkpointer.c.
References PgStat_ShmemControl::checkpointer, PgStat_Snapshot::checkpointer, CHECKPOINTER_COMP, fb(), LW_SHARED, LWLockAcquire(), LWLockRelease(), pgstat_copy_changecounted_stats(), pgStatLocal, reset(), PgStat_LocalState::shmem, and PgStat_LocalState::snapshot.
|
inlinestatic |
Definition at line 961 of file pgstat_internal.h.
|
inlinestatic |
Definition at line 945 of file pgstat_internal.h.
References fb(), len, pgstat_begin_changecount_read(), and pgstat_end_changecount_read().
Referenced by pgstat_archiver_reset_all_cb(), pgstat_archiver_snapshot_cb(), pgstat_bgwriter_reset_all_cb(), pgstat_bgwriter_snapshot_cb(), pgstat_checkpointer_reset_all_cb(), pgstat_checkpointer_snapshot_cb(), test_custom_stats_fixed_reset_all_cb(), and test_custom_stats_fixed_snapshot_cb().
|
extern |
Definition at line 361 of file pgstat_xact.c.
References create_drop_transactional_internal(), ereport, errmsg(), fb(), name, pgstat_get_entry_ref(), pgstat_get_kind_info(), pgstat_reset(), and WARNING.
Referenced by pgstat_create_function(), pgstat_create_relation(), and pgstat_create_subscription().
|
extern |
Definition at line 428 of file pgstat_database.c.
References Assert, fb(), PgStat_EntryRef::pending, PGSTAT_ACCUM_DBCOUNT, pgstat_lock_entry(), pgstat_unlock_entry(), and PgStat_EntryRef::shared_stats.
|
extern |
Definition at line 493 of file pgstat_database.c.
|
extern |
Definition at line 1326 of file pgstat.c.
References Assert, dlist_delete(), fb(), PgStatShared_HashEntry::key, PgStat_HashKey::kind, PgStat_EntryRef::pending, PgStat_EntryRef::pending_node, pfree(), pgstat_get_kind_info(), PgStat_Kind, and PgStat_EntryRef::shared_entry.
Referenced by pgstat_flush_pending_entries(), and pgstat_release_entry_ref().
Definition at line 272 of file pgstat_shmem.c.
References Assert, PgStat_LocalState::dsa, dsa_detach(), dsa_release_in_place(), dshash_detach(), fb(), pgstat_release_all_entry_refs(), pgStatLocal, PgStat_ShmemControl::raw_dsa_area, PgStat_LocalState::shared_hash, and PgStat_LocalState::shmem.
Referenced by pgstat_shutdown_hook().
Definition at line 1090 of file pgstat_shmem.c.
References fb(), and pgstat_drop_matching_entries().
Referenced by pgstat_reset_after_failure().
|
extern |
Definition at line 1004 of file pgstat_shmem.c.
References dshash_find(), fb(), pgstat_drop_database_and_contents(), pgstat_drop_entry_internal(), PGSTAT_KIND_DATABASE, pgstat_release_entry_ref(), pgStatEntryRefHash, pgStatLocal, and PgStat_LocalState::shared_hash.
Referenced by AtEOSubXact_PgStat_DroppedStats(), AtEOXact_PgStat_DroppedStats(), pgstat_drop_replslot(), pgstat_execute_transactional_drops(), pgstat_init_function_usage(), pgstat_shutdown_hook(), and test_custom_stats_var_drop().
|
extern |
Definition at line 1049 of file pgstat_shmem.c.
References dshash_seq_init(), dshash_seq_next(), dshash_seq_term(), fb(), pgstat_drop_entry_internal(), pgstat_release_entry_ref(), pgstat_request_entry_refs_gc(), pgStatEntryRefHash, pgStatLocal, ps, and PgStat_LocalState::shared_hash.
Referenced by pgstat_drop_all_entries().
|
extern |
Definition at line 384 of file pgstat_xact.c.
References create_drop_transactional_internal().
Referenced by pgstat_drop_database(), pgstat_drop_function(), pgstat_drop_relation(), and pgstat_drop_subscription().
Definition at line 921 of file pgstat_internal.h.
References fb(), and pg_read_barrier.
Referenced by pgstat_copy_changecounted_stats().
Definition at line 894 of file pgstat_internal.h.
References Assert, END_CRIT_SECTION, and pg_write_barrier.
Referenced by pgstat_report_archiver(), pgstat_report_bgwriter(), pgstat_report_checkpointer(), and test_custom_stats_fixed_update().
|
extern |
Definition at line 944 of file pgstat.c.
References Assert, PgStat_Snapshot::context, PgStat_SnapshotEntry::data, PgStatShared_HashEntry::dropped, fb(), IsPostmasterEnvironment, IsUnderPostmaster, MemoryContextAlloc(), PgStat_Snapshot::mode, palloc(), pgstat_build_snapshot(), pgstat_fetch_consistency, PGSTAT_FETCH_CONSISTENCY_CACHE, PGSTAT_FETCH_CONSISTENCY_NONE, PGSTAT_FETCH_CONSISTENCY_SNAPSHOT, pgstat_get_entry_data(), pgstat_get_entry_ref(), pgstat_get_kind_info(), pgstat_lock_entry_shared(), pgstat_prep_snapshot(), pgstat_unlock_entry(), pgStatLocal, PgStat_EntryRef::shared_entry, PgStat_EntryRef::shared_stats, PgStat_LocalState::snapshot, and PgStat_Snapshot::stats.
Referenced by pgstat_fetch_replslot(), pgstat_fetch_stat_backend(), pgstat_fetch_stat_dbentry(), pgstat_fetch_stat_funcentry(), pgstat_fetch_stat_subscription(), pgstat_fetch_stat_tabentry_ext(), and test_custom_stats_var_fetch_entry().
|
extern |
Definition at line 1313 of file pgstat.c.
References fb(), PgStat_EntryRef::pending, and pgstat_get_entry_ref().
Referenced by find_funcstat_entry(), and find_tabstat_entry().
Definition at line 271 of file pgstat_backend.c.
References backend_has_iostats, fb(), InvalidOid, MyBackendType, MyProcNumber, PGSTAT_BACKEND_FLUSH_IO, PGSTAT_BACKEND_FLUSH_WAL, pgstat_backend_wal_have_pending(), pgstat_flush_backend_entry_io(), pgstat_flush_backend_entry_wal(), pgstat_get_entry_ref_locked(), PGSTAT_KIND_BACKEND, pgstat_tracks_backend_bktype(), and pgstat_unlock_entry().
Referenced by pgstat_backend_flush_cb(), pgstat_report_analyze(), pgstat_report_vacuum(), pgstat_report_wal(), WalSndLoop(), and WalSndWaitForWal().
Definition at line 175 of file pgstat_io.c.
References fb(), and pgstat_io_flush_cb().
Referenced by pgstat_report_analyze(), pgstat_report_bgwriter(), pgstat_report_checkpointer(), pgstat_report_vacuum(), pgstat_report_wal(), WalSndLoop(), and WalSndWaitForWal().
|
extern |
Definition at line 193 of file pgstat_function.c.
References fb(), INSTR_TIME_GET_MICROSEC, PgStat_EntryRef::pending, pgstat_lock_entry(), pgstat_unlock_entry(), and PgStat_EntryRef::shared_stats.
|
extern |
Definition at line 218 of file pgstat_function.c.
|
inlinestatic |
Definition at line 1015 of file pgstat_internal.h.
References Assert, PgStat_ShmemControl::custom_data, idx(), pgstat_get_kind_info(), pgstat_is_kind_custom(), PGSTAT_KIND_CUSTOM_MIN, pgStatLocal, and PgStat_LocalState::shmem.
Referenced by test_custom_stats_fixed_reset_all_cb(), test_custom_stats_fixed_snapshot_cb(), and test_custom_stats_fixed_update().
|
inlinestatic |
Definition at line 1030 of file pgstat_internal.h.
References Assert, PgStat_Snapshot::custom_data, idx(), pgstat_get_kind_info(), pgstat_is_kind_custom(), PGSTAT_KIND_CUSTOM_MIN, pgStatLocal, and PgStat_LocalState::snapshot.
Referenced by test_custom_stats_fixed_report(), and test_custom_stats_fixed_snapshot_cb().
|
inlinestatic |
Definition at line 1003 of file pgstat_internal.h.
References Assert, PgStat_ShmemControl::entry_counts, pg_atomic_read_u64(), pgstat_get_kind_info(), pgStatLocal, and PgStat_LocalState::shmem.
|
inlinestatic |
Definition at line 990 of file pgstat_internal.h.
References Assert, PG_UINT32_MAX, pgstat_get_kind_info(), and PgStat_KindInfo::shared_data_off.
Referenced by pgstat_build_snapshot(), pgstat_fetch_entry(), pgstat_read_statsfile(), pgstat_reinit_entry(), pgstat_write_statsfile(), and shared_stat_reset_contents().
|
inlinestatic |
Definition at line 981 of file pgstat_internal.h.
References pgstat_get_kind_info(), and PgStat_KindInfo::shared_data_len.
Referenced by pgstat_build_snapshot(), pgstat_read_statsfile(), pgstat_reinit_entry(), pgstat_write_statsfile(), and shared_stat_reset_contents().
|
extern |
Definition at line 469 of file pgstat_shmem.c.
References Assert, PgStat_LocalState::dsa, dsa_get_address(), dshash_delete_entry(), dshash_find(), dshash_find_or_insert(), dshash_release_lock(), ereport, errcode(), errdetail(), errmsg(), ERROR, fb(), PgStat_ShmemControl::is_shutdown, pgstat_acquire_entry_ref(), pgstat_assert_is_up, pgstat_gc_entry_refs(), pgstat_get_entry_ref_cached(), pgstat_init_entry(), pgstat_need_entry_refs_gc(), pgstat_reinit_entry(), pgstat_release_entry_ref(), pgstat_setup_memcxt(), pgstat_setup_shared_refs(), pgStatLocal, PgStat_LocalState::shared_hash, and PgStat_LocalState::shmem.
Referenced by pgstat_acquire_replslot(), pgstat_create_subscription(), pgstat_create_transactional(), pgstat_fetch_entry(), pgstat_fetch_pending_entry(), pgstat_get_entry_ref_locked(), pgstat_have_entry(), pgstat_prep_pending_entry(), pgstat_prepare_report_checksum_failure(), pgstat_report_checksum_failures_in_db(), pgstat_reset_entry(), and test_custom_stats_var_report().
|
extern |
Definition at line 729 of file pgstat_shmem.c.
References fb(), pgstat_get_entry_ref(), and pgstat_lock_entry().
Referenced by pgstat_copy_relation_stats(), pgstat_create_backend(), pgstat_create_replslot(), pgstat_flush_backend(), pgstat_report_analyze(), pgstat_report_autovac(), pgstat_report_replslot(), pgstat_report_replslotsync(), pgstat_report_vacuum(), pgstat_reset_database_timestamp(), and test_custom_stats_var_create().
|
extern |
Definition at line 1445 of file pgstat.c.
References fb(), idx(), pgstat_is_kind_builtin(), pgstat_is_kind_custom(), pgstat_kind_builtin_infos, pgstat_kind_custom_infos, and PGSTAT_KIND_CUSTOM_MIN.
Referenced by pgstat_build_snapshot(), pgstat_build_snapshot_fixed(), pgstat_create_transactional(), pgstat_delete_pending_entry(), pgstat_discard_stats(), pgstat_drop_entry_internal(), pgstat_fetch_entry(), pgstat_flush_pending_entries(), pgstat_free_entry(), pgstat_get_custom_shmem_data(), pgstat_get_custom_snapshot_data(), pgstat_get_entry_count(), pgstat_get_entry_data(), pgstat_get_entry_len(), pgstat_have_entry(), pgstat_init_entry(), pgstat_init_snapshot_fixed(), pgstat_initialize(), pgstat_prep_pending_entry(), pgstat_read_statsfile(), pgstat_report_stat(), pgstat_reset(), pgstat_reset_after_failure(), pgstat_reset_entry(), pgstat_reset_of_kind(), pgstat_snapshot_fixed(), pgstat_write_statsfile(), shared_stat_reset_contents(), StatsShmemInit(), and StatsShmemSize().
|
extern |
Definition at line 238 of file pgstat_xact.c.
References dclist_init(), fb(), PgStat_SubXactStatus::first, MemoryContextAlloc(), PgStat_SubXactStatus::nest_level, PgStat_SubXactStatus::pending_drops, pgStatXactStack, PgStat_SubXactStatus::prev, and TopTransactionContext.
Referenced by add_tabstat_xact_level(), AtEOSubXact_PgStat_DroppedStats(), AtEOSubXact_PgStat_Relations(), and create_drop_transactional_internal().
Definition at line 968 of file pgstat_internal.h.
References arg, Assert, fasthash32(), and fb().
|
extern |
Definition at line 308 of file pgstat_shmem.c.
References PgStat_LocalState::dsa, DSA_ALLOC_NO_OOM, DSA_ALLOC_ZERO, dsa_allocate_extended(), dsa_get_address(), PgStat_ShmemControl::entry_counts, fb(), InvalidDsaPointer, LWLockInitialize(), pg_atomic_fetch_add_u64(), pg_atomic_init_u32(), pgstat_get_kind_info(), pgStatLocal, and PgStat_LocalState::shmem.
Referenced by pgstat_get_entry_ref(), and pgstat_read_statsfile().
Definition at line 189 of file pgstat_io.c.
References Assert, PgStat_PendingIO::bytes, PgStat_PendingIO::counts, fb(), have_iostats, INSTR_TIME_GET_MICROSEC, PgStat_ShmemControl::io, IOCONTEXT_NUM_TYPES, IOOBJECT_NUM_TYPES, IOOP_NUM_TYPES, PgStatShared_IO::locks, LW_EXCLUSIVE, LWLockAcquire(), LWLockConditionalAcquire(), LWLockRelease(), MyBackendType, PgStat_PendingIO::pending_times, PendingIOStats, pgstat_bktype_io_stats_valid(), pgStatLocal, PgStat_LocalState::shmem, PgStat_IO::stats, and PgStatShared_IO::stats.
Referenced by pgstat_flush_io().
Definition at line 278 of file pgstat_io.c.
References BACKEND_NUM_TYPES, fb(), i, and LWLockInitialize().
|
extern |
Definition at line 287 of file pgstat_io.c.
References BACKEND_NUM_TYPES, fb(), i, PgStat_ShmemControl::io, PgStatShared_IO::locks, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), pgStatLocal, PgStat_LocalState::shmem, PgStat_IO::stat_reset_timestamp, PgStat_IO::stats, and PgStatShared_IO::stats.
Definition at line 309 of file pgstat_io.c.
References BACKEND_NUM_TYPES, fb(), i, PgStat_ShmemControl::io, PgStat_Snapshot::io, PgStatShared_IO::locks, LW_SHARED, LWLockAcquire(), LWLockRelease(), pgStatLocal, PgStat_LocalState::shmem, PgStat_LocalState::snapshot, PgStat_IO::stat_reset_timestamp, PgStat_IO::stats, and PgStatShared_IO::stats.
|
extern |
Definition at line 690 of file pgstat_shmem.c.
References PgStatShared_Common::lock, LW_EXCLUSIVE, LWLockAcquire(), LWLockConditionalAcquire(), and PgStat_EntryRef::shared_stats.
Referenced by pgstat_database_flush_cb(), pgstat_function_flush_cb(), pgstat_get_entry_ref_locked(), pgstat_relation_flush_cb(), pgstat_report_checksum_failures_in_db(), pgstat_reset_entry(), pgstat_subscription_flush_cb(), and test_custom_stats_var_flush_pending_cb().
|
extern |
Definition at line 708 of file pgstat_shmem.c.
References PgStatShared_Common::lock, LW_SHARED, LWLockAcquire(), LWLockConditionalAcquire(), and PgStat_EntryRef::shared_stats.
Referenced by pgstat_fetch_entry().
|
extern |
Definition at line 386 of file pgstat_database.c.
References Assert, fb(), InvalidOid, MyDatabaseId, OidIsValid, PgStat_EntryRef::pending, PGSTAT_KIND_DATABASE, and pgstat_prep_pending_entry().
Referenced by pgstat_relation_flush_cb(), pgstat_report_connect(), pgstat_report_deadlock(), pgstat_report_disconnect(), pgstat_report_recovery_conflict(), pgstat_report_tempfile(), pgstat_update_dbstats(), and pgstat_update_parallel_workers_stats().
|
extern |
Definition at line 1275 of file pgstat.c.
References ALLOCSET_SMALL_SIZES, AllocSetContextCreate, Assert, dlist_push_tail(), fb(), MemoryContextAllocZero(), PgStat_EntryRef::pending, PgStat_EntryRef::pending_node, PgStat_KindInfo::pending_size, pgstat_get_entry_ref(), pgstat_get_kind_info(), pgStatPending, pgStatPendingContext, TopMemoryContext, and unlikely.
Referenced by pgstat_init_function_usage(), pgstat_prep_database_pending(), pgstat_prep_relation_pending(), pgstat_report_subscription_conflict(), pgstat_report_subscription_error(), and test_custom_stats_var_update().
Definition at line 1763 of file pgstat.c.
Referenced by pgstat_read_statsfile(), and test_custom_stats_var_from_serialized_data().
|
extern |
Definition at line 1473 of file pgstat.c.
References ereport, errdetail(), errhint(), errmsg(), ERROR, fb(), idx(), LOG, MemoryContextAllocZero(), name, PgStat_KindInfo::name, pg_strcasecmp(), pgstat_is_kind_custom(), PgStat_Kind, pgstat_kind_custom_infos, PGSTAT_KIND_CUSTOM_MAX, PGSTAT_KIND_CUSTOM_MIN, PGSTAT_KIND_CUSTOM_SIZE, process_shared_preload_libraries_in_progress, and TopMemoryContext.
Referenced by _PG_init().
|
extern |
Definition at line 904 of file pgstat_relation.c.
References PgStat_EntryRef::pending, pgstat_unlink_relation(), and PgStat_TableStatus::relation.
|
extern |
Definition at line 815 of file pgstat_relation.c.
References PgStat_HashKey::dboid, fb(), GetCurrentTransactionStopTimestamp(), PgStatShared_HashEntry::key, Max, PgStat_EntryRef::pending, pg_memory_is_all_zeros(), pgstat_lock_entry(), pgstat_prep_database_pending(), pgstat_unlock_entry(), PgStat_EntryRef::shared_entry, and PgStat_EntryRef::shared_stats.
|
extern |
Definition at line 913 of file pgstat_relation.c.
|
extern |
Definition at line 232 of file pgstat_replslot.c.
References get_replslot_index(), idx(), InvalidOid, name, NameStr, and PGSTAT_KIND_REPLSLOT.
|
extern |
Definition at line 248 of file pgstat_replslot.c.
|
extern |
Definition at line 219 of file pgstat_replslot.c.
References elog, ERROR, fb(), name, and ReplicationSlotName().
Definition at line 244 of file pgstat_database.c.
References DISCONNECT_CLIENT_EOF, DISCONNECT_FATAL, DISCONNECT_KILLED, DISCONNECT_NORMAL, DISCONNECT_NOT_YET, fb(), MyDatabaseId, pgstat_prep_database_pending(), pgstat_should_report_connstat(), and pgStatSessionEndCause.
Referenced by pgstat_shutdown_hook().
Definition at line 745 of file pgstat_shmem.c.
References PgStat_ShmemControl::gc_request_count, pg_atomic_fetch_add_u64(), pgStatLocal, and PgStat_LocalState::shmem.
Referenced by AtEOSubXact_PgStat_DroppedStats(), AtEOXact_PgStat_DroppedStats(), pgstat_drop_database_and_contents(), pgstat_drop_matching_entries(), pgstat_drop_replslot(), pgstat_execute_transactional_drops(), pgstat_shutdown_hook(), and test_custom_stats_var_drop().
|
extern |
Definition at line 407 of file pgstat_database.c.
References fb(), InvalidOid, MyDatabaseId, pgstat_get_entry_ref_locked(), PGSTAT_KIND_DATABASE, and pgstat_unlock_entry().
Referenced by pgstat_reset().
|
extern |
Definition at line 1168 of file pgstat_shmem.c.
References Int32GetDatum(), match_kind(), and pgstat_reset_matching_entries().
Referenced by pgstat_reset_of_kind().
|
extern |
Definition at line 1112 of file pgstat_shmem.c.
References Assert, PgStatShared_HashEntry::dropped, fb(), pgstat_get_entry_ref(), pgstat_get_kind_info(), pgstat_lock_entry(), pgstat_unlock_entry(), PgStat_EntryRef::shared_entry, shared_stat_reset_contents(), and PgStat_EntryRef::shared_stats.
Referenced by pgstat_create_subscription(), and pgstat_reset().
|
extern |
Definition at line 1132 of file pgstat_shmem.c.
References PgStatShared_HashEntry::body, PgStatShared_HashEntry::dropped, PgStat_LocalState::dsa, dsa_get_address(), dshash_seq_init(), dshash_seq_next(), dshash_seq_term(), fb(), PgStatShared_HashEntry::key, PgStat_HashKey::kind, PgStatShared_Common::lock, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), pgStatLocal, PgStat_LocalState::shared_hash, and shared_stat_reset_contents().
Referenced by pgstat_reset_counters(), and pgstat_reset_entries_of_kind().
Definition at line 142 of file pgstat_slru.c.
References blocks_written, fb(), have_slrustats, i, LW_EXCLUSIVE, LWLockAcquire(), LWLockConditionalAcquire(), LWLockRelease(), MemSet, pending_SLRUStats, pgStatLocal, PgStat_LocalState::shmem, PgStat_ShmemControl::slru, SLRU_ACC, and SLRU_NUM_ELEMENTS.
Definition at line 182 of file pgstat_slru.c.
References fb(), and LWLockInitialize().
|
extern |
Definition at line 190 of file pgstat_slru.c.
References i, pgstat_reset_slru_counter_internal(), and SLRU_NUM_ELEMENTS.
Definition at line 197 of file pgstat_slru.c.
References fb(), LW_SHARED, LWLockAcquire(), LWLockRelease(), pgStatLocal, PgStat_LocalState::shmem, PgStat_ShmemControl::slru, PgStat_Snapshot::slru, and PgStat_LocalState::snapshot.
|
extern |
Definition at line 1070 of file pgstat.c.
References Assert, PgStat_Snapshot::custom_valid, PgStat_Snapshot::fixed_valid, force_stats_snapshot_clear, pgstat_build_snapshot(), pgstat_build_snapshot_fixed(), pgstat_clear_snapshot(), pgstat_fetch_consistency, PGSTAT_FETCH_CONSISTENCY_SNAPSHOT, pgstat_get_kind_info(), pgstat_is_kind_builtin(), pgstat_is_kind_custom(), pgstat_is_kind_valid(), PGSTAT_KIND_CUSTOM_MIN, pgStatLocal, and PgStat_LocalState::snapshot.
Referenced by pgstat_fetch_slru(), pgstat_fetch_stat_archiver(), pgstat_fetch_stat_bgwriter(), pgstat_fetch_stat_checkpointer(), pgstat_fetch_stat_io(), pgstat_fetch_stat_wal(), and test_custom_stats_fixed_report().
|
extern |
Definition at line 119 of file pgstat_subscription.c.
References CONFLICT_NUM_TYPES, fb(), i, PgStat_EntryRef::pending, pgstat_lock_entry(), pgstat_unlock_entry(), PgStat_EntryRef::shared_stats, and SUB_ACC.
|
extern |
Definition at line 145 of file pgstat_subscription.c.
|
extern |
Definition at line 720 of file pgstat_shmem.c.
References PgStatShared_Common::lock, LWLockRelease(), and PgStat_EntryRef::shared_stats.
Referenced by pgstat_copy_relation_stats(), pgstat_create_backend(), pgstat_create_replslot(), pgstat_database_flush_cb(), pgstat_fetch_entry(), pgstat_flush_backend(), pgstat_function_flush_cb(), pgstat_relation_flush_cb(), pgstat_report_analyze(), pgstat_report_autovac(), pgstat_report_checksum_failures_in_db(), pgstat_report_replslot(), pgstat_report_replslotsync(), pgstat_report_vacuum(), pgstat_reset_database_timestamp(), pgstat_reset_entry(), pgstat_subscription_flush_cb(), test_custom_stats_var_create(), and test_custom_stats_var_flush_pending_cb().
|
extern |
Definition at line 323 of file pgstat_database.c.
References fb(), MyDatabaseId, OidIsValid, pgLastSessionReportTime, pgstat_prep_database_pending(), pgstat_should_report_connstat(), pgStatActiveTime, pgStatBlockReadTime, pgStatBlockWriteTime, pgStatTransactionIdleTime, pgStatXactCommit, pgStatXactRollback, and TimestampDifference().
Referenced by pgstat_report_stat().
Definition at line 91 of file pgstat_wal.c.
References Assert, fb(), PgStat_ShmemControl::is_shutdown, IsPostmasterEnvironment, IsUnderPostmaster, LW_EXCLUSIVE, LWLockAcquire(), LWLockConditionalAcquire(), LWLockRelease(), pgstat_wal_have_pending(), pgStatLocal, pgWalUsage, prevWalUsage, PgStat_LocalState::shmem, PgStat_ShmemControl::wal, WALSTAT_ACC, and WalUsageAccumDiff().
Referenced by pgstat_report_wal().
Definition at line 139 of file pgstat_wal.c.
References pgWalUsage, and prevWalUsage.
|
extern |
Definition at line 158 of file pgstat_wal.c.
References fb(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), pgStatLocal, PgStat_LocalState::shmem, and PgStat_ShmemControl::wal.
Definition at line 169 of file pgstat_wal.c.
References fb(), LW_SHARED, LWLockAcquire(), LWLockRelease(), pgStatLocal, PgStat_LocalState::shmem, PgStat_LocalState::snapshot, PgStat_ShmemControl::wal, and PgStat_Snapshot::wal.
Definition at line 1565 of file pgstat.c.
Referenced by pgstat_write_statsfile(), and test_custom_stats_var_to_serialized_data().
|
extern |
Definition at line 727 of file pgstat_relation.c.
References fb(), PgStat_SubXactStatus::first, PgStat_TableStatus::trans, and trans.
Referenced by PostPrepare_PgStat().
| StaticAssertDecl | ( | (sizeof(PgStat_Kind)+sizeof(uint64)+sizeof(Oid)) | = =sizeof(PgStat_HashKey), |
| "PgStat_HashKey should have no padding" | |||
| ) |
|
extern |
Definition at line 218 of file pgstat.c.
Referenced by AdvanceXLInsertBuffer(), get_slru_entry(), pgstat_count_backend_io_op(), pgstat_count_backend_io_op_time(), pgstat_count_io_op(), pgstat_report_stat(), and XLogInsertRecord().
|
extern |
Definition at line 212 of file pgstat.c.
Referenced by pgstat_acquire_entry_ref(), pgstat_archiver_reset_all_cb(), pgstat_archiver_snapshot_cb(), pgstat_attach_shmem(), pgstat_before_server_shutdown(), pgstat_bgwriter_reset_all_cb(), pgstat_bgwriter_snapshot_cb(), pgstat_build_snapshot(), pgstat_build_snapshot_fixed(), pgstat_checkpointer_reset_all_cb(), pgstat_checkpointer_snapshot_cb(), pgstat_clear_snapshot(), pgstat_detach_shmem(), pgstat_drop_database_and_contents(), pgstat_drop_entry(), pgstat_drop_entry_internal(), pgstat_drop_matching_entries(), pgstat_fetch_entry(), pgstat_fetch_slru(), pgstat_fetch_stat_archiver(), pgstat_fetch_stat_bgwriter(), pgstat_fetch_stat_checkpointer(), pgstat_fetch_stat_io(), pgstat_fetch_stat_wal(), pgstat_free_entry(), pgstat_gc_entry_refs(), pgstat_get_custom_shmem_data(), pgstat_get_custom_snapshot_data(), pgstat_get_entry_count(), pgstat_get_entry_ref(), pgstat_get_stat_snapshot_timestamp(), pgstat_init_entry(), pgstat_init_snapshot_fixed(), pgstat_io_flush_cb(), pgstat_io_reset_all_cb(), pgstat_io_snapshot_cb(), pgstat_need_entry_refs_gc(), pgstat_prep_snapshot(), pgstat_read_statsfile(), pgstat_reinit_entry(), pgstat_release_entry_ref(), pgstat_report_archiver(), pgstat_report_bgwriter(), pgstat_report_checkpointer(), pgstat_report_stat(), pgstat_request_entry_refs_gc(), pgstat_reset_matching_entries(), pgstat_reset_slru_counter_internal(), pgstat_setup_shared_refs(), pgstat_slru_flush_cb(), pgstat_slru_snapshot_cb(), pgstat_snapshot_fixed(), pgstat_wal_flush_cb(), pgstat_wal_reset_all_cb(), pgstat_wal_snapshot_cb(), pgstat_write_statsfile(), and StatsShmemInit().
Definition at line 395 of file pgstat_internal.h.
Referenced by pgstat_get_slru_index(), and pgstat_get_slru_name().