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]
Date:	Wed, 6 Jan 2016 10:36:11 +0100
From:	Jiri Olsa <jolsa@...hat.com>
To:	Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:	Jiri Olsa <jolsa@...nel.org>, lkml <linux-kernel@...r.kernel.org>,
	David Ahern <dsahern@...il.com>,
	Ingo Molnar <mingo@...nel.org>,
	Namhyung Kim <namhyung@...nel.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	"Liang, Kan" <kan.liang@...el.com>
Subject: Re: [PATCH 6/8] perf script: Display stat events by default

On Tue, Jan 05, 2016 at 07:49:27PM -0300, Arnaldo Carvalho de Melo wrote:

SNIP

> [acme@zoo linux]$ 
> [acme@zoo linux]$ perf script
> CPU   THREAD             VAL             ENA             RUN            TIME EVENT
> 65535     4883          356474          356474          356474          690200 task-clock
> 65535     4883               1          356474          356474          690200 context-switches
> 65535     4883               0          356474          356474          690200 cpu-migrations
> 65535     4883              54          356474          356474          690200 page-faults
> 65535     4883         1044123          360329          360329          690200 cycles
> 65535     4883          716911          360329          360329          690200 stalled-cycles-frontend
> 65535     4883               0               0               0          690200 stalled-cycles-backend
> 65535     4883          694609          360329          360329          690200 instructions
> 65535     4883          140037          360329          360329          690200 branches
> 65535     4883            7920          360329          360329          690200 branch-misses
> [acme@zoo linux]$

there's wrong conversion from u16 (-1) cpu data to int cpu_map->map[0]

attached patch fixes that for me, not sure why I did
not see that before.. I'll send new version shortly

thanks,
jirka


---
diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c
index a0717b93d8f5..581aec244ac1 100644
--- a/tools/perf/util/cpumap.c
+++ b/tools/perf/util/cpumap.c
@@ -189,7 +189,7 @@ static struct cpu_map *cpu_map__from_entries(struct cpu_map_entries *cpus)
 		unsigned i;
 
 		for (i = 0; i < cpus->nr; i++)
-			map->map[i] = (int)cpus->cpu[i];
+			map->map[i] = (int)(s16)cpus->cpu[i];
 	}
 
 	return map;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ