Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1423463imm; Fri, 22 Jun 2018 17:00:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKBULEvRVv/3hPlLyFLH0bSRusebDnfuBSl+IgdXhRWKO3NfFdEdW860/vXLNgJXnWjfbqD X-Received: by 2002:a65:49cb:: with SMTP id t11-v6mr3098042pgs.218.1529712018224; Fri, 22 Jun 2018 17:00:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529712018; cv=none; d=google.com; s=arc-20160816; b=Fntd95pUFVhGDWyXskH101keQEBonOdq+t1xrSlPowRvx4P1B33efMMXQfpZ7nBAxi SDRlk3mbKAsONviT78RKdvT5MQlgSpDD/g7nTUC/3VoSiQLmP2wn3l1g5KYHBfuDsZv+ Ri/tg2h7YaybPqIzTJMoYZ26y5D2QdPs82P/zJoAvtOYZh0kCe/S8KLATKZiqtAv+rLe 6XGhNDgpm5z/fElfryMBF7SAwQ/bbB96MqcYAmt0yI/5og24stAltw/CEE99xN0n3uDf 34CzxWZ07OWUCBCl/dmgGFwvMp8H/MWK7GnJefSvaySwkoKToAgZBDV5pM2RRNs/Pj06 wOlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=1lMxLmONJ+HASI2AOw/3vule8Y7SyHhOEbrFr2ODR6s=; b=baRp9cxODHFqaBSVkqPgkvu/IDgv9vzjSrciE1sz0PamwBd6Ktn38uQB3XC1KPt0PI NX9xRRBXpoktTYjnx1mKAQ1JcFtehtQHG5KH+GxJXW6SIfYTUSfS8bq5HPCo/hhXvEoh xv8ZrTVehmOajIYjcIuTF7kktYKBfPfxVIUmwTYnp6Swc0H4bCSq3YKK0mMuS01Wu0XR wTOgXLss+s/qS5D265wP0fSo4CyCQcBroxIZqzf0o1d59AVVLaljnrYHCC2s4WxFhWjY 4u07WaNrw+GlvN7ShD0a7rNH3xH+zuLJyPEx7hW0CgQMB26v67SGa+IeZQiJrwtHT7Oq tCnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=R++YrvkT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i64-v6si8599391pli.431.2018.06.22.17.00.03; Fri, 22 Jun 2018 17:00:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=R++YrvkT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934232AbeFVX7Z (ORCPT + 99 others); Fri, 22 Jun 2018 19:59:25 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:34002 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933839AbeFVX7X (ORCPT ); Fri, 22 Jun 2018 19:59:23 -0400 Received: from pps.filterd (m0044012.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5MNt6tl016454; Fri, 22 Jun 2018 16:59:02 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=facebook; bh=1lMxLmONJ+HASI2AOw/3vule8Y7SyHhOEbrFr2ODR6s=; b=R++YrvkT8i2zD+hKDj3Rq8/7IyBKimHQtlg8Uji1s6dd3yYfY4EMKmg5cKcTAXhSFGDh VyKLqI6nrRhlY/GW08ElsgCpC+icdb7Tdddy1vrzxvR+NtuM69AGXYwZyt0MBmQaJwNw 5TAN426MhNJafBsxmHiU4+LE0jq09h2UtaQ= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2jsaswg1nb-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 22 Jun 2018 16:59:02 -0700 Received: from kafai-mbp.dhcp.thefacebook.com (192.168.52.123) by mail.thefacebook.com (192.168.16.14) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 22 Jun 2018 16:58:56 -0700 Date: Fri, 22 Jun 2018 16:58:52 -0700 From: Martin KaFai Lau To: Jakub Kicinski CC: Okash Khawaja , Daniel Borkmann , "Alexei Starovoitov" , Yonghong Song , Quentin Monnet , "David S. Miller" , , , Subject: Re: [PATCH bpf-next 2/3] bpf: btf: add btf json print functionality Message-ID: <20180622235847.ap52ln2wmtggbxr6@kafai-mbp.dhcp.thefacebook.com> References: <20180621160719.2cfb4b58@cakuba.netronome.com> <20180621235746.dfq6kdtkogftw3ws@kafai-mbp.dhcp.thefacebook.com> <20180621172523.6cd00ed1@cakuba.netronome.com> <20180622012052.htkvholi674x6i4f@kafai-mbp.dhcp.thefacebook.com> <20180622114032.162b2a76@cakuba.netronome.com> <20180622205535.c6vjhdwt5er4wc32@kafai-mbp.dhcp.thefacebook.com> <20180622142743.2b890d0f@cakuba.netronome.com> <20180622144952.353d50c0@cakuba.netronome.com> <20180622231940.fvkxfqccvyf5uewk@kafai-mbp.dhcp.thefacebook.com> <20180622164048.6283b469@cakuba.netronome.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20180622164048.6283b469@cakuba.netronome.com> User-Agent: NeoMutt/20180512 X-Originating-IP: [192.168.52.123] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-22_03:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 22, 2018 at 04:40:48PM -0700, Jakub Kicinski wrote: > On Fri, 22 Jun 2018 16:19:40 -0700, Martin KaFai Lau wrote: > > On Fri, Jun 22, 2018 at 02:49:52PM -0700, Jakub Kicinski wrote: > > > On Fri, 22 Jun 2018 14:27:43 -0700, Jakub Kicinski wrote: > > > > BTF in JSON is very useful, and will help people who writes simple > > > > orchestration/scripts based on bpftool *a* *lot*. I really appreciate > > > > this addition to bpftool and will start using it myself as soon as it > > > > lands. I'm not sure why the reluctance to slightly change the output > > > > format? > > > > > > Ohh, maybe that's the misunderstanding, you only implemented JSON so > > > you wanted it to be as readable and clean as possible. Hence the hex > > > output and cutting out the old cruft! That perspective makes sense! > > > But I think we should keep JSON for machines (but including BTF > > > formatted values) and let's make the plain text output nice and clean, > > > agreed. > > Right, it is what my earlier comment meant on "this ascii output is > > for human". We merely call it json because we are reusing > > the json's meaning on {}, [] and int since it fits nicely > > on what we want to achieve, readability. Other than that, > > it does not have to follow other json's requirements. > > We can call it whatever except json to avoid wrong > > user expectation. Putting it under "-j"/"-p" was a mistake. > > Hence, I said this patch belongs to the 'plaintext" output. > > Yes, that were the confusion came from, right. I'm personally not sold > on JSON as "human readable" but I'm very far from a UI guru so up to > you :) We have thought of a few options but nothing else shine in term of saving the verbosity on spelling out the word like "it is a struct" , "it is an array"... and at the same time trying to use some short form that people are already familiar with. > > I think it may be good to intentionally do non-JSON things, like use > hex integers, don't put quotes around strings, or always add a comma > after value, so people can't use it as JSON even if they try. Good point. > > Basic printer is trivial to write, I'm concerned that the reuse of JSON > writer to create a user-readable output will bite us on the posterior > later on... If we can think of some better way later, we can also provide another plaintext output. I don't want to over design it at this point. Let see how it goes.