From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH iproute2 net-next 0/3] ss: Allow selection of columns to be displayed Date: Thu, 1 Nov 2018 14:38:35 -0700 Message-ID: <20181101143835.2e3c69ce@xeon-e3> References: <7ffc00c8-bdf6-5c75-564e-2663494bda5d@gmail.com> <20181030183420.181b3d51@redhat.com> <20181101140623.4d6211a0@cakuba.netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Jakub Kicinski , Stefano Brivio , "Yoann P." , netdev@vger.kernel.org To: David Ahern Return-path: Received: from mail-pl1-f195.google.com ([209.85.214.195]:43748 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726355AbeKBGn1 (ORCPT ); Fri, 2 Nov 2018 02:43:27 -0400 Received: by mail-pl1-f195.google.com with SMTP id g59-v6so5551502plb.10 for ; Thu, 01 Nov 2018 14:38:43 -0700 (PDT) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Thu, 1 Nov 2018 15:18:03 -0600 David Ahern wrote: > On 11/1/18 3:06 PM, Jakub Kicinski wrote: > > On Wed, 31 Oct 2018 20:48:05 -0600, David Ahern wrote: > >>> spacing with a special character in the format string, that is: > >>> > >>> "%S.%Qr.%Qs %Al:%Pl %Ar:%Pr %p\n" > >>> > >>> would mean "align everything to the right, distribute remaining > >>> whitespace between %S, %Qr and %Qs". But it looks rather complicated > >>> at a glance. > >>> > >> > >> My concern here is that once this goes in for 1 command, the others in > >> iproute2 need to follow suit - meaning same syntax style for all > >> commands. Given that I'd prefer we get a reasonable consensus on syntax > >> that will work across commands -- ss, ip, tc. If it is as simple as > >> column names with a fixed order, that is fine but just give proper > >> consideration given the impact. > > > > FWIW I just started piping iproute2 commands to jq. Example: > > > > tc -s -j qdisc show dev em1 | \ > > jq -r '.[] | [.kind,.parent,.handle,.offloaded,.bytes,.packets,.drops,.overlimits,.requeues,.backlog,.qlen,.marked] | @tsv' > > > > JSONification would probably be quite an undertaking for ss :( > > > > Right, that is used in some of the scripts under > tools/testing/selftests. I would put that in the 'heavyweight solution' > category. > > A number of key commands offer the capability to control the output via > command line argument (e.g., ps, perf script). Given the amount of data > iproute2 commands throw at a user by default, it would be a good > usability feature to allow a user to customize the output without having > to pipe it into other commands. I would rather see ss grow json support than having to make the output formatting of every iproute2 command grow a new format management. The jq tool looks cool, and I can see how someone could easily have a bunch of mini-scripts to do what they want.