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.
Data Structures | |
struct | PgStat_PendingIO |
Typedefs | |
typedef struct PgStat_PendingIO | PgStat_PendingIO |
Variables | |
static PgStat_PendingIO | PendingIOStats |
static bool | have_iostats = false |
typedef struct PgStat_PendingIO PgStat_PendingIO |
bool pgstat_bktype_io_stats_valid | ( | PgStat_BktypeIO * | backend_io, |
BackendType | bktype | ||
) |
Definition at line 46 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_io(), and pgstat_io_flush_cb().
Definition at line 77 of file pgstat_io.c.
References pgstat_count_io_op_n().
Referenced by GetLocalVictimBuffer(), GetVictimBuffer(), and PinBufferForBlock().
Definition at line 83 of file pgstat_io.c.
References Assert, PgStat_PendingIO::counts, have_iostats, IOCONTEXT_NUM_TYPES, IOOBJECT_NUM_TYPES, IOOP_NUM_TYPES, MyBackendType, PendingIOStats, and pgstat_tracks_io_op().
Referenced by pgstat_count_io_op(), and pgstat_count_io_op_time().
void pgstat_count_io_op_time | ( | IOObject | io_object, |
IOContext | io_context, | ||
IOOp | io_op, | ||
instr_time | start_time, | ||
uint32 | cnt | ||
) |
Definition at line 122 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, PgStat_PendingIO::pending_times, PendingIOStats, pgBufferUsage, pgstat_count_buffer_read_time, pgstat_count_buffer_write_time, pgstat_count_io_op_n(), 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 157 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 177 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 239 of file pgstat_io.c.
References elog, ERROR, IOCONTEXT_BULKREAD, IOCONTEXT_BULKWRITE, IOCONTEXT_NORMAL, IOCONTEXT_VACUUM, and pg_unreachable.
Referenced by pg_stat_get_io().
const char* pgstat_get_io_object_name | ( | IOObject | io_object | ) |
Definition at line 258 of file pgstat_io.c.
References elog, ERROR, IOOBJECT_RELATION, IOOBJECT_TEMP_RELATION, and pg_unreachable.
Referenced by pg_stat_get_io().
Definition at line 191 of file pgstat_io.c.
References Assert, PgStat_PendingIO::counts, PgStat_BktypeIO::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 168 of file pgstat_io.c.
References have_iostats.
void pgstat_io_init_shmem_cb | ( | void * | stats | ) |
Definition at line 273 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 282 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 304 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 100 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 346 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_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 386 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_get_io(), and pgstat_tracks_io_op().
bool pgstat_tracks_io_op | ( | BackendType | bktype, |
IOObject | io_object, | ||
IOContext | io_context, | ||
IOOp | io_op | ||
) |
Definition at line 451 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_get_io(), pgstat_bktype_io_stats_valid(), and pgstat_count_io_op_n().
Definition at line 32 of file pgstat_io.c.
Referenced by pgstat_count_io_op_n(), pgstat_io_flush_cb(), and pgstat_io_have_pending_cb().
|
static |
Definition at line 31 of file pgstat_io.c.
Referenced by pgstat_count_io_op_n(), pgstat_count_io_op_time(), and pgstat_io_flush_cb().