• Arnaldo Carvalho de Melo's avatar
    perf evsel: Fix inverted test for fixing up attr.inherit flag · e603dc15
    Arnaldo Carvalho de Melo authored
    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: default avatarDavid 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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    e603dc15
evsel.c 8.17 KB