lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170915184510.GB31734@krava>
Date:   Fri, 15 Sep 2017 20:45:10 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     Andi Kleen <andi@...stfloor.org>
Cc:     acme@...nel.org, linux-kernel@...r.kernel.org, jolsa@...nel.org,
        Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH] perf, tools: Improve error messages for missing PMUs

On Wed, Sep 13, 2017 at 02:50:06PM -0700, Andi Kleen wrote:
> From: Andi Kleen <ak@...ux.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@...ux.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@...nel.org>

thanks,
jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ