perf tools: Fix probing the kernel API with cpu-wide events
authorAdrian Hunter <adrian.hunter@intel.com>
Tue, 12 Aug 2014 15:04:30 +0000 (18:04 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 13 Aug 2014 19:22:06 +0000 (16:22 -0300)
commit46ec69add5df60310147ce3ce01a662053d82a1e
tree3c4f17d7e58c90025a0e836a138eab753bd9b662
parentc6fa35659c5fae5f9aeb6874b177baeb2adbc02e
perf tools: Fix probing the kernel API with cpu-wide events

Fall back to probing with the current pid if cpu-wide probing fails.
This primarily affects the setting of comm_exec flag when the user is
un-privileged and /proc/sys/kernel/perf_event_paranoid > 0.

The change to comm_exec can be observed by using -vv with perf record
and a kernel that supports comm_exec.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1407855871-15024-4-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/record.c