From: Adrian Hunter Date: Tue, 12 Aug 2014 15:04:28 +0000 (+0300) Subject: perf tools: Fix CLOEXEC probe for perf_event_paranoid == 2 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=a5b0153c880c2775bf5bdd78306f0a47e860ea04;p=openwrt%2Fstaging%2Fblogic.git perf tools: Fix CLOEXEC probe for perf_event_paranoid == 2 With /proc/sys/kernel/perf_event_paranoid set to 2, the probe of PERF_FLAG_FD_CLOEXEC would fail. Fix by excluding kernel profiling from the probe event. Signed-off-by: Adrian Hunter Acked-by: Jiri Olsa Acked-by: Namhyung Kim Cc: David Ahern Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/1407855871-15024-2-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/cloexec.c b/tools/perf/util/cloexec.c index 5073c01af618..000047cb3fee 100644 --- a/tools/perf/util/cloexec.c +++ b/tools/perf/util/cloexec.c @@ -11,6 +11,7 @@ static int perf_flag_probe(void) struct perf_event_attr attr = { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CPU_CLOCK, + .exclude_kernel = 1, }; int fd; int err;