aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/tests/rdpmc.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/tests/rdpmc.c')
-rw-r--r--tools/perf/tests/rdpmc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/perf/tests/rdpmc.c b/tools/perf/tests/rdpmc.c
index e59143fd9e71..c04d1f268576 100644
--- a/tools/perf/tests/rdpmc.c
+++ b/tools/perf/tests/rdpmc.c
@@ -6,6 +6,7 @@
6#include "perf.h" 6#include "perf.h"
7#include "debug.h" 7#include "debug.h"
8#include "tests.h" 8#include "tests.h"
9#include "cloexec.h"
9 10
10#if defined(__x86_64__) || defined(__i386__) 11#if defined(__x86_64__) || defined(__i386__)
11 12
@@ -104,7 +105,8 @@ static int __test__rdpmc(void)
104 sa.sa_sigaction = segfault_handler; 105 sa.sa_sigaction = segfault_handler;
105 sigaction(SIGSEGV, &sa, NULL); 106 sigaction(SIGSEGV, &sa, NULL);
106 107
107 fd = sys_perf_event_open(&attr, 0, -1, -1, 0); 108 fd = sys_perf_event_open(&attr, 0, -1, -1,
109 perf_event_open_cloexec_flag());
108 if (fd < 0) { 110 if (fd < 0) {
109 pr_err("Error: sys_perf_event_open() syscall returned " 111 pr_err("Error: sys_perf_event_open() syscall returned "
110 "with %d (%s)\n", fd, strerror(errno)); 112 "with %d (%s)\n", fd, strerror(errno));