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: Thu, 21 Aug 2025 12:35:55 +0200 [thread overview]
Message-ID: <20250821123555.67ed31d1@elisabeth> (raw)
In-Reply-To: <20250821054547.473917-1-paulway@redhat.com>
Hi Paul,
On Thu, 21 Aug 2025 15:45:47 +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.
I guess I understand the issue, but having an example would help,
because I'm not quite sure how to reproduce this.
There's a problem with this change though, which I didn't really
investigate. It turns something like this (105 columns):
$ ss -tunl
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
udp UNCONN 0 0 10.45.242.29:49047 0.0.0.0:*
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:*
udp UNCONN 0 0 192.168.1.185:60797 0.0.0.0:*
udp UNCONN 0 0 0.0.0.0:5154 0.0.0.0:*
udp UNCONN 0 0 224.0.0.251:5353 0.0.0.0:*
udp UNCONN 0 0 224.0.0.251:5353 0.0.0.0:*
udp UNCONN 0 0 224.0.0.251:5353 0.0.0.0:*
udp UNCONN 0 0 224.0.0.251:5353 0.0.0.0:*
udp UNCONN 0 0 0.0.0.0:5353 0.0.0.0:*
udp UNCONN 0 0 [::]:111 [::]:*
udp UNCONN 0 0 [fe80::1839:8c7e:5e64:76a4]%wlp4s0:546 [::]:*
udp UNCONN 0 0 [::]:5353 [::]:*
udp UNCONN 0 0 [::]:39164 [::]:*
tcp LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
tcp LISTEN 0 4096 0.0.0.0:111 0.0.0.0:*
tcp LISTEN 0 1024 0.0.0.0:80 0.0.0.0:*
tcp LISTEN 0 5 0.0.0.0:5154 0.0.0.0:*
tcp LISTEN 0 4096 127.0.0.1:631 0.0.0.0:*
tcp LISTEN 0 4096 127.0.0.1:41001 0.0.0.0:*
tcp LISTEN 0 20 127.0.0.1:25 0.0.0.0:*
tcp LISTEN 0 32 192.168.122.1:53 0.0.0.0:*
tcp LISTEN 0 128 [::]:22 [::]:*
tcp LISTEN 0 4096 [::]:111 [::]:*
tcp LISTEN 0 1024 [::]:80 [::]:*
tcp LISTEN 0 4096 [::1]:631 [::]:*
tcp LISTEN 0 1024 *:12865 *:*
tcp LISTEN 0 20 [::1]:25 [::]:*
into this:
$ ./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
0 0 224.0.0.251: 5353 0.0.0.0:* udp
UNCONN 0 0 224.0.0.251: 53530.0.0.0: *
udp UNCONN 0 0 224.0.0.251:5353 0.0.0.0:*
udp UNCONN 0 0 224.0.0.251: 53530.0.0.0:
* udp UNCONN 0 0 0.0.0.0:5353
0.0.0.0: * udp UNCONN0 0 [::]:
111 [::]: * udpUNCONN 0 0
[fe80::1839:8c7e:5e64:76a4]%wlp4s0: 546 [::]: * udp UNCONN0
0 [::]: 5353 [::]: * udpUNCONN
0 0 [::]: 39164 [::]:* tcp
LISTEN 0 128 0.0.0.0: 220.0.0.0: *
tcp LISTEN 0 4096 0.0.0.0:111 0.0.0.0:*
tcp LISTEN 0 1024 0.0.0.0: 800.0.0.0:
* tcp LISTEN 0 5 0.0.0.0:5154
0.0.0.0: * tcp LISTEN0 4096 127.0.0.1:
631 0.0.0.0: * tcpLISTEN 0 4096
127.0.0.1: 41001 0.0.0.0: * tcp LISTEN0
20 127.0.0.1: 25 0.0.0.0: * tcpLISTEN
0 32 192.168.122.1: 53 0.0.0.0:* tcp
LISTEN 0 128 [::]: 22[::]: *
tcp LISTEN 0 4096 [::]:111 [::]:*
tcp LISTEN 0 1024 [::]: 80[::]:
* tcp LISTEN 0 4096 [::1]:631
[::]: * tcp LISTEN0 1024 *:
12865 *: * tcpLISTEN 0 20
[::1]: 25 [::]: *
> Firstly, calculate the last enabled column. Then use this in the check
> for whether to emit trailing spaces on the last column.
>
> Also remove the 'EXT' column which does not seem to be used.
It's not referenced explicitly but it's definitely used, see also commits:
8740ca9dcd3c ss: add support for BPF socket-local storage
84c45b8acb30 Reapply "ss: prevent "Process" column from being printed unless requested"
f22c49730c36 Revert "ss: prevent "Process" column from being printed unless requested"
1607bf531fd2 ss: prevent "Process" column from being printed unless requested
Now, while 5883c6eba517 ("ss: show header for --processes/-p") and consequently
f22c49730c36 are obviously broken (sorry, I didn't review those, nobody Cc'ed
me), they clearly show that COL_EXT is used. It's for stuff like TCP extensions
(say, 'ss -tei') which have no own / specific column header.
--
Stefano
next prev parent reply other threads:[~2025-08-21 10:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-21 5:45 [PATCH iproute2] ss: Don't pad the last (enabled) column Paul Wayper
2025-08-21 10:35 ` Stefano Brivio [this message]
[not found] ` <137a3493-bbda-490f-8ad4-fa3a511c2742@redhat.com>
2025-08-28 23:49 ` Stefano Brivio
-- strict thread matches above, loose matches on Subject: below --
2025-08-26 0:22 Paul Wayper
2025-08-26 6:55 ` Stefano Brivio
2025-08-26 23:22 ` Stefano Brivio
2025-08-29 11:09 ` 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=20250821123555.67ed31d1@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;
as well as URLs for NNTP newsgroup(s).