From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH iproute2] ss: Fix rendering of continuous output (-E, --events) Date: Tue, 27 Mar 2018 09:11:27 -0700 Message-ID: <20180327091127.6ac10795@xeon-e3> References: <9cdf9f3efbc64f517906a45f67ab6e573f9e9292.1521793677.git.sbrivio@redhat.com> <85woy2ly1i.fsf@mojatatu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Stefano Brivio , netdev@vger.kernel.org To: Roman Mashak Return-path: Received: from mail-pl0-f47.google.com ([209.85.160.47]:37753 "EHLO mail-pl0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753311AbeC0RAb (ORCPT ); Tue, 27 Mar 2018 13:00:31 -0400 Received: by mail-pl0-f47.google.com with SMTP id v7-v6so737228plo.4 for ; Tue, 27 Mar 2018 10:00:31 -0700 (PDT) In-Reply-To: <85woy2ly1i.fsf@mojatatu.com> Sender: netdev-owner@vger.kernel.org List-ID: On Fri, 23 Mar 2018 09:30:17 -0400 Roman Mashak wrote: > Stefano Brivio 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 > > Fixes: 691bd854bf4a ("ss: Buffer raw fields first, then render them as a table") > > Signed-off-by: Stefano Brivio > > Thanks Stefano. > > Tested-by: Roman Mashak Applied