PostgreSQL Source Code git master
|
#include "postgres.h"
#include "executor/instrument.h"
#include "storage/bufmgr.h"
#include "utils/pgstat_internal.h"
Go to the source code of this file.
Variables | |
static PgStat_PendingIO | PendingIOStats |
static bool | have_iostats = false |
bool pgstat_bktype_io_stats_valid | ( | PgStat_BktypeIO * | backend_io, |
BackendType | bktype | ||
) |
Definition at line 37 of file pgstat_io.c.
References PgStat_BktypeIO::counts, IOCONTEXT_NUM_TYPES, IOOBJECT_NUM_TYPES, IOOP_NUM_TYPES, pgstat_tracks_io_op(), and PgStat_BktypeIO::times.
Referenced by pg_stat_get_backend_io(), pg_stat_get_io(), and pgstat_io_flush_cb().
void pgstat_count_io_op | ( | IOObject | io_object, |
IOContext | io_context, | ||
IOOp | io_op, | ||
uint32 | cnt, | ||
uint64 | bytes | ||
) |
Definition at line 68 of file pgstat_io.c.
References Assert, PgStat_PendingIO::bytes, PgStat_PendingIO::counts, have_iostats, IOCONTEXT_NUM_TYPES, IOOBJECT_NUM_TYPES, MyBackendType, MyProcNumber, PgStat_BackendPending::pending_io, PendingIOStats, pgstat_is_ioop_tracked_in_bytes, pgstat_prep_backend_pending(), pgstat_tracks_backend_bktype(), and pgstat_tracks_io_op().
Referenced by GetLocalVictimBuffer(), GetVictimBuffer(), pgstat_count_io_op_time(), and PinBufferForBlock().
void pgstat_count_io_op_time | ( | IOObject | io_object, |
IOContext | io_context, | ||
IOOp | io_op, | ||
instr_time | start_time, | ||
uint32 | cnt, | ||
uint64 | bytes | ||
) |
Definition at line 118 of file pgstat_io.c.
References INSTR_TIME_ADD, INSTR_TIME_GET_MICROSEC, INSTR_TIME_SET_CURRENT, INSTR_TIME_SUBTRACT, IOOBJECT_RELATION, IOOBJECT_TEMP_RELATION, IOOP_EXTEND, IOOP_READ, IOOP_WRITE, BufferUsage::local_blk_read_time, BufferUsage::local_blk_write_time, MyBackendType, MyProcNumber, PgStat_BackendPending::pending_io, PgStat_PendingIO::pending_times, PendingIOStats, pgBufferUsage, pgstat_count_buffer_read_time, pgstat_count_buffer_write_time, pgstat_count_io_op(), pgstat_prep_backend_pending(), pgstat_tracks_backend_bktype(), BufferUsage::shared_blk_read_time, BufferUsage::shared_blk_write_time, start_time, and track_io_timing.
Referenced by ExtendBufferedRelLocal(), ExtendBufferedRelShared(), FlushBuffer(), FlushRelationBuffers(), GetLocalVictimBuffer(), IssuePendingWritebacks(), mdsyncfiletag(), register_dirty_segment(), and WaitReadBuffers().
PgStat_IO * pgstat_fetch_stat_io | ( | void | ) |
Definition at line 162 of file pgstat_io.c.
References PgStat_Snapshot::io, PGSTAT_KIND_IO, pgstat_snapshot_fixed(), pgStatLocal, and PgStat_LocalState::snapshot.
Referenced by pg_stat_get_io().
void pgstat_flush_io | ( | bool | nowait | ) |
Definition at line 182 of file pgstat_io.c.
References pgstat_io_flush_cb().
Referenced by pgstat_report_analyze(), pgstat_report_bgwriter(), pgstat_report_checkpointer(), pgstat_report_vacuum(), and pgstat_report_wal().
const char * pgstat_get_io_context_name | ( | IOContext | io_context | ) |
Definition at line 247 of file pgstat_io.c.
References elog, ERROR, IOCONTEXT_BULKREAD, IOCONTEXT_BULKWRITE, IOCONTEXT_NORMAL, IOCONTEXT_VACUUM, and pg_unreachable.
Referenced by pg_stat_io_build_tuples().
const char * pgstat_get_io_object_name | ( | IOObject | io_object | ) |
Definition at line 266 of file pgstat_io.c.
References elog, ERROR, IOOBJECT_RELATION, IOOBJECT_TEMP_RELATION, and pg_unreachable.
Referenced by pg_stat_io_build_tuples().
bool pgstat_io_flush_cb | ( | bool | nowait | ) |
Definition at line 196 of file pgstat_io.c.
References Assert, PgStat_BktypeIO::bytes, PgStat_PendingIO::bytes, PgStat_BktypeIO::counts, PgStat_PendingIO::counts, 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, PgStatShared_IO::stats, and PgStat_BktypeIO::times.
Referenced by pgstat_flush_io().
bool pgstat_io_have_pending_cb | ( | void | ) |
Definition at line 173 of file pgstat_io.c.
References have_iostats.
void pgstat_io_init_shmem_cb | ( | void * | stats | ) |
Definition at line 281 of file pgstat_io.c.
References BACKEND_NUM_TYPES, i, PgStatShared_IO::locks, LWLockInitialize(), and LWTRANCHE_PGSTATS_DATA.
void pgstat_io_reset_all_cb | ( | TimestampTz | ts | ) |
Definition at line 290 of file pgstat_io.c.
References BACKEND_NUM_TYPES, 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.
void pgstat_io_snapshot_cb | ( | void | ) |
Definition at line 312 of file pgstat_io.c.
References BACKEND_NUM_TYPES, 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.
instr_time pgstat_prepare_io_time | ( | bool | track_io_guc | ) |
Definition at line 96 of file pgstat_io.c.
References INSTR_TIME_SET_CURRENT, and INSTR_TIME_SET_ZERO.
Referenced by ExtendBufferedRelLocal(), ExtendBufferedRelShared(), FlushBuffer(), FlushRelationBuffers(), GetLocalVictimBuffer(), IssuePendingWritebacks(), mdsyncfiletag(), register_dirty_segment(), and WaitReadBuffers().
bool pgstat_tracks_io_bktype | ( | BackendType | bktype | ) |
Definition at line 356 of file pgstat_io.c.
References B_ARCHIVER, B_AUTOVAC_LAUNCHER, B_AUTOVAC_WORKER, B_BACKEND, B_BG_WORKER, B_BG_WRITER, B_CHECKPOINTER, B_DEAD_END_BACKEND, B_INVALID, B_LOGGER, B_SLOTSYNC_WORKER, B_STANDALONE_BACKEND, B_STARTUP, B_WAL_RECEIVER, B_WAL_SENDER, B_WAL_SUMMARIZER, and B_WAL_WRITER.
Referenced by pg_stat_get_io(), and pgstat_tracks_io_object().
bool pgstat_tracks_io_object | ( | BackendType | bktype, |
IOObject | io_object, | ||
IOContext | io_context | ||
) |
Definition at line 397 of file pgstat_io.c.
References B_AUTOVAC_LAUNCHER, B_AUTOVAC_WORKER, B_BG_WRITER, B_CHECKPOINTER, B_STANDALONE_BACKEND, B_STARTUP, IOCONTEXT_BULKREAD, IOCONTEXT_BULKWRITE, IOCONTEXT_NORMAL, IOCONTEXT_VACUUM, IOOBJECT_TEMP_RELATION, and pgstat_tracks_io_bktype().
Referenced by pg_stat_io_build_tuples(), and pgstat_tracks_io_op().
bool pgstat_tracks_io_op | ( | BackendType | bktype, |
IOObject | io_object, | ||
IOContext | io_context, | ||
IOOp | io_op | ||
) |
Definition at line 462 of file pgstat_io.c.
References B_AUTOVAC_LAUNCHER, B_BG_WRITER, B_CHECKPOINTER, IOCONTEXT_BULKREAD, IOCONTEXT_BULKWRITE, IOCONTEXT_VACUUM, IOOBJECT_TEMP_RELATION, IOOP_EVICT, IOOP_EXTEND, IOOP_FSYNC, IOOP_HIT, IOOP_READ, IOOP_REUSE, IOOP_WRITEBACK, and pgstat_tracks_io_object().
Referenced by pg_stat_io_build_tuples(), pgstat_bktype_io_stats_valid(), and pgstat_count_io_op().
|
static |
Definition at line 24 of file pgstat_io.c.
Referenced by pgstat_count_io_op(), pgstat_io_flush_cb(), and pgstat_io_have_pending_cb().
|
static |
Definition at line 23 of file pgstat_io.c.
Referenced by pgstat_count_io_op(), pgstat_count_io_op_time(), and pgstat_io_flush_cb().