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 |
Functions | |
bool | pgstat_bktype_io_stats_valid (PgStat_BktypeIO *backend_io, BackendType bktype) |
void | pgstat_count_io_op (IOObject io_object, IOContext io_context, IOOp io_op) |
void | pgstat_count_io_op_n (IOObject io_object, IOContext io_context, IOOp io_op, uint32 cnt) |
instr_time | pgstat_prepare_io_time (void) |
void | pgstat_count_io_op_time (IOObject io_object, IOContext io_context, IOOp io_op, instr_time start_time, uint32 cnt) |
PgStat_IO * | pgstat_fetch_stat_io (void) |
bool | pgstat_flush_io (bool nowait) |
const char * | pgstat_get_io_context_name (IOContext io_context) |
const char * | pgstat_get_io_object_name (IOObject io_object) |
void | pgstat_io_reset_all_cb (TimestampTz ts) |
void | pgstat_io_snapshot_cb (void) |
bool | pgstat_tracks_io_bktype (BackendType bktype) |
bool | pgstat_tracks_io_object (BackendType bktype, IOObject io_object, IOContext io_context) |
bool | pgstat_tracks_io_op (BackendType bktype, IOObject io_object, IOContext io_context, IOOp io_op) |
Variables | |
static PgStat_PendingIO | PendingIOStats |
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_flush_io().
Definition at line 77 of file pgstat_io.c.
References pgstat_count_io_op_n().
Referenced by GetLocalVictimBuffer(), GetVictimBuffer(), and ReadBuffer_common().
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 112 of file pgstat_io.c.
References BufferUsage::blk_read_time, BufferUsage::blk_write_time, INSTR_TIME_ADD, INSTR_TIME_GET_MICROSEC, INSTR_TIME_SET_CURRENT, INSTR_TIME_SUBTRACT, IOOBJECT_RELATION, IOOP_READ, IOOP_WRITE, PgStat_PendingIO::pending_times, PendingIOStats, pgBufferUsage, pgstat_count_buffer_read_time, pgstat_count_buffer_write_time, pgstat_count_io_op_n(), start_time, and track_io_timing.
Referenced by ExtendBufferedRelLocal(), ExtendBufferedRelShared(), FlushBuffer(), FlushRelationBuffers(), GetLocalVictimBuffer(), IssuePendingWritebacks(), mdsyncfiletag(), ReadBuffer_common(), and register_dirty_segment().
PgStat_IO* pgstat_fetch_stat_io | ( | void | ) |
Definition at line 143 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().
Definition at line 159 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_report_analyze(), pgstat_report_bgwriter(), pgstat_report_checkpointer(), pgstat_report_stat(), pgstat_report_vacuum(), and pgstat_report_wal().
const char* pgstat_get_io_context_name | ( | IOContext | io_context | ) |
Definition at line 207 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 226 of file pgstat_io.c.
References elog(), ERROR, IOOBJECT_RELATION, IOOBJECT_TEMP_RELATION, and pg_unreachable.
Referenced by pg_stat_get_io().
void pgstat_io_reset_all_cb | ( | TimestampTz | ts | ) |
Definition at line 241 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 263 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 | ( | void | ) |
Definition at line 96 of file pgstat_io.c.
References INSTR_TIME_SET_CURRENT, INSTR_TIME_SET_ZERO, and track_io_timing.
Referenced by ExtendBufferedRelLocal(), ExtendBufferedRelShared(), FlushBuffer(), FlushRelationBuffers(), GetLocalVictimBuffer(), IssuePendingWritebacks(), mdsyncfiletag(), ReadBuffer_common(), and register_dirty_segment().
bool pgstat_tracks_io_bktype | ( | BackendType | bktype | ) |
Definition at line 304 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_STANDALONE_BACKEND, B_STARTUP, B_WAL_RECEIVER, B_WAL_SENDER, 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 342 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 407 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_flush_io(), and pgstat_report_stat().
|
static |
Definition at line 31 of file pgstat_io.c.
Referenced by pgstat_count_io_op_n(), pgstat_count_io_op_time(), and pgstat_flush_io().