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: <20161123094619.GB19377@krava>
Date:   Wed, 23 Nov 2016 10:46:19 +0100
From:   Jiri Olsa <jolsa@...hat.com>
To:     Andi Kleen <andi@...stfloor.org>
Cc:     acme@...nel.org, jolsa@...nel.org, linux-kernel@...r.kernel.org,
        Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH 02/10] perf, tools: Parse eventcode as number in jevents

On Fri, Nov 18, 2016 at 04:36:12PM -0800, Andi Kleen wrote:
> From: Andi Kleen <ak@...ux.intel.com>
> 
> The next patch needs to modify event code. Previously eventcode was just
> passed through as a string. Now parse it as a number.
> 
> Signed-off-by: Andi Kleen <ak@...ux.intel.com>
> ---
>  tools/perf/pmu-events/jevents.c | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
> index 41611d7f9873..d343156b1dea 100644
> --- a/tools/perf/pmu-events/jevents.c
> +++ b/tools/perf/pmu-events/jevents.c
> @@ -135,7 +135,6 @@ static struct field {
>  	const char *field;
>  	const char *kernel;
>  } fields[] = {
> -	{ "EventCode",	"event=" },
>  	{ "UMask",	"umask=" },
>  	{ "CounterMask", "cmask=" },
>  	{ "Invert",	"inv=" },
> @@ -164,6 +163,9 @@ static int match_field(char *map, jsmntok_t *field, int nz,
>  
>  	for (f = fields; f->field; f++)
>  		if (json_streq(map, field, f->field) && nz) {
> +			if (json_streq(map, val, "0x00") ||
> +			     json_streq(map, val, "0x0"))
> +				return 1;

why is this needed? could you please put in the comment?

thanks,
jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ