public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Roman Mashak <mrv@mojatatu•com>
To: Stefano Brivio <sbrivio@redhat•com>
Cc: Stephen Hemminger <stephen@networkplumber•org>, netdev@vger•kernel.org
Subject: Re: [PATCH iproute2] ss: Fix rendering of continuous output (-E, --events)
Date: Fri, 23 Mar 2018 09:30:17 -0400	[thread overview]
Message-ID: <85woy2ly1i.fsf@mojatatu.com> (raw)
In-Reply-To: <9cdf9f3efbc64f517906a45f67ab6e573f9e9292.1521793677.git.sbrivio@redhat.com> (Stefano Brivio's message of "Fri, 23 Mar 2018 09:37:05 +0100")

Stefano Brivio <sbrivio@redhat•com> writes:

> Roman Mashak reported that ss currently shows no output when it
> should continuously report information about terminated sockets
> (-E, --events switch).
>
> This happens because I missed this case in 691bd854bf4a ("ss:
> Buffer raw fields first, then render them as a table") and the
> rendering function is simply not called.
>
> To fix this, we need to:
>
> - call render() every time we need to display new socket events
>   from generic_show_sock(), which is only used to follow events.
>   Always call it even if specific socket display functions
>   return errors to ensure we clean up buffers
>
> - get the screen width every time we have new events to display,
>   thus factor out getting the screen width from main() into a
>   function we'll call whenever we calculate columns width
>
> - reset the current field pointer after rendering, more output
>   might come after render() is called
>
> Reported-by: Roman Mashak <mrv@mojatatu•com>
> Fixes: 691bd854bf4a ("ss: Buffer raw fields first, then render them as a table")
> Signed-off-by: Stefano Brivio <sbrivio@redhat•com>

Thanks Stefano.

Tested-by: Roman Mashak <mrv@mojatatu•com>

  reply	other threads:[~2018-03-23 13:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-23  8:37 [PATCH iproute2] ss: Fix rendering of continuous output (-E, --events) Stefano Brivio
2018-03-23 13:30 ` Roman Mashak [this message]
2018-03-27 16:11   ` 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=85woy2ly1i.fsf@mojatatu.com \
    --to=mrv@mojatatu$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=sbrivio@redhat$(echo .)com \
    --cc=stephen@networkplumber$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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