aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/bench/mem-memset.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/bench/mem-memset.c')
-rw-r--r--tools/perf/bench/mem-memset.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/perf/bench/mem-memset.c b/tools/perf/bench/mem-memset.c
index 9af79d2b18e5..75fc3e65fb2a 100644
--- a/tools/perf/bench/mem-memset.c
+++ b/tools/perf/bench/mem-memset.c
@@ -10,6 +10,7 @@
10#include "../util/util.h" 10#include "../util/util.h"
11#include "../util/parse-options.h" 11#include "../util/parse-options.h"
12#include "../util/header.h" 12#include "../util/header.h"
13#include "../util/cloexec.h"
13#include "bench.h" 14#include "bench.h"
14#include "mem-memset-arch.h" 15#include "mem-memset-arch.h"
15 16
@@ -83,7 +84,8 @@ static struct perf_event_attr cycle_attr = {
83 84
84static void init_cycle(void) 85static void init_cycle(void)
85{ 86{
86 cycle_fd = sys_perf_event_open(&cycle_attr, getpid(), -1, -1, 0); 87 cycle_fd = sys_perf_event_open(&cycle_attr, getpid(), -1, -1,
88 perf_event_open_cloexec_flag());
87 89
88 if (cycle_fd < 0 && errno == ENOSYS) 90 if (cycle_fd < 0 && errno == ENOSYS)
89 die("No CONFIG_PERF_EVENTS=y kernel support configured?\n"); 91 die("No CONFIG_PERF_EVENTS=y kernel support configured?\n");
@@ -181,6 +183,11 @@ int bench_mem_memset(int argc, const char **argv,
181 argc = parse_options(argc, argv, options, 183 argc = parse_options(argc, argv, options,
182 bench_mem_memset_usage, 0); 184 bench_mem_memset_usage, 0);
183 185
186 if (no_prefault && only_prefault) {
187 fprintf(stderr, "Invalid options: -o and -n are mutually exclusive\n");
188 return 1;
189 }
190
184 if (use_cycle) 191 if (use_cycle)
185 init_cycle(); 192 init_cycle();
186 193