public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: acme@kernel.org, linux-kernel@vger.kernel.org, jolsa@kernel.org,
	Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH] perf, tools: Improve error messages for missing PMUs
Date: Fri, 15 Sep 2017 20:45:10 +0200	[thread overview]
Message-ID: <20170915184510.GB31734@krava> (raw)
In-Reply-To: <20170913215006.32222-1-andi@firstfloor.org>

On Wed, Sep 13, 2017 at 02:50:06PM -0700, Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
> 
> When a PMU is missing print a better error message mentioning
> the missing PMU.
> 
> % mkdir empty
> % mount --bind empty /sys/devices/msr
> % perf stat -M Summary true
> event syntax error: '{inst_retired.any,cycles}:W,{cpu_clk_unhalted.thread}:W,{inst_retired.any}:W,{cpu_clk_unhalted.ref_tsc,msr/tsc/}:W,{fp_comp_ops_exe.sse_scalar..'
>                      \___ Cannot find PMU `msr'. Missing kernel support?
> 
> It still cannot find the right column for aliases, but it's already a vast improvement.
> 
> v2: Check asprintf
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
>  tools/perf/util/metricgroup.c  |  2 +-
>  tools/perf/util/parse-events.c | 18 ++++++++++++------
>  tools/perf/util/parse-events.h |  3 +++
>  3 files changed, 16 insertions(+), 7 deletions(-)
> 
> diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c
> index 2d60114f1870..0794f02cbb8f 100644
> --- a/tools/perf/util/metricgroup.c
> +++ b/tools/perf/util/metricgroup.c
> @@ -477,7 +477,7 @@ int metricgroup__parse_groups(const struct option *opt,
>  	memset(&parse_error, 0, sizeof(struct parse_events_error));
>  	ret = parse_events(perf_evlist, extra_events.buf, &parse_error);
>  	if (ret) {
> -		pr_err("Cannot set up events %s\n", extra_events.buf);
> +                parse_events_print_error(&parse_error, extra_events.buf);

nit, mixed tabs/spaces indent, other than that:

Acked-by: Jiri Olsa <jolsa@kernel.org>

thanks,
jirka

  reply	other threads:[~2017-09-15 18:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-13 21:50 [PATCH] perf, tools: Improve error messages for missing PMUs Andi Kleen
2017-09-15 18:45 ` Jiri Olsa [this message]
2017-09-15 19:00   ` Arnaldo Carvalho de Melo
2017-09-22 16:43 ` [tip:perf/core] perf pmu: " tip-bot for Andi Kleen
  -- strict thread matches above, loose matches on Subject: below --
2017-09-12  0:26 [PATCH] perf, tools: " Andi Kleen
2017-09-13 13:34 ` Arnaldo Carvalho de Melo

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=20170915184510.GB31734@krava \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.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