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: <20171003160605.GC25388@kernel.org>
Date:   Tue, 3 Oct 2017 13:06:05 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Jiri Olsa <jolsa@...nel.org>, Wang Nan <wangnan0@...wei.com>
Cc:     Andi Kleen <andi@...stfloor.org>, linux-kernel@...r.kernel.org,
        Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH 2/2] perf, tools: Don't force MetricExprs to lower case

Em Tue, Sep 12, 2017 at 12:56:43PM -0700, Andi Kleen escreveu:
> From: Andi Kleen <ak@...ux.intel.com>
> 
> There are still problems with BPF misinterpreting some events
> that include .c. An earlier fix made it work for stand alone
> aliases, but it still fails for more complex constructs.

Hi Wang, Jiri,

	Can you please take a look at this and see if there is something
we can do to help Andi?

- Arnaldo
 
> REJECT keeps trying and trying a shorter string until
> .c is matched and it appears like a valid BPF path.
> 
> % perf stat -e cpu/uops_executed.core,cmask=1/ true
> bpf: builtin compilation failed: -95, try external compiler
> ERROR: problems with path cpu/uops_executed.c: No such file or directory
> event syntax error: 'cpu/uops_executed.core,cmask=1/'
>                      \___ Failed to load cpu/uops_executed.c from source: Error when compiling BPF scriptlet
> 
> I tried to fix it, but it exceeds my flex knowledge, because
> REJECT does not interact well with BEGIN states.
> 
> The BPF syntax in its current form really causes an ambigious
> grammar.
> 
> A workaround for this is to spell the event upper case,
> because upper case .C does not match the BPF rules.
> 
> This currently affects some of the ILP metrics. The previous
> patch changed the ILP metrics to use upper case. Now if we
> don't force everything to lower case the matching works.
> 
> This makes ILP work correctly on my IvyBridge:
> 
> %  ./perf stat -M ILP true
> 
>  Performance counter stats for 'true':
> 
>            711,067      UOPS_EXECUTED.THREAD      #      2.3 ILP
>            311,680      cpu/UOPS_EXECUTED.CORE,cmask=1/
>            311,680      UOPS_EXECUTED.CYCLES_GE_1_UOP_EXEC
> 
>        0.000371554 seconds time elapsed
> 
> Signed-off-by: Andi Kleen <ak@...ux.intel.com>
> ---
>  tools/perf/pmu-events/jevents.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
> index 9eb7047bafe4..07c0f9a46180 100644
> --- a/tools/perf/pmu-events/jevents.c
> +++ b/tools/perf/pmu-events/jevents.c
> @@ -488,8 +488,6 @@ int json_events(const char *fn,
>  				addfield(map, &metric_group, "", "", val);
>  			} else if (json_streq(map, field, "MetricExpr")) {
>  				addfield(map, &metric_expr, "", "", val);
> -				for (s = metric_expr; *s; s++)
> -					*s = tolower(*s);
>  			}
>  			/* ignore unknown fields */
>  		}
> -- 
> 2.9.5

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ