]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - tools/perf/tests/bp_signal_overflow.c
perf tools: Enable close-on-exec flag on perf file descriptor
[karo-tx-linux.git] / tools / perf / tests / bp_signal_overflow.c
index 44ac82179708b50d6ab559cb9258c8334ab70fff..e76537724491850342753c0b5ddead454555b899 100644 (file)
@@ -24,6 +24,7 @@
 #include "tests.h"
 #include "debug.h"
 #include "perf.h"
+#include "cloexec.h"
 
 static int overflows;
 
@@ -91,7 +92,8 @@ int test__bp_signal_overflow(void)
        pe.exclude_kernel = 1;
        pe.exclude_hv = 1;
 
-       fd = sys_perf_event_open(&pe, 0, -1, -1, 0);
+       fd = sys_perf_event_open(&pe, 0, -1, -1,
+                                perf_event_open_cloexec_flag());
        if (fd < 0) {
                pr_debug("failed opening event %llx\n", pe.config);
                return TEST_FAIL;