delimited by a line feed character ('\n' or 10 or 0x0A). It is possible to
change this to the NUL character ('\0' or 0) by passing the "-0" argument.
-show fd [-!plcfbsd]* [[<tgid>]/[<fd>] | <fd>]
+show fd [-!plcfbs]* [[<tgid>]/[<fd>] | <fd>]
Dump the list of either all open file descriptors or just the one number <fd>
if specified. The form "<tgid>/<fd>" is also accepted, where either side may
be empty as a wildcard ("/<fd>" for fd <fd> across thread groups, "<tgid>/"
types. When '-' or '!' are encountered, the selection is inverted for the
following characters in the same argument. The inversion is reset before each
argument word delimited by white spaces. Selectable FD types include 'p' for
- pipes, 'l' for listeners, 'c' for connections (any type), 'f' for frontend
- connections, 'b' for backend connections (any type), 's' for connections to
- servers, 'd' for connections to the "dispatch" address or the backend's
- transparent address. With this, 'b' is a shortcut for 'sd' and 'c' for 'fb' or
- 'fsd'. 'c!f' is equivalent to 'b' ("any connections except frontend
- connections" are indeed backend connections). This is only aimed at developers
- who need to observe internal states in order to debug complex issues such as
- abnormal CPU usages. One fd is reported per lines, and for each of them, its
- state in the poller using upper case letters for enabled flags and lower case
- for disabled flags, using "P" for "polled", "R" for "ready", "A" for "active",
- the events status using "H" for "hangup", "E" for "error", "O" for "output",
- "P" for "priority" and "I" for "input", a few other flags like "N" for "new"
- (just added into the fd cache), "U" for "updated" (received an update in the
- fd cache), "L" for "linger_risk", "C" for "cloned", then the cached entry
+ pipes, 'l' for listeners, 'c' for connections (any type, shortcut for 'fb'),
+ 'f' for frontend connections, 'b' or 's' for backend connections to servers.
+ 'c!f' is equivalent to 'b' ("any connections except frontend connections" are
+ indeed backend connections). This is only aimed at developers who need to
+ observe internal states in order to debug complex issues such as abnormal CPU
+ usages. One fd is reported per lines, and for each of them, its state in the
+ poller using upper case letters for enabled flags and lower case for disabled
+ flags, using "P" for "polled", "R" for "ready", "A" for "active", the events
+ status using "H" for "hangup", "E" for "error", "O" for "output", "P" for
+ "priority" and "I" for "input", a few other flags like "N" for "new" (just
+ added into the fd cache), "U" for "updated" (received an update in the fd
+ cache), "L" for "linger_risk", "C" for "cloned", then the cached entry
position, the pointer to the internal owner, the pointer to the I/O callback
- and its name when known. When the owner is a connection, the connection flags,
- and the target are reported (frontend, proxy or server). When the owner is a
- listener, the listener's state and its frontend are reported. There is no
- point in using this command without a good knowledge of the internals. It's
- worth noting that the output format may evolve over time so this output must
- not be parsed by tools designed to be durable. Some internal structure states
- may look suspicious to the function listing them, in this case the output line
- will be suffixed with an exclamation mark ('!'). This may help find a starting
- point when trying to diagnose an incident.
+ its name when known. When the owner is a connection, the connection and
+ flags, and the target are reported (frontend, proxy or server). When the
+ owner is a listener, the listener's state and its frontend are reported.
+ There is no point in using this command without a good knowledge of the
+ internals. It's worth noting that the output format may evolve over time so
+ this output must not be parsed by tools designed to be durable. Some internal
+ structure states may look suspicious to the function listing them, in this
+ case the output line will be suffixed with an exclamation mark ('!'). This
+ may help find a starting point when trying to diagnose an incident.
show info [typed|json] [desc] [float]
Dump info about haproxy status on current process. If "typed" is passed as an
#define CLI_SHOWFD_F_LI 0x00000002 /* listeners */
#define CLI_SHOWFD_F_FE 0x00000004 /* frontend conns */
#define CLI_SHOWFD_F_SV 0x00000010 /* server-only conns */
-#define CLI_SHOWFD_F_PX 0x00000020 /* proxy-only conns */
-#define CLI_SHOWFD_F_BE 0x00000030 /* backend: srv+px */
-#define CLI_SHOWFD_F_CO 0x00000034 /* conn: be+fe */
-#define CLI_SHOWFD_F_ANY 0x0000003f /* any type */
+#define CLI_SHOWFD_F_CO 0x00000014 /* conn: fe+sv */
+#define CLI_SHOWFD_F_ANY 0x0000001f /* any type */
struct show_fd_ctx {
int fd; /* first FD to show, -1=wildcard */
struct fdtab fdt;
const struct listener *li = NULL;
const struct server *sv = NULL;
- const struct proxy *px = NULL;
const struct connection *conn = NULL;
const struct mux_ops *mux = NULL;
const struct xprt_ops *xprt = NULL;
xprt_ctx = conn->xprt_ctx;
li = objt_listener(conn->target);
sv = objt_server(conn->target);
- px = objt_proxy(conn->target);
is_back = conn_is_back(conn);
if (atleast2(fdt.thread_mask))
suspicious = 1;
if (!(((conn || xprt_ctx) &&
((match & CLI_SHOWFD_F_SV && sv) ||
- (match & CLI_SHOWFD_F_PX && px) ||
(match & CLI_SHOWFD_F_FE && li))) ||
(!conn &&
((match & CLI_SHOWFD_F_LI && li) ||
}
}
- if (px)
- chunk_appendf(&trash, " px=%s", px->id);
- else if (sv)
+ if (sv)
chunk_appendf(&trash, " sv=%s/%s", sv->proxy->id, sv->id);
else if (li)
chunk_appendf(&trash, " fe=%s", li->bind_conf->frontend->id);
case 'l': flag = CLI_SHOWFD_F_LI; break;
case 'c': flag = CLI_SHOWFD_F_CO; break;
case 'f': flag = CLI_SHOWFD_F_FE; break;
- case 'b': flag = CLI_SHOWFD_F_BE; break;
+ case 'b': flag = CLI_SHOWFD_F_SV; break; // alias back/srv
case 's': flag = CLI_SHOWFD_F_SV; break;
- case 'd': flag = CLI_SHOWFD_F_PX; break;
default: return cli_err(appctx, "Invalid FD type\n");
}
c++;
{ { "show", "env", NULL }, "show env [var] : dump environment variables known to the process", cli_parse_show_env, cli_io_handler_show_env, NULL, NULL, ACCESS_MASTER },
{ { "show", "cli", "sockets", NULL }, "show cli sockets : dump list of cli sockets", cli_parse_default, cli_io_handler_show_cli_sock, NULL, NULL, ACCESS_MASTER },
{ { "show", "cli", "level", NULL }, "show cli level : display the level of the current CLI session", cli_parse_show_lvl, NULL, NULL, NULL, ACCESS_MASTER},
- { { "show", "fd", NULL }, "show fd [-!plcfbsd]* [num] : dump list of file descriptors in use or a specific one", cli_parse_show_fd, cli_io_handler_show_fd, NULL },
+ { { "show", "fd", NULL }, "show fd [-!plcfbs]* [num] : dump list of file descriptors in use or a specific one", cli_parse_show_fd, cli_io_handler_show_fd, NULL },
{ { "show", "version", NULL }, "show version : show version of the current process", cli_parse_show_version, NULL, NULL, NULL, ACCESS_MASTER },
{ { "operator", NULL }, "operator : lower the level of the current CLI session to operator", cli_parse_set_lvl, NULL, NULL, NULL, ACCESS_MASTER},
{ { "user", NULL }, "user : lower the level of the current CLI session to user", cli_parse_set_lvl, NULL, NULL, NULL, ACCESS_MASTER},