Re: [PATCH bpf-next 2/3] bpf: btf: add btf json print functionality

From: Jakub Kicinski
Date: Fri Jun 22 2018 - 14:43:23 EST


On Fri, 22 Jun 2018 12:17:52 +0100, Okash Khawaja wrote:
> > > > > > > The name XYZ_struct may not be the best, perhaps you can come up with a
> > > > > > > better one?
> > > > > > >
> > > > > > > Does that make sense? Am I missing what you're doing here?
> > > > > > >
> > > > > > > One process note - please make sure you run checkpatch.pl --strict on
> > > > > > > bpftool patches before posting.
> > > > > > >
> > > > > > > Thanks for working on this!
> > >
>
> Hi,
>
> While I agree on the point of backward compatibility, I think printing
> two overlapping pieces of information side-by-side will make the
> interface less clear. Having separate outputs for the two will keep the
> interface clear and readable.
>
> Is there a major downside to adding a new flag for BTF output?

plain output and JSON should be more or less equivalent, just formatted
differently. If we hide the BTF-ed JSON under some flag most users
will just run bpftool -jp map dump id X, see BTF is not there and move
on, without ever looking into the man page to discover there is a magic
switch...