diff options
author | Mark Wong <mark@2ndQuadrant.com> | 2020-04-11 19:58:34 -0700 |
---|---|---|
committer | Mark Wong <mark@2ndQuadrant.com> | 2020-04-11 20:01:13 -0700 |
commit | b30a7244202c4d3cf9ded924650f9bf078341afe (patch) | |
tree | b09c9aa85e192a6c517f1d8bf7f4d7c08e9383eb | |
parent | 260c23952631e56937f9534c06de524f315d1a36 (diff) |
Force all machines to handle replication view
-rw-r--r-- | machine.h | 2 | ||||
-rw-r--r-- | machine/m_common.c | 3 | ||||
-rw-r--r-- | machine/m_linux.c | 3 | ||||
-rw-r--r-- | pg_top.c | 4 |
4 files changed, 5 insertions, 7 deletions
@@ -119,9 +119,7 @@ char *format_header(char *); char *format_next_io(caddr_t); #endif /* __linux__ */ char *format_next_process(caddr_t); -#ifdef __linux__ char *format_next_replication(caddr_t); -#endif /* __linux__ */ uid_t proc_owner(pid_t); void update_state(int *pgstate, char *state); void update_str(char **, char *); diff --git a/machine/m_common.c b/machine/m_common.c index dfee4ef..88c3377 100644 --- a/machine/m_common.c +++ b/machine/m_common.c @@ -24,6 +24,9 @@ char *procstatenames[] = " fastpath, ", " aborted, ", " disabled, ", NULL }; +char fmt_header_replication[] = +" PID USERNAME APPLICATION CLIENT STATE PRIMARY SENT WRITE FLUSH REPLAY SLAG WLAG FLAG RLAG"; + void update_state(int *pgstate, char *state) { diff --git a/machine/m_linux.c b/machine/m_linux.c index 362d684..ef515f5 100644 --- a/machine/m_linux.c +++ b/machine/m_linux.c @@ -169,9 +169,6 @@ static char fmt_header[] = char fmt_header_io[] = " PID IOPS IORPS IOWPS READS WRITES COMMAND"; -char fmt_header_replication[] = -" PID USERNAME APPLICATION CLIENT STATE PRIMARY SENT WRITE FLUSH REPLAY SLAG WLAG FLAG RLAG"; - /* these are names given to allowed sorting orders -- first is default */ static char *ordernames[] = { @@ -276,6 +276,7 @@ do_display(struct pg_top_context *pgtctx) (*d_process) (i, format_next_io_r(processes)); } break; +#endif /* __linux__ */ case MODE_REPLICATION: for (i = 0; i < active_procs; i++) { @@ -285,7 +286,6 @@ do_display(struct pg_top_context *pgtctx) (*d_process) (i, format_next_replication_r(processes)); } break; -#endif /* __linux__ */ case MODE_PROCESSES: default: for (i = 0; i < active_procs; i++) @@ -850,8 +850,8 @@ main(int argc, char *argv[]) pgtctx.header_options[0][MODE_PROCESSES] = format_header(uname_field); #ifdef __linux__ pgtctx.header_options[0][MODE_IO_STATS] = fmt_header_io; - pgtctx.header_options[0][MODE_REPLICATION] = fmt_header_replication; #endif /* __linux__ */ + pgtctx.header_options[0][MODE_REPLICATION] = fmt_header_replication; /* 1 corresponds to headers definitions when remotely connecting to pg */ pgtctx.header_options[1][MODE_PROCESSES] = format_header_r(uname_field); |