mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Martin KaFai Lau <kafai@fb.com>
Cc: Okash Khawaja <osk@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	"Alexei Starovoitov" <ast@kernel.org>, Yonghong Song <yhs@fb.com>,
	Quentin Monnet <quentin.monnet@netronome.com>,
	"David S. Miller" <davem@davemloft.net>, <netdev@vger.kernel.org>,
	<kernel-team@fb.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH bpf-next 2/3] bpf: btf: add btf json print functionality
Date: Fri, 22 Jun 2018 16:40:48 -0700	[thread overview]
Message-ID: <20180622164048.6283b469@cakuba.netronome.com> (raw)
In-Reply-To: <20180622231940.fvkxfqccvyf5uewk@kafai-mbp.dhcp.thefacebook.com>

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 :)  

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.

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...

  reply	other threads:[~2018-06-22 23:40 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-20 20:30 [PATCH bpf-next 0/3] bpf: btf: json print btf info with bpftool map dump Okash Khawaja
2018-06-20 20:30 ` [PATCH bpf-next 1/3] bpf: btf: export btf types and name by offset from lib Okash Khawaja
2018-06-20 22:40   ` Song Liu
2018-06-20 22:48     ` Okash Khawaja
2018-06-20 23:24       ` Song Liu
2018-06-20 20:30 ` [PATCH bpf-next 2/3] bpf: btf: add btf json print functionality Okash Khawaja
2018-06-20 23:14   ` Song Liu
2018-06-21 10:31     ` Okash Khawaja
2018-06-21 10:42   ` Quentin Monnet
2018-06-22 10:24     ` Okash Khawaja
2018-06-22 10:39       ` Quentin Monnet
2018-06-22 18:44         ` Jakub Kicinski
2018-06-21 21:59   ` Jakub Kicinski
2018-06-21 22:51     ` Martin KaFai Lau
2018-06-21 23:07       ` Jakub Kicinski
2018-06-21 23:58         ` Martin KaFai Lau
2018-06-22  0:25           ` Jakub Kicinski
2018-06-22  1:20             ` Martin KaFai Lau
2018-06-22 11:17               ` Okash Khawaja
2018-06-22 18:43                 ` Jakub Kicinski
2018-06-22 18:40               ` Jakub Kicinski
2018-06-22 20:58                 ` Martin KaFai Lau
2018-06-22 21:27                   ` Jakub Kicinski
2018-06-22 21:49                     ` Jakub Kicinski
2018-06-22 23:19                       ` Martin KaFai Lau
2018-06-22 23:40                         ` Jakub Kicinski [this message]
2018-06-22 23:58                           ` Martin KaFai Lau
2018-06-22 22:48                     ` Okash Khawaja
2018-06-22 22:54                     ` Martin KaFai Lau
2018-06-22 23:32                       ` Jakub Kicinski
2018-06-23  0:26                         ` Martin KaFai Lau
2018-06-26 16:48                           ` Okash Khawaja
2018-06-26 20:31                             ` Jakub Kicinski
2018-06-26 22:27                               ` Martin KaFai Lau
2018-06-26 22:35                                 ` Jakub Kicinski
2018-06-27 10:34                                   ` Daniel Borkmann
2018-06-27 11:47                                     ` Okash Khawaja
2018-06-27 12:56                                       ` Daniel Borkmann
2018-07-01 10:31                                         ` Okash Khawaja
2018-07-02 17:19                                           ` Jakub Kicinski
2018-06-20 20:30 ` [PATCH bpf-next 3/3] bpf: btf: json print map dump with btf info Okash Khawaja
2018-06-20 23:22   ` Song Liu
2018-06-21 10:05     ` Okash Khawaja
2018-06-21 10:24   ` Quentin Monnet
2018-06-21 14:26     ` Okash Khawaja

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180622164048.6283b469@cakuba.netronome.com \
    --to=jakub.kicinski@netronome.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=kafai@fb.com \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=osk@fb.com \
    --cc=quentin.monnet@netronome.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®