linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Like Xu <like.xu.linux@gmail.com>, Jiri Olsa <jolsa@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf config: Refine error message to eliminate confusion
Date: Fri, 24 Sep 2021 16:06:47 -0300	[thread overview]
Message-ID: <YU4hx4jRhYLYnPiM@kernel.org> (raw)
In-Reply-To: <CAP-5=fW+Wn+_OcQWR8-UHQ42CsG6koZVw-UWBptQY8oYLsW=Vg@mail.gmail.com>

Em Fri, Sep 24, 2021 at 08:08:07AM -0700, Ian Rogers escreveu:
> On Fri, Sep 24, 2021 at 4:58 AM Like Xu <like.xu.linux@gmail.com> wrote:
> >
> > From: Like Xu <likexu@tencent.com>
> >
> > If there is no configuration file at first, the user can
> > write any pair of "key.subkey=value" to the newly created
> > configuration file, while value validation against a valid
> > configurable key is *deferred* until the next execution or
> > the implied execution of "perf config ... ".
> >
> > For example:
> >
> >  $ rm ~/.perfconfig
> >  $ perf config call-graph.dump-size=65529
> >  $ cat ~/.perfconfig
> >  # this file is auto-generated.
> >  [call-graph]
> >         dump-size = 65529
> >  $ perf config call-graph.dump-size=2048
> >  callchain: Incorrect stack dump size (max 65528): 65529
> >  Error: wrong config key-value pair call-graph.dump-size=65529
> >
> > The user might expect that the second value 2048 is valid
> > and can be updated to the configuration file, but the error
> > message is very confusing because the first value 65529 is
> > not reported as an error during the last configuration.
> >
> > It is recommended not to change the current behavior of
> > delayed validation (as more effort is needed), but to refine
> > the original error message to *clearly indicate* that the
> > cause of the error is the configuration file.
> >
> > Signed-off-by: Like Xu <likexu@tencent.com>
> 
> Acked-by: Ian Rogers <irogers@google.com>

Thanks, applied.

- Arnaldo

 
> Thanks,
> Ian
> 
> > ---
> >  tools/perf/util/config.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c
> > index 4fb5e90d7a57..60ce5908c664 100644
> > --- a/tools/perf/util/config.c
> > +++ b/tools/perf/util/config.c
> > @@ -801,7 +801,7 @@ int perf_config_set(struct perf_config_set *set,
> >                                   section->name, item->name);
> >                         ret = fn(key, value, data);
> >                         if (ret < 0) {
> > -                               pr_err("Error: wrong config key-value pair %s=%s\n",
> > +                               pr_err("Error in the given config file: wrong config key-value pair %s=%s\n",
> >                                        key, value);
> >                                 /*
> >                                  * Can't be just a 'break', as perf_config_set__for_each_entry()
> > --
> > 2.32.0
> >

-- 

- Arnaldo

      reply	other threads:[~2021-09-24 19:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-24 11:58 [PATCH] perf config: Refine error message to eliminate confusion Like Xu
2021-09-24 15:08 ` Ian Rogers
2021-09-24 19:06   ` Arnaldo Carvalho de Melo [this message]

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=YU4hx4jRhYLYnPiM@kernel.org \
    --to=acme@kernel.org \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=like.xu.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).