]> git.baikalelectronics.ru Git - kernel.git/commit
perf tools: Enable close-on-exec flag on perf file descriptor
authorYann Droneaud <ydroneaud@opteya.com>
Mon, 30 Jun 2014 20:28:47 +0000 (22:28 +0200)
committerJiri Olsa <jolsa@kernel.org>
Fri, 18 Jul 2014 07:09:34 +0000 (09:09 +0200)
commitb88635a794661f0359b453190aef1e9ebfdc61d6
treea1c628c2bd65a943461479ad52cd4bec179e51d7
parent68bc01d283cf3e20ad26f92b83431e68d4f0a39a
perf tools: Enable close-on-exec flag on perf file descriptor

In commit 35f3ca8474b1 ('perf: Introduce a flag to enable
close-on-exec in perf_event_open()'), flag PERF_FLAG_FD_CLOEXEC
was added to perf_event_open(2) syscall to allows userspace
to atomically enable close-on-exec behavor when creating
the file descriptor.

This patch makes perf tools use the new flag if supported
by the kernel, so that the event file descriptors got
automatically closed if perf tool exec a sub-command.

Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/n/1404160127-7475-1-git-send-email-ydroneaud@opteya.com
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
tools/perf/Makefile.perf
tools/perf/bench/mem-memcpy.c
tools/perf/bench/mem-memset.c
tools/perf/builtin-sched.c
tools/perf/tests/bp_signal.c
tools/perf/tests/bp_signal_overflow.c
tools/perf/tests/rdpmc.c
tools/perf/util/cloexec.c [new file with mode: 0644]
tools/perf/util/cloexec.h [new file with mode: 0644]
tools/perf/util/evsel.c
tools/perf/util/record.c