Re: git: 0726c6574f88 - main - sockstat: Add automatic column sizing and remove -w option

From: Alan Somers <asomers_at_freebsd.org>
Date: Sat, 28 Jun 2025 02:35:18 UTC
On Fri, Jun 27, 2025 at 7:23 PM Gleb Smirnoff <glebius@freebsd.org> wrote:

>   Hi,
>
> On Fri, Jun 27, 2025 at 03:59:32PM +0000, Alan Somers wrote:
> A> commit 0726c6574f889507e5030173bf4c82c80911394d
> A> Author:     Damin Rido <rido@FreeBSD.com>
> A> AuthorDate: 2025-06-12 09:12:49 +0000
> A> Commit:     Alan Somers <asomers@FreeBSD.org>
> A> CommitDate: 2025-06-27 15:54:41 +0000
> A>
> A>     sockstat: Add automatic column sizing and remove -w option
> A>
> A>     Refactor sockstat to dynamically size table columns based on
> content.
> A>     This eliminates the need for the -w option, which is now ignored
> A>     for backwards compatibility.
> A>
> A>     Numeric columns are now right-aligned for improved readability;
> A>     previously, they were left-aligned.
> A>
> A>     Unknown fields are now consistently shown as "??" instead of a mix
> A>     of "", "?", and "?" for output uniformity.
> A>
> A>     Sponsored by:   Google, LLC (GSoC 2025)
> A>     MFC after:      2 weeks
> A>     Reviewed by:    asomers
> A>     Pull Request:   https://github.com/freebsd/freebsd-src/pull/1720
> A> ---
> A>  usr.bin/sockstat/sockstat.1 |   6 +-
> A>  usr.bin/sockstat/sockstat.c | 622
> +++++++++++++++++++++++++++-----------------
> A>  2 files changed, 392 insertions(+), 236 deletions(-)
>
> The commit message looks promising, but so far the output of the program
> that I
> use daily has been made much worsr :(
>
> First, there is a spurious second newline on every line.  Even after the
> header
> line! How could that pass through minimal testing?
>

A second newline?  Do you mean that the output is double-spaced?  Because I
do not see that at all.


>
> Second, the default output now just inserts a huge whitespace "column" in
> the
> middle of the list, making it extermely wide.  Note, that before this
> change
> the default output was fitting into 80 char terminal.  Now it is not
> fitting
> and without any good reason to do so.
>

You shouldn't be seeing any column that's pure whitespace.  You might be
looking at the "PROTO" column, which is often wide because some sockets
show "stream (not connected)".  The "(not connected)" part isn't new;
that's always been there.  Does your "whitespace column" go away if you use
"-4" or "-6"?  If so, Damin do you think we could move "(not connected)"
into the "LOCAL ADDRESS" column?  It might fit better there.


>
> I really would prefer this reverted and re-tested by a wider audience
> before
> pushing it back in.
>

I'm sorry that your experience has been poor.  But I disagree that a full
reversion is warranted.


>
> --
> Gleb Smirnoff
>