aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavidlohr Bueso <[email protected]>2014-06-16 11:14:25 -0700
committerArnaldo Carvalho de Melo <[email protected]>2014-06-19 16:13:16 -0300
commit424e9634887842ac59c1d06d3264aaeb18853c0b (patch)
tree3e0d161ee198db2976222f2656ed280f3e4f08b9
parentd9de84afd1f3a464135abe2b26e66aa86be5af8d (diff)
perf bench mem: The -o and -n options are mutually exclusive
-o, --only-prefault Show only the result with page faults before mem* -n, --no-prefault Show only the result without page faults before mem* Makes no sense to call together. Applies to both memset and memcpy. Signed-off-by: Davidlohr Bueso <[email protected]> Cc: Aswin Chandramouleeswaran <[email protected]> Cc: Hitoshi Mitake <[email protected]> Cc: Jiri Olsa <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r--tools/perf/bench/mem-memcpy.c5
-rw-r--r--tools/perf/bench/mem-memset.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/tools/perf/bench/mem-memcpy.c b/tools/perf/bench/mem-memcpy.c
index 5ce71d3b72cf..e622c3e96efc 100644
--- a/tools/perf/bench/mem-memcpy.c
+++ b/tools/perf/bench/mem-memcpy.c
@@ -189,6 +189,11 @@ int bench_mem_memcpy(int argc, const char **argv,
argc = parse_options(argc, argv, options,
bench_mem_memcpy_usage, 0);
+ if (no_prefault && only_prefault) {
+ fprintf(stderr, "Invalid options: -o and -n are mutually exclusive\n");
+ return 1;
+ }
+
if (use_cycle)
init_cycle();
diff --git a/tools/perf/bench/mem-memset.c b/tools/perf/bench/mem-memset.c
index 9af79d2b18e5..2a65468619f0 100644
--- a/tools/perf/bench/mem-memset.c
+++ b/tools/perf/bench/mem-memset.c
@@ -181,6 +181,11 @@ int bench_mem_memset(int argc, const char **argv,
argc = parse_options(argc, argv, options,
bench_mem_memset_usage, 0);
+ if (no_prefault && only_prefault) {
+ fprintf(stderr, "Invalid options: -o and -n are mutually exclusive\n");
+ return 1;
+ }
+
if (use_cycle)
init_cycle();