bin/151937: [patch] netstat(1) utility lack support of displaying rtt related counters of tcp sockets

Mikolaj Golub trociny at freebsd.org
Sun Jul 1 16:20:17 UTC 2012


Hi,

Mykola, thank you for the report and the provided patch. Displaying rtt
related counters per connection looks useful for me too.

I am attaching the modified version of the patch to discuss (and commit if
there are no objections or other suggestions).

The differences from your version:

1) '-T' option is already used. Also, I don't like very much adding yet
another option, so I added the statistics to '-x' option. Or it can be added
to '-T' statistics.

2) As counter names I used names that are close to field names in the tcpcb
structure.

3) To get hz, instead of kern.clockrate, I use kern.hz sysctl (as it
simplifies the code a little) and for !live case read it from the dump.

4) The trick with printing to buf is used to pad the counters on the right, as
it is with other counters.

Also, it might be enough to display only srtt and rttvar statistics?

-- 
Mikolaj Golub
-------------- next part --------------
A non-text attachment was scrubbed...
Name: netstat.rtt.2.patch
Type: text/x-patch
Size: 3124 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20120701/32343b68/netstat.rtt.2.bin


More information about the freebsd-net mailing list