[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKH8qBtR6tYXLWpnO4W69DxnxmEXZTad5H2oM7YT_DE0OHu+vg@mail.gmail.com>
Date: Mon, 15 Nov 2021 15:54:33 -0800
From: Stanislav Fomichev <sdf@...gle.com>
To: Quentin Monnet <quentin@...valent.com>
Cc: Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>
Subject: Re: [PATCH bpf-next v2] bpftool: add current libbpf_strict mode to
version output
On Mon, Nov 15, 2021 at 3:34 PM Quentin Monnet <quentin@...valent.com> wrote:
>
> On Mon, 15 Nov 2021 at 19:31, Stanislav Fomichev <sdf@...gle.com> wrote:
> >
> > + bpftool --legacy --version
> > bpftool v5.15.0
> > features: libbfd, skeletons
> > + bpftool --version
> > bpftool v5.15.0
> > features: libbfd, libbpf_strict, skeletons
> >
> > + bpftool --legacy --help
> > Usage: bpftool [OPTIONS] OBJECT { COMMAND | help }
> > bpftool batch file FILE
> > bpftool version
> >
> > OBJECT := { prog | map | link | cgroup | perf | net | feature | btf | gen | struct_ops | iter }
> > OPTIONS := { {-j|--json} [{-p|--pretty}] | {-d|--debug} | {-l|--legacy} |
> > {-V|--version} }
> > + bpftool --help
> > Usage: bpftool [OPTIONS] OBJECT { COMMAND | help }
> > bpftool batch file FILE
> > bpftool version
> >
> > OBJECT := { prog | map | link | cgroup | perf | net | feature | btf | gen | struct_ops | iter }
> > OPTIONS := { {-j|--json} [{-p|--pretty}] | {-d|--debug} | {-l|--legacy} |
> > {-V|--version} }
> >
> > + bpftool --legacy
> > Usage: bpftool [OPTIONS] OBJECT { COMMAND | help }
> > bpftool batch file FILE
> > bpftool version
> >
> > OBJECT := { prog | map | link | cgroup | perf | net | feature | btf | gen | struct_ops | iter }
> > OPTIONS := { {-j|--json} [{-p|--pretty}] | {-d|--debug} | {-l|--legacy} |
> > {-V|--version} }
> > + bpftool
> > Usage: bpftool [OPTIONS] OBJECT { COMMAND | help }
> > bpftool batch file FILE
> > bpftool version
> >
> > OBJECT := { prog | map | link | cgroup | perf | net | feature | btf | gen | struct_ops | iter }
> > OPTIONS := { {-j|--json} [{-p|--pretty}] | {-d|--debug} | {-l|--legacy} |
> > {-V|--version} }
> >
> > + bpftool --legacy version
> > bpftool v5.15.0
> > features: libbfd, skeletons
> > + bpftool version
> > bpftool v5.15.0
> > features: libbfd, libbpf_strict, skeletons
> >
> > + bpftool --json --legacy version
> > {"version":"5.15.0","features":{"libbfd":true,"libbpf_strict":false,"skeletons":true}}
> > + bpftool --json version
> > {"version":"5.15.0","features":{"libbfd":true,"libbpf_strict":true,"skeletons":true}}
> >
> > v2:
> > - fixes for -h and -V (Quentin Monnet)
> >
> > Suggested-by: Quentin Monnet <quentin@...valent.com>
> > Signed-off-by: Stanislav Fomichev <sdf@...gle.com>
>
> The behaviour will change in a few cases where both the help and
> version commands and/or options are provided, e.g. "bpftool -h
> version" used to print the help and will do the version instead,
> "bpftool -V help" changes in an opposite fashion. Given that there's
> no practical interest in having both commands/options, and that the
> behaviour was not really consistent so far, I consider that this is
> not an issue.
>
> However, we now have "bpftool --version" returning -1 (instead of 0).
> Any chance we can fix that? Maybe simply something like the change
> below instead?
That works as well. I didn't want to special case it, but agreed that
changing exit value might not be a good idea (I was assuming they
already return -1 and didn't check).
Will resend shortly with your version.
Powered by blists - more mailing lists