perf evsel: Fix inverted test for fixing up attr.inherit flag
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 21 Feb 2011 19:05:50 +0000 (16:05 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 22 Feb 2011 01:27:59 +0000 (22:27 -0300)
commite603dc15072c7fec0ae263597e6dabc3bb4c5c5b
treea4fa6e1a548570ce71b8ed97399933de7303c321
parentfbee632d0ca9f4073a3fefb9a843eac8af036b0f
perf evsel: Fix inverted test for fixing up attr.inherit flag

The kernel refuses mmapping an event with the inherit flag set for
something that is systemwide (cpu == -1), and the evsel layer got this
reversed at some point, fix it.

The symtom was that the --pid and --tid parameters for 'perf record' and
'perf top' returned with -EINVAL, like:

 # /tmp/build-perf/perf record -v -fo/tmp/perf.data -p 1042
   Warning:  ... trying to fall back to cpu-clock-ticks

   Fatal: failed to mmap with 22 (Invalid argument)

Reported-by: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/evsel.c