mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 00:57:02 +02:00
MINOR: stats: provide some appctx information in "show sess all"
When dumping a session, it can be useful to know what applet it is connected to instead of having just the appctx pointer. We also report st0/st1/st2 to help debugging.
This commit is contained in:
parent
6d7f8f77ba
commit
284ddbfd3b
@ -3904,6 +3904,7 @@ static int stats_dump_full_sess_to_buffer(struct stream_interface *si, struct se
|
|||||||
extern const char *monthname[12];
|
extern const char *monthname[12];
|
||||||
char pn[INET6_ADDRSTRLEN];
|
char pn[INET6_ADDRSTRLEN];
|
||||||
struct connection *conn;
|
struct connection *conn;
|
||||||
|
struct appctx *tmpctx;
|
||||||
|
|
||||||
chunk_reset(&trash);
|
chunk_reset(&trash);
|
||||||
|
|
||||||
@ -4076,8 +4077,7 @@ static int stats_dump_full_sess_to_buffer(struct stream_interface *si, struct se
|
|||||||
TICKS_TO_MS(1000)) : "<NEVER>",
|
TICKS_TO_MS(1000)) : "<NEVER>",
|
||||||
sess->si[1].err_type);
|
sess->si[1].err_type);
|
||||||
|
|
||||||
conn = objt_conn(sess->si[0].end);
|
if ((conn = objt_conn(sess->si[0].end)) != NULL) {
|
||||||
if (conn) {
|
|
||||||
chunk_appendf(&trash,
|
chunk_appendf(&trash,
|
||||||
" co0=%p ctrl=%s xprt=%s data=%s target=%s:%p\n",
|
" co0=%p ctrl=%s xprt=%s data=%s target=%s:%p\n",
|
||||||
conn,
|
conn,
|
||||||
@ -4095,9 +4095,17 @@ static int stats_dump_full_sess_to_buffer(struct stream_interface *si, struct se
|
|||||||
conn->t.sock.fd >= 0 ? fdtab[conn->t.sock.fd].spec_p : 0,
|
conn->t.sock.fd >= 0 ? fdtab[conn->t.sock.fd].spec_p : 0,
|
||||||
conn->t.sock.fd >= 0 ? fdtab[conn->t.sock.fd].updated : 0);
|
conn->t.sock.fd >= 0 ? fdtab[conn->t.sock.fd].updated : 0);
|
||||||
}
|
}
|
||||||
|
else if ((tmpctx = objt_appctx(sess->si[0].end)) != NULL) {
|
||||||
|
chunk_appendf(&trash,
|
||||||
|
" app0=%p st0=%d st1=%d st2=%d applet=%s\n",
|
||||||
|
tmpctx,
|
||||||
|
tmpctx->st0,
|
||||||
|
tmpctx->st1,
|
||||||
|
tmpctx->st2,
|
||||||
|
tmpctx->applet->name);
|
||||||
|
}
|
||||||
|
|
||||||
conn = objt_conn(sess->si[1].end);
|
if ((conn = objt_conn(sess->si[1].end)) != NULL) {
|
||||||
if (conn) {
|
|
||||||
chunk_appendf(&trash,
|
chunk_appendf(&trash,
|
||||||
" co1=%p ctrl=%s xprt=%s data=%s target=%s:%p\n",
|
" co1=%p ctrl=%s xprt=%s data=%s target=%s:%p\n",
|
||||||
conn,
|
conn,
|
||||||
@ -4115,6 +4123,15 @@ static int stats_dump_full_sess_to_buffer(struct stream_interface *si, struct se
|
|||||||
conn->t.sock.fd >= 0 ? fdtab[conn->t.sock.fd].spec_p : 0,
|
conn->t.sock.fd >= 0 ? fdtab[conn->t.sock.fd].spec_p : 0,
|
||||||
conn->t.sock.fd >= 0 ? fdtab[conn->t.sock.fd].updated : 0);
|
conn->t.sock.fd >= 0 ? fdtab[conn->t.sock.fd].updated : 0);
|
||||||
}
|
}
|
||||||
|
else if ((tmpctx = objt_appctx(sess->si[1].end)) != NULL) {
|
||||||
|
chunk_appendf(&trash,
|
||||||
|
" app1=%p st0=%d st1=%d st2=%d applet=%s\n",
|
||||||
|
tmpctx,
|
||||||
|
tmpctx->st0,
|
||||||
|
tmpctx->st1,
|
||||||
|
tmpctx->st2,
|
||||||
|
tmpctx->applet->name);
|
||||||
|
}
|
||||||
|
|
||||||
chunk_appendf(&trash,
|
chunk_appendf(&trash,
|
||||||
" req=%p (f=0x%06x an=0x%x pipe=%d tofwd=%d total=%lld)\n"
|
" req=%p (f=0x%06x an=0x%x pipe=%d tofwd=%d total=%lld)\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user