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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to