From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH iproute2] ip link: don't stop batch processing Date: Wed, 8 Aug 2018 09:26:46 -0700 Message-ID: <20180808092646.47535f43@xeon-e3> References: <20180803174933.24600-1-mcroce@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: mcroce@redhat.com, Linux Kernel Network Developers To: Dave Taht Return-path: Received: from mail-pg1-f196.google.com ([209.85.215.196]:36256 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727337AbeHHSrT (ORCPT ); Wed, 8 Aug 2018 14:47:19 -0400 Received: by mail-pg1-f196.google.com with SMTP id h12-v6so1336927pgs.3 for ; Wed, 08 Aug 2018 09:26:54 -0700 (PDT) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Fri, 3 Aug 2018 11:08:58 -0700 Dave Taht wrote: > On Fri, Aug 3, 2018 at 10:50 AM Matteo Croce wrote: > > > > When 'ip link show dev DEVICE' is processed in a batch mode, ip exits > > and stop processing further commands. > > This because ipaddr_list_flush_or_save() calls exit() to avoid printing > > the link information twice. > > Replace the exit with a classic goto out instruction. > > > > Signed-off-by: Matteo Croce > > one thing I noticed in iproute2-next last week is that > > ( echo qdisc show dev eno1; sleep 5; echo qdisc show dev eno1; ) | tc -b - > > batches the whole thing up to emerge on exit, only. > > It didn't used to do that, the output of every command came out as it > completed. I used to use that to timestamp and save the overhead of > invoking the tc utility on openwrt while monitoring qdisc stats in > https://github.com/tohojo/flent/blob/master/misc/tc_iterate.c There used to be lots of fflush(stdout) in each sub command but lots of these got dropped in JSON updates. I just added one back in after each batch command that should fix what you are seeing.