netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: David Ahern <dsahern@gmail.com>
Cc: Stefano Brivio <sbrivio@redhat.com>,
	"Yoann P." <yoann.p.public@gmail.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH iproute2 net-next 0/3] ss: Allow selection of columns to be displayed
Date: Tue, 30 Oct 2018 09:38:42 -0700	[thread overview]
Message-ID: <20181030093842.0e174ea6@xeon-e3> (raw)
In-Reply-To: <7ffc00c8-bdf6-5c75-564e-2663494bda5d@gmail.com>

On Tue, 30 Oct 2018 10:34:45 -0600
David Ahern <dsahern@gmail.com> wrote:

> On 10/30/18 9:05 AM, Stefano Brivio wrote:
> > Now that we have an abstraction for columns, it's relatively easy to
> > selectively display only some of them, and Yoann has a use case for it.
> > 
> > Patch 1/3 fixes a rendering issue that shows up only when display of
> > arbitrary columns is disabled. Patch 2/3 implements the relevant option,
> > and patch 3/3 makes the output more readable when some columns are
> > disabled.
> > 
> >  
> 
> I like the intent, and I have prototyped something similar for 'ip'.
> 
> A more flexible approach is to use format strings to allow users to
> customize the output order and whitespace as well. So for ss and your
> column list (winging it here):
> 
>     netid          = %N
>     state          = %S
>     recv Q         = %Qr
>     send Q         = %Qs
>     local address  = %Al
>     lport port     = %Pl
>     remote address = %Ar
>     remote port    = %Pr
>     process data   = %p
>     ...
> 
> then a format string could be: "%S  %Qr %Qs  %Al:%Pl %Ar:%Pr  %p\n"
> 
> or for csv output: "%S,%Qr,%Qs,%Al,%Pl,%Ar,%Pr,%p\n"
> 
> I have not had time to look into an implementation for ip. Conceptually
> - and scanning the kernel's vsprintf code - it does not look that
> difficult, just time consuming on the frontend with the initial setup.

The problem with custom formats is that you lose all ability for Gcc
to check format strings.

  reply	other threads:[~2018-10-31  1:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-30 15:05 [PATCH iproute2 net-next 0/3] ss: Allow selection of columns to be displayed Stefano Brivio
2018-10-30 15:05 ` [PATCH iproute2 net-next 1/3] ss: Discard empty descriptor at the end of buffer, if any, before rendering Stefano Brivio
2018-10-30 15:05 ` [PATCH iproute2 net-next 2/3] ss: Introduce option to display selected columns only Stefano Brivio
2018-10-30 15:05 ` [PATCH iproute2 net-next 3/3] ss: Beautify output when arbitrary columns are hidden Stefano Brivio
2018-10-30 16:34 ` [PATCH iproute2 net-next 0/3] ss: Allow selection of columns to be displayed David Ahern
2018-10-30 16:38   ` Stephen Hemminger [this message]
2018-10-30 16:45     ` David Ahern
2018-10-30 17:34   ` Stefano Brivio
2018-11-01  2:48     ` David Ahern
2018-11-01 21:06       ` Jakub Kicinski
2018-11-01 21:18         ` David Ahern
2018-11-01 21:38           ` Stephen Hemminger
2018-11-02  9:58         ` Stefano Brivio
2018-11-02  9:58       ` 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=20181030093842.0e174ea6@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=dsahern@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=sbrivio@redhat.com \
    --cc=yoann.p.public@gmail.com \
    /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).