10#ifndef BACKEND_STATUS_H
11#define BACKEND_STATUS_H
205#define PGSTAT_BEGIN_WRITE_ACTIVITY(beentry) \
207 START_CRIT_SECTION(); \
208 (beentry)->st_changecount++; \
209 pg_write_barrier(); \
212#define PGSTAT_END_WRITE_ACTIVITY(beentry) \
214 pg_write_barrier(); \
215 (beentry)->st_changecount++; \
216 Assert(((beentry)->st_changecount & 1) == 0); \
217 END_CRIT_SECTION(); \
220#define pgstat_begin_read_activity(beentry, before_changecount) \
222 (before_changecount) = (beentry)->st_changecount; \
226#define pgstat_end_read_activity(beentry, after_changecount) \
229 (after_changecount) = (beentry)->st_changecount; \
232#define pgstat_read_activity_complete(before_changecount, after_changecount) \
233 ((before_changecount) == (after_changecount) && \
234 ((before_changecount) & 1) == 0)
Datum idx(PG_FUNCTION_ARGS)
#define PGSTAT_NUM_PROGRESS_PARAM
int pgstat_fetch_stat_numbackends(void)
uint64 pgstat_get_my_query_id(void)
struct PgBackendGSSStatus PgBackendGSSStatus
LocalPgBackendStatus * pgstat_get_local_beentry_by_proc_number(ProcNumber procNumber)
void pgstat_clear_backend_activity_snapshot(void)
struct PgBackendSSLStatus PgBackendSSLStatus
PGDLLIMPORT bool pgstat_track_activities
PGDLLIMPORT PgBackendStatus * MyBEEntry
char * pgstat_clip_activity(const char *raw_activity)
struct LocalPgBackendStatus LocalPgBackendStatus
@ STATE_IDLEINTRANSACTION_ABORTED
@ STATE_IDLEINTRANSACTION
const char * pgstat_get_crashed_backend_activity(int pid, char *buffer, int buflen)
void BackendStatusShmemInit(void)
PGDLLIMPORT int pgstat_track_activity_query_size
LocalPgBackendStatus * pgstat_get_local_beentry_by_index(int idx)
void pgstat_report_query_id(uint64 query_id, bool force)
struct PgBackendStatus PgBackendStatus
void pgstat_report_activity(BackendState state, const char *cmd_str)
BackendType pgstat_get_backend_type_by_proc_number(ProcNumber procNumber)
void pgstat_report_xact_timestamp(TimestampTz tstamp)
PgBackendStatus * pgstat_get_beentry_by_proc_number(ProcNumber procNumber)
Size BackendStatusShmemSize(void)
void pgstat_report_appname(const char *appname)
const char * pgstat_get_backend_current_activity(int pid, bool checkUser)
void pgstat_bestart(void)
void pgstat_report_tempfile(size_t filesize)
TransactionId backend_xid
PgBackendStatus backendStatus
int backend_subxact_count
TransactionId backend_xmin
bool backend_subxact_overflowed
char gss_princ[NAMEDATALEN]
char ssl_version[NAMEDATALEN]
char ssl_cipher[NAMEDATALEN]
char ssl_client_dn[NAMEDATALEN]
char ssl_client_serial[NAMEDATALEN]
char ssl_issuer_dn[NAMEDATALEN]
BackendType st_backendType
TimestampTz st_state_start_timestamp
TimestampTz st_proc_start_timestamp
PgBackendGSSStatus * st_gssstatus
TimestampTz st_activity_start_timestamp
ProgressCommandType st_progress_command
int64 st_progress_param[PGSTAT_NUM_PROGRESS_PARAM]
PgBackendSSLStatus * st_sslstatus
TimestampTz st_xact_start_timestamp
Oid st_progress_command_target