Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153236667
D50516.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D50516.diff
View Options
diff --git a/share/man/man4/ddb.4 b/share/man/man4/ddb.4
--- a/share/man/man4/ddb.4
+++ b/share/man/man4/ddb.4
@@ -24,7 +24,7 @@
.\" any improvements or extensions that they make and grant Carnegie Mellon
.\" the rights to redistribute these changes.
.\"
-.Dd May 24, 2025
+.Dd May 28, 2025
.Dt DDB 4
.Os
.Sh NAME
@@ -604,6 +604,14 @@
modifier will print command line arguments for each process.
.\"
.Pp
+.It Ic show Cm all tcpcbs Ns Op Li / Ns Cm l
+Show the same output as "show tcpcb" does, but for all
+TCP control blocks within the system.
+Using the
+.Cm l
+modifier will limit the output to TCP control blocks, which are locked.
+.\"
+.Pp
.It Ic show Cm all trace
.It Ic alltrace
Show a stack trace for every thread in the system.
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -3222,4 +3222,27 @@
db_print_tcpcb(tp, "tcpcb", 0);
}
+
+DB_SHOW_ALL_COMMAND(tcpcbs, db_show_all_tcpcbs)
+{
+ VNET_ITERATOR_DECL(vnet_iter);
+ struct inpcb *inp;
+ bool only_locked;
+
+ only_locked = strchr(modif, 'l') != NULL;
+ VNET_FOREACH(vnet_iter) {
+ CURVNET_SET(vnet_iter);
+ CK_LIST_FOREACH(inp, &V_tcbinfo.ipi_listhead, inp_list) {
+ if (only_locked &&
+ inp->inp_lock.rw_lock == RW_UNLOCKED)
+ continue;
+ db_print_tcpcb(intotcpcb(inp), "tcpcb", 0);
+ if (db_pager_quit)
+ break;
+ }
+ CURVNET_RESTORE();
+ if (db_pager_quit)
+ break;
+ }
+}
#endif
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 21, 12:02 AM (6 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31873011
Default Alt Text
D50516.diff (1 KB)
Attached To
Mode
D50516: ddb: add show all tcpcbs
Attached
Detach File
Event Timeline
Log In to Comment