From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D94BBC43381 for ; Wed, 13 Feb 2019 23:47:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A5C90222C9 for ; Wed, 13 Feb 2019 23:47:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EBMeqnYv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732478AbfBMXre (ORCPT ); Wed, 13 Feb 2019 18:47:34 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:45752 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729495AbfBMXrd (ORCPT ); Wed, 13 Feb 2019 18:47:33 -0500 Received: by mail-pf1-f196.google.com with SMTP id j3so1970835pfi.12 for ; Wed, 13 Feb 2019 15:47:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=OR4uTMA2WrxFLlrB48Htzd2F4EvzcrtLnXGrjqXUfI0=; b=EBMeqnYv8tA3wB4pzWPkEZQN1popO8o3bYpGKSdI7Xqpux2VlHvvE+rYP7X9NLWPft ZXPH2l2poEE7vomJuRvIdM4zt8BLd7OrBTMTL6FFd1xxkkEp3AieoZuMw2zKs/ptampW kHGqrKMi1WJJrQIaFAbZaLlAj/ZpO1/uKaqQrVSmVYXtRcSduLAanO02I9p0agA+96gN ezjNkqS59SPEitcZwySLbz96MnC0N0ssp9G4iJaFmmJ8Q8uExqnPIb9ZY1OBLf0sC7Ja LWCmuZ7MCuDjg7DVcGMgOZMphRCyWI4wQb4rmU+RztciMa71atgrUXgwtWm7I39wvkGY Jc7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=OR4uTMA2WrxFLlrB48Htzd2F4EvzcrtLnXGrjqXUfI0=; b=LsGXMkcPltVz6E3u/VHeOSvayXFaG7MVFLlUMIc9xQ1SSxpzs+B/AJIneluKWau26O 1LZaK0IX3IxAuF64S6ohSix+zHV8HzCCNFC9ZPOxD2j+86SHHBliaNWMx277BWsNFafp G+MxJyJaph3BFN+UG771ZSMSC3jK9YpqwemkMCRBzY4zlrj3maEU6kybPF/Ye0VBPiZd vRKxCS5FG8f1WGjjWprtQ64LW5r4hvK9NJdCWZE3TSmDEOtZx9yTFNkSoyS2Lnf+1pUh 7sU66yvOfHAbufbi5MCbvMvyYKzfmN2SAndrvdK9hSZTx5DF55z5W5fGN2gXpc+Gyn7m Xwmg== X-Gm-Message-State: AHQUAuatHB8ARsTS4+e8MGQRHSCxtNfeG9N0bIcjdqIldtNr59AF1QrL jKQzWkfL1E0qTBoUobvLciQ= X-Google-Smtp-Source: AHgI3IZL9C7ifJxbIQIxPr5TCjWAsx0IcnFFT+OMYGM4El89EnXSfDoQ+ALMqrxEuwsRp3se/iRyJw== X-Received: by 2002:a63:1544:: with SMTP id 4mr796759pgv.290.1550101652945; Wed, 13 Feb 2019 15:47:32 -0800 (PST) Received: from ?IPv6:2601:282:800:fd80:1d6b:31d6:ccdb:d65a? ([2601:282:800:fd80:1d6b:31d6:ccdb:d65a]) by smtp.googlemail.com with ESMTPSA id s71sm594964pfa.122.2019.02.13.15.47.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Feb 2019 15:47:32 -0800 (PST) Subject: Re: [PATCH iproute2 net-next v2 3/4] ss: Buffer raw fields first, then render them as a table To: Phil Sutter , Stephen Hemminger , Stefano Brivio , Eric Dumazet , netdev@vger.kernel.org, Sabrina Dubroca References: <82f1bc98-df6d-2b0a-17e5-fa057563284e@gmail.com> <20190213093711.13ab560e@redhat.com> <20190213221716.5f958c2a@redhat.com> <20190213135534.01dacee5@shemminger-XPS-13-9360> <20190213233950.GQ26388@orbyte.nwl.cc> From: David Ahern Message-ID: <182981ee-4aec-135c-ab10-4445b6f84435@gmail.com> Date: Wed, 13 Feb 2019 16:47:30 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190213233950.GQ26388@orbyte.nwl.cc> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 2/13/19 4:39 PM, Phil Sutter wrote: >> What I would favor: >> * use big enough columns that for the common case everything lines up fine >> * if column is to wide just print that element wider (which is what print %Ns does) > > This is pretty much the situation Stefano attempted to improve, minus > scaling the columns to max terminal width. ss output formatting being > quirky and unreadable with either small or large terminals was the > number one reason I heard so far why people prefer netstat. +1. prior to Stefano's change ss was a PITA trying to read in an xterm. I for one would run the command and then have to adjust the terminal to get it to display an actual readable format. > >> and >> * add json output for programs that want to parse >> * use print_uint etc for that > > For Eric's use-case, skipping any buffering and tabular output if stdout > is not a TTY suffices. In fact, iproute2 does this already for colored > output (see check_enable_color() for reference). > > Adding JSON output support everywhere is a nice feature when it comes to > scripting, but it won't help console users. Unless you expect CLI > frontends to come turning that JSON into human-readable output. > > IMHO, JSON output wouldn't even help in this case - unless Eric indeed > prefers to write/use a JSON parser for his analysis instead of something > along 'ss | grep'. I agree. json has its uses, console/xterm for humans is not one and piping into something like jq to selectively pick columns is not a user friendly solution. > >> The buffering patch (in iproute2-next) can/will be reverted. > > It's not fair to claim that despite Stefano's commitment to fix the > reported issues. His ss output rewrite is there since v4.15.0 and > according to git history it needed only two fixes so far. I've had > one-liners which required more follow-ups than that! Also, we're still > discovering issues introduced by all the jsonify patches. Allowing for > people to get things right not the first time but after a few tries is > important. If you want to revert something, start with features which > have a fundamental design issue in the exact situation they tried to > improve, like the MSG_PEEK | MSG_TRUNC thing Hangbin and me wrote. I was just looking at the overhead of that. While it is deceiving to twice as many recvmsg calls as you expect, the overhead of the peek in reading 700k+ routes is on the order of 3% with the 32k min buffer size. The true overhead of the dump functions for ip is the device index to name mapping (just like the overhead of a batch is the name to index mapping). I will send a v2 of my patches soon.