public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: Paul Wayper <pwayper@redhat.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	netdev@vger.kernel.org, paulway@redhat.com, jbainbri@redhat.com
Subject: Re: [PATCH iproute2] ss: Don't pad the last (enabled) column
Date: Wed, 27 Aug 2025 01:22:10 +0200	[thread overview]
Message-ID: <20250827012210.399aae3d@elisabeth> (raw)
In-Reply-To: <20250826002237.19995-1-paulway@redhat.com>

On Tue, 26 Aug 2025 10:22:37 +1000
Paul Wayper <pwayper@redhat.com> wrote:

> ss will emit spaces on the right hand side of a left-justified, enabled
> column even if it's the last column.  In situations where one or more
> lines are very long - e.g. because of a large PROCESS field value - this
> causes a lot of excess output.
> 
> Firstly, calculate the last enabled column.  Then use this in the check
> for whether to emit trailing spaces on the last column.
> 
> Also name the 'EXT' column as 'Details' and mark it as disabled by
> default, enabled when the -e or --extended options are supplied.
> 
> Fixes: 59f46b7b5be86 ("ss: Introduce columns lightweight abstraction")
> Signed-off-by: Paul Wayper <paulway@redhat.com>
> ---
>  misc/ss.c | 42 +++++++++++++++++++++++++++++++++---------
>  1 file changed, 33 insertions(+), 9 deletions(-)

For some reason I didn't investigate yet, this still breaks ss -tunl as
well as ss -tunap for me. With 115 columns, before:

$ ss -tunl
Netid    State     Recv-Q     Send-Q                              Local Address:Port          Peer Address:Port    
udp      UNCONN    0          0                                   192.168.122.1:53                 0.0.0.0:*       
udp      UNCONN    0          0                                  0.0.0.0%virbr0:67                 0.0.0.0:*       
udp      UNCONN    0          0                                         0.0.0.0:111                0.0.0.0:*       
udp      UNCONN    0          0                                         0.0.0.0:33335              0.0.0.0:*
...

$ ss -tunap
Netid  State     Recv-Q   Send-Q                          Local Address:Port                    Peer Address:Port  Process                                                                                                            
udp    UNCONN    0        0                               192.168.122.1:53                           0.0.0.0:*                                                                                                                        
udp    UNCONN    0        0                              0.0.0.0%virbr0:67                           0.0.0.0:*                                                                                                                        
udp    ESTAB     0        0                        192.168.1.185%wlp4s0:68                       192.168.1.1:67                                                                                                                       
...

and after:

$ ./ss -tunl
Netid    State     Recv-Q     Send-Q                              Local Address:Port          Peer Address:Port
         udp       UNCONN     0                                           0     192.168.122.1:                530.0.0.0:
*                  udp        UNCONN                                      0     0           0.0.0.0%virbr0:67
0.0.0.0: *                    udp                                         UNCONN0                    0     0.0.0.0:
111      0.0.0.0:  *                                                         udpUNCONN               0     0     
0.0.0.0: 33335     0.0.0.0:   *                                                 udp                  UNCONN0     
0        0.0.0.0:  5154       0.0.0.0:                                         *                        udpUNCONN
...

$ ./ss -tunap
Netid   State      Recv-Q   Send-Q                          Local Address:Port                  Peer Address:Port   Process
        udp        UNCONN   0                                       0     192.168.122.1:                          530.0.0.0: *
                   udp      UNCONN                                  0     0                   0.0.0.0%virbr0:67     0.0.0.0:
*                           udp                                      ESTAB0                            0     192.168.1.185%wlp4s0: 68
192.168.1.1: 67                                                             udpUNCONN                       0     0      0.0.0.0:
111     0.0.0.0:   *                                                      udp                          UNCONN0      0     
0.0.0.0: 33335      0.0.0.0: *                                                                             udpUNCONN 0     
...

I'll look into this soon, give me a couple of days. I still have to
answer some points from 137a3493-bbda-490f-8ad4-fa3a511c2742@redhat.com
as well.

-- 
Stefano


  parent reply	other threads:[~2025-08-26 23:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-26  0:22 [PATCH iproute2] ss: Don't pad the last (enabled) column Paul Wayper
2025-08-26  6:55 ` Stefano Brivio
2025-08-26 23:22 ` Stefano Brivio [this message]
2025-08-29 11:09 ` Stefano Brivio
  -- strict thread matches above, loose matches on Subject: below --
2025-08-21  5:45 Paul Wayper
2025-08-21 10:35 ` Stefano Brivio
     [not found]   ` <137a3493-bbda-490f-8ad4-fa3a511c2742@redhat.com>
2025-08-28 23:49     ` Stefano Brivio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250827012210.399aae3d@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=jbainbri@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=paulway@redhat.com \
    --cc=pwayper@redhat.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox