lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-13b1fdce8d46027f346c0533a4323b58e2b5bad8@git.kernel.org>
Date:	Tue, 20 Oct 2015 00:46:31 -0700
From:	tip-bot for Ingo Molnar <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	mingo@...nel.org, peterz@...radead.org, jolsa@...hat.com,
	hpa@...or.com, mitake@....info.waseda.ac.jp, acme@...hat.com,
	namhyung@...nel.org, dsahern@...il.com, tglx@...utronix.de,
	linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org
Subject: [tip:perf/core] perf bench mem: Improve user visible strings

Commit-ID:  13b1fdce8d46027f346c0533a4323b58e2b5bad8
Gitweb:     http://git.kernel.org/tip/13b1fdce8d46027f346c0533a4323b58e2b5bad8
Author:     Ingo Molnar <mingo@...nel.org>
AuthorDate: Mon, 19 Oct 2015 10:04:26 +0200
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Mon, 19 Oct 2015 16:07:18 -0300

perf bench mem: Improve user visible strings

 - fix various typos in user visible output strings
 - make the output consistent (wrt. capitalization and spelling)
 - offer the list of routines to benchmark on '-r help'.

Signed-off-by: Ingo Molnar <mingo@...nel.org>
Cc: David Ahern <dsahern@...il.com>
Cc: Hitoshi Mitake <mitake@....info.waseda.ac.jp>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Link: http://lkml.kernel.org/r/1445241870-24854-11-git-send-email-mingo@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/bench/mem-functions.c | 29 +++++++++++++++++------------
 tools/perf/builtin-bench.c       |  6 +++---
 2 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/tools/perf/bench/mem-functions.c b/tools/perf/bench/mem-functions.c
index 1605249..318da34 100644
--- a/tools/perf/bench/mem-functions.c
+++ b/tools/perf/bench/mem-functions.c
@@ -32,13 +32,17 @@ static int		cycles_fd;
 static const struct option options[] = {
 	OPT_STRING('l', "size", &size_str, "1MB",
 		    "Specify the size of the memory buffers. "
-		    "Available units: B, KB, MB, GB and TB (upper and lower)"),
+		    "Available units: B, KB, MB, GB and TB (case insensitive)"),
+
 	OPT_STRING('r', "routine", &routine_str, "all",
-		    "Specify the routine to run, \"all\" runs all available routines"),
+		    "Specify the routine to run, \"all\" runs all available routines, \"help\" lists them"),
+
 	OPT_INTEGER('i', "iterations", &iterations,
-		    "repeat memcpy() invocation this number of times"),
+		    "Repeat the function this number of times"),
+
 	OPT_BOOLEAN('c', "cycles", &use_cycles,
 		    "Use a cycles event instead of gettimeofday() to measure performance"),
+
 	OPT_END()
 };
 
@@ -106,13 +110,13 @@ static double timeval2double(struct timeval *ts)
 
 #define print_bps(x) do {						\
 		if (x < K)						\
-			printf(" %14lf B/Sec\n", x);			\
+			printf(" %14lf bytes/sec\n", x);		\
 		else if (x < K * K)					\
-			printf(" %14lfd KB/Sec\n", x / K);		\
+			printf(" %14lfd KB/sec\n", x / K);		\
 		else if (x < K * K * K)					\
-			printf(" %14lf MB/Sec\n", x / K / K);		\
+			printf(" %14lf MB/sec\n", x / K / K);		\
 		else							\
-			printf(" %14lf GB/Sec\n", x / K / K / K);	\
+			printf(" %14lf GB/sec\n", x / K / K / K);	\
 	} while (0)
 
 struct bench_mem_info {
@@ -128,10 +132,10 @@ static void __bench_mem_routine(struct bench_mem_info *info, int r_idx, size_t s
 	double result_bps = 0.0;
 	u64 result_cycles = 0;
 
-	printf("Routine %s (%s)\n", r->name, r->desc);
+	printf("# Routine '%s' (%s)\n", r->name, r->desc);
 
 	if (bench_format == BENCH_FORMAT_DEFAULT)
-		printf("# Copying %s Bytes ...\n\n", size_str);
+		printf("# Copying %s bytes ...\n\n", size_str);
 
 	if (use_cycles) {
 		result_cycles = info->do_cycles(r, size);
@@ -142,7 +146,7 @@ static void __bench_mem_routine(struct bench_mem_info *info, int r_idx, size_t s
 	switch (bench_format) {
 	case BENCH_FORMAT_DEFAULT:
 		if (use_cycles) {
-			printf(" %14lf cycles/Byte\n", (double)result_cycles/size_total);
+			printf(" %14lf cycles/byte\n", (double)result_cycles/size_total);
 		} else {
 			print_bps(result_bps);
 		}
@@ -192,8 +196,9 @@ static int bench_mem_common(int argc, const char **argv, struct bench_mem_info *
 			break;
 	}
 	if (!info->routines[i].name) {
-		printf("Unknown routine: %s\n", routine_str);
-		printf("Available routines...\n");
+		if (strcmp(routine_str, "help") && strcmp(routine_str, "h"))
+			printf("Unknown routine: %s\n", routine_str);
+		printf("Available routines:\n");
 		for (i = 0; info->routines[i].name; i++) {
 			printf("\t%s ... %s\n",
 			       info->routines[i].name, info->routines[i].desc);
diff --git a/tools/perf/builtin-bench.c b/tools/perf/builtin-bench.c
index 1b58521..a8fc948 100644
--- a/tools/perf/builtin-bench.c
+++ b/tools/perf/builtin-bench.c
@@ -49,9 +49,9 @@ static struct bench sched_benchmarks[] = {
 };
 
 static struct bench mem_benchmarks[] = {
-	{ "memcpy",	"Benchmark for memcpy()",			bench_mem_memcpy	},
-	{ "memset",	"Benchmark for memset() tests",			bench_mem_memset	},
-	{ "all",	"Test all memory benchmarks",			NULL			},
+	{ "memcpy",	"Benchmark for memcpy() functions",		bench_mem_memcpy	},
+	{ "memset",	"Benchmark for memset() functions",		bench_mem_memset	},
+	{ "all",	"Test all memory access benchmarks",		NULL			},
 	{ NULL,		NULL,						NULL			}
 };
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ