Re: [tip:perf/core] perf evsel: Fix inverted test for fixing upattr.inherit flag

From: Peter Zijlstra
Date: Fri Apr 15 2011 - 07:12:56 EST


On Thu, 2011-04-14 at 14:01 -0300, Arnaldo Carvalho de Melo wrote:
>
> There was another, sillier problem, now seems to work, ack?
>
> [acme@emilia linux]$ perf stat ~/loop_1b_instructions-4x
>
> Performance counter stats for '/home/acme/loop_1b_instructions-4x':
>
> 1451.781634 task-clock-msecs # 3.965 CPUs
> 1,463 context-switches # 0.001 M/sec
> 3 CPU-migrations # 0.000 M/sec
> 187 page-faults # 0.000 M/sec
> 2,865,021,951 cycles # 1973.452 M/sec (scaled from 70.29%)
> 4,001,127,146 instructions # 1.397 IPC (scaled from 80.24%)
> 401,476,915 branches # 276.541 M/sec (scaled from 80.27%)
> 63,800 branch-misses # 0.016 % (scaled from 80.29%)
> 262,866 cache-references # 0.181 M/sec (scaled from 20.14%)
> 10,938 cache-misses # 0.008 M/sec (scaled from 20.07%)
>
> 0.366184692 seconds time elapsed
>
> [acme@emilia linux]$
>
> From 41d8ff6c4be9216cae74dd82381d9f486e82bf22 Mon Sep 17 00:00:00 2001
> From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> Date: Thu, 14 Apr 2011 11:20:14 -0300
> Subject: [PATCH] perf evsel: Fix use of inherit
>
> perf stat doesn't mmap and its perfectly fine for it to use task-bound
> counters with inheritance.
>
> So set the attr.inherit on the caller and leave the syscall itself to
> validate it.
>
> When the mmap fails perf_evlist__mmap will just emit a warning if this
> is the failure reason.
>
> Reported-by: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxx>
> Cc: Mike Galbraith <efault@xxxxxx>
> Cc: Paul Mackerras <paulus@xxxxxxxxx>
> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Cc: Stephane Eranian <eranian@xxxxxxxxxx>
> Cc: Tom Zanussi <tzanussi@xxxxxxxxx>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

Yay works!

Acked-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/