netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Quentin Deslandes <qde@naccy.de>, netdev@vger.kernel.org
Cc: Martin KaFai Lau <martin.lau@kernel.org>
Subject: Re: [PATCH 1/3] ss: prevent "Process" column from being printed unless requested
Date: Tue, 28 Nov 2023 17:20:13 -0700	[thread overview]
Message-ID: <b41c7f20-34f4-4644-9e7a-a94cc47a8228@gmail.com> (raw)
In-Reply-To: <20231128023058.53546-2-qde@naccy.de>

On 11/27/23 7:30 PM, Quentin Deslandes wrote:
> Commit 5883c6eba517 ("ss: show header for --processes/-p") added
> "Process" to the list of columns printed by ss. However, the "Process"
> header is now printed even if --processes/-p is not used.
> 
> This change aims to fix this by moving the COL_PROC column ID to the same
> index as the corresponding column structure in the columns array, and
> enabling it if --processes/-p is used.
> 
> Signed-off-by: Quentin Deslandes <qde@naccy.de>
> ---
>  misc/ss.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/misc/ss.c b/misc/ss.c
> index 9438382b..09dc1f37 100644
> --- a/misc/ss.c
> +++ b/misc/ss.c
> @@ -100,8 +100,8 @@ enum col_id {
>  	COL_SERV,
>  	COL_RADDR,
>  	COL_RSERV,
> -	COL_EXT,
>  	COL_PROC,
> +	COL_EXT,
>  	COL_MAX
>  };
>  
> @@ -5795,6 +5795,9 @@ int main(int argc, char *argv[])
>  	if (ssfilter_parse(&current_filter.f, argc, argv, filter_fp))
>  		usage();
>  
> +	if (!show_processes)
> +		columns[COL_PROC].disabled = 1;
> +
>  	if (!(current_filter.dbs & (current_filter.dbs - 1)))
>  		columns[COL_NETID].disabled = 1;
>  

this one should go into main as a bug fix. Resubmit as a standalone
patch with:

Fixes: 5883c6eba517 ("ss: show header for --processes/-p")

  reply	other threads:[~2023-11-29  0:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-28  2:30 [PATCH 0/3] ss: pretty-printing BPF socket-local storage Quentin Deslandes
2023-11-28  2:30 ` [PATCH 1/3] ss: prevent "Process" column from being printed unless requested Quentin Deslandes
2023-11-29  0:20   ` David Ahern [this message]
2023-11-28  2:30 ` [PATCH 2/3] ss: add support for BPF socket-local storage Quentin Deslandes
2023-11-28 23:35   ` Martin KaFai Lau
2023-11-28  2:30 ` [PATCH 3/3] ss: pretty-print " Quentin Deslandes
2023-11-28 23:42   ` Martin KaFai Lau
2023-11-28 22:43 ` [PATCH 0/3] ss: pretty-printing " Stephen Hemminger
2023-12-08 15:01   ` Quentin Deslandes
2023-12-08 17:27     ` Stephen Hemminger

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=b41c7f20-34f4-4644-9e7a-a94cc47a8228@gmail.com \
    --to=dsahern@gmail.com \
    --cc=martin.lau@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=qde@naccy.de \
    /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).