The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=8d4f495df46567dcfcbec59794e9b9137b2f38fe
commit 8d4f495df46567dcfcbec59794e9b9137b2f38fe Author: Michael Tuexen <tue...@freebsd.org> AuthorDate: 2025-05-28 10:10:51 +0000 Commit: Michael Tuexen <tue...@freebsd.org> CommitDate: 2025-05-28 10:10:51 +0000 ddb: improve show tcpcb Print the name of the TCP function block and the name of the congestion control algorithm. Furthermore, print some information related to Black Box Logging. Reviewed by: thj MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D50535 --- sys/netinet/tcp_usrreq.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 61ca29dc0ad2..5be4c399893a 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -3045,6 +3045,43 @@ db_print_toobflags(char t_oobflags) } } +static void +db_print_bblog_state(int state) +{ + switch (state) { + case TCP_LOG_STATE_RATIO_OFF: + db_printf("TCP_LOG_STATE_RATIO_OFF"); + break; + case TCP_LOG_STATE_CLEAR: + db_printf("TCP_LOG_STATE_CLEAR"); + break; + case TCP_LOG_STATE_OFF: + db_printf("TCP_LOG_STATE_OFF"); + break; + case TCP_LOG_STATE_TAIL: + db_printf("TCP_LOG_STATE_TAIL"); + break; + case TCP_LOG_STATE_HEAD: + db_printf("TCP_LOG_STATE_HEAD"); + break; + case TCP_LOG_STATE_HEAD_AUTO: + db_printf("TCP_LOG_STATE_HEAD_AUTO"); + break; + case TCP_LOG_STATE_CONTINUAL: + db_printf("TCP_LOG_STATE_CONTINUAL"); + break; + case TCP_LOG_STATE_TAIL_AUTO: + db_printf("TCP_LOG_STATE_TAIL_AUTO"); + break; + case TCP_LOG_VIA_BBPOINTS: + db_printf("TCP_LOG_STATE_BBPOINTS"); + break; + default: + db_printf("UNKNOWN(%d)", state); + break; + } +} + static void db_print_tcpcb(struct tcpcb *tp, const char *name, int indent) { @@ -3156,6 +3193,21 @@ db_print_tcpcb(struct tcpcb *tp, const char *name, int indent) db_print_indent(indent); db_printf("t_rttlow: %d rfbuf_ts: %u rfbuf_cnt: %d\n", tp->t_rttlow, tp->rfbuf_ts, tp->rfbuf_cnt); + + db_print_indent(indent); + db_printf("t_fb.tfb_tcp_block_name: %s\n", tp->t_fb->tfb_tcp_block_name); + + db_print_indent(indent); + db_printf("t_cc.name: %s\n", tp->t_cc->name); + + db_print_indent(indent); + db_printf("_t_logstate: %d (", tp->_t_logstate); + db_print_bblog_state(tp->_t_logstate); + db_printf(")\n"); + + db_print_indent(indent); + db_printf("t_lognum: %d t_loglimit: %d t_logsn: %u\n", + tp->t_lognum, tp->t_loglimit, tp->t_logsn); } DB_SHOW_COMMAND(tcpcb, db_show_tcpcb)