From: Chethan Suresh <chethan.suresh@sony.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: quentin@isovalent.com, bpf@vger.kernel.org, Kenta.Tada@sony.com
Subject: Re: [PATCH bpf-next] bpftool: fix output for skipping kernel config check
Date: Tue, 13 Dec 2022 10:12:53 +0530 [thread overview]
Message-ID: <20221213044252.GA32424@43.88.80.127> (raw)
In-Reply-To: <CAEf4BzbuRywbSsTn1gjvJ-c5JtTn+xTTA8ApS0B-aLyLXFJZrw@mail.gmail.com>
On Thu, Dec 08, 2022 at 03:32:33PM -0800, Andrii Nakryiko wrote:
> On Mon, Dec 5, 2022 at 8:41 PM Chethan Suresh <chethan.suresh@sony.com> wrote:
> >
> > When bpftool feature does not find kernel config files
> > under default path, do not output CONFIG_XYZ is not set.
> > Skip kernel config check and continue.
> >
> > Signed-off-by: Chethan Suresh <chethan.suresh@sony.com>
> > Signed-off-by: Kenta Tada <Kenta.Tada@sony.com>
> > ---
> > tools/bpf/bpftool/feature.c | 14 +++++++-------
> > 1 file changed, 7 insertions(+), 7 deletions(-)
> >
> > diff --git a/tools/bpf/bpftool/feature.c b/tools/bpf/bpftool/feature.c
> > index 36cf0f1517c9..316c4a01bdb7 100644
> > --- a/tools/bpf/bpftool/feature.c
> > +++ b/tools/bpf/bpftool/feature.c
> > @@ -487,14 +487,14 @@ static void probe_kernel_image_config(const char *define_prefix)
> > }
> >
> > end_parse:
> > - if (file)
> > + if (file) {
>
> There are two error conditions when file != NULL but we actually don't
> read kconfig contents. Please handle those properly, otherwise all the
> same confusion will keep happening.
As I understand, the check should skip when file != NULL itself rather
than handling it in end_parse.
I'll send the updated patch based on review.
>
> > gzclose(file);
> > -
> > - for (i = 0; i < ARRAY_SIZE(options); i++) {
> > - if (define_prefix && !options[i].macro_dump)
> > - continue;
> > - print_kernel_option(options[i].name, values[i], define_prefix);
> > - free(values[i]);
> > + for (i = 0; i < ARRAY_SIZE(options); i++) {
> > + if (define_prefix && !options[i].macro_dump)
> > + continue;
> > + print_kernel_option(options[i].name, values[i], define_prefix);
> > + free(values[i]);
> > + }
> > }
> > }
> >
> > --
> > 2.17.1
> >
next prev parent reply other threads:[~2022-12-13 4:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-06 4:35 [PATCH bpf-next] bpftool: fix output for skipping kernel config check Chethan Suresh
2022-12-08 23:32 ` Andrii Nakryiko
2022-12-13 4:42 ` Chethan Suresh [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-01-09 2:37 Chethan Suresh
2023-01-09 10:19 ` Quentin Monnet
2023-01-11 2:00 ` patchwork-bot+netdevbpf
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=20221213044252.GA32424@43.88.80.127 \
--to=chethan.suresh@sony.com \
--cc=Kenta.Tada@sony.com \
--cc=andrii.nakryiko@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=quentin@isovalent.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