Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1250418 > unrolled thread
| Started by | Ingo Molnar <mingo@kernel.org> |
|---|---|
| First post | 2015-10-19 10:10 +0200 |
| Last post | 2015-10-19 21:10 +0200 |
| Articles | 20 on this page of 44 — 5 participants |
Back to article view | Back to linux.kernel
[PATCH 00/14] perf bench: Misc improvements Ingo Molnar <mingo@kernel.org> - 2015-10-19 10:10 +0200
[PATCH 12/14] perf/bench: Harmonize all the -l/--nr_loops options Ingo Molnar <mingo@kernel.org> - 2015-10-19 10:10 +0200
[tip:perf/core] perf bench: Harmonize all the -l/ --nr_loops options tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-10-20 09:50 +0200
[PATCH 09/14] perf/bench/mem: Fix 'length' vs. 'size' naming confusion Ingo Molnar <mingo@kernel.org> - 2015-10-19 10:10 +0200
[tip:perf/core] perf bench mem: Fix 'length' vs. 'size' naming confusion tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-10-20 09:50 +0200
[PATCH 07/14] perf/bench/mem: Change 'cycle' to 'cycles' Ingo Molnar <mingo@kernel.org> - 2015-10-19 10:10 +0200
[tip:perf/core] perf bench mem: Change 'cycle' to 'cycles' tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-10-20 09:50 +0200
[PATCH 14/14] perf/bench: Run benchmarks, don't test them Ingo Molnar <mingo@kernel.org> - 2015-10-19 10:10 +0200
[tip:perf/core] perf bench: Run benchmarks, don't test them tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-10-20 09:50 +0200
[PATCH 10/14] perf/bench/mem: Improve user visible strings Ingo Molnar <mingo@kernel.org> - 2015-10-19 10:10 +0200
[tip:perf/core] perf bench mem: Improve user visible strings tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-10-20 09:50 +0200
[PATCH 11/14] perf/bench/mem: Reorganize the code a bit Ingo Molnar <mingo@kernel.org> - 2015-10-19 10:10 +0200
[tip:perf/core] perf bench mem: Reorganize the code a bit tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-10-20 09:50 +0200
[PATCH 13/14] perf/bench/mem: Rename 'routine' to 'function' Ingo Molnar <mingo@kernel.org> - 2015-10-19 10:10 +0200
[tip:perf/core] perf bench mem: Rename 'routine' to 'function' tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-10-20 09:50 +0200
[PATCH 08/14] perf/bench/mem: Rename 'routine' to 'routine_str' Ingo Molnar <mingo@kernel.org> - 2015-10-19 10:10 +0200
Re: [PATCH 08/14] perf/bench/mem: Rename 'routine' to 'routine_str' David Ahern <dsahern@gmail.com> - 2015-10-19 15:40 +0200
Re: [PATCH 08/14] perf/bench/mem: Rename 'routine' to 'routine_str' Arnaldo Carvalho de Melo <acme@redhat.com> - 2015-10-19 21:00 +0200
Re: [PATCH 08/14] perf/bench/mem: Rename 'routine' to 'routine_str' Arnaldo Carvalho de Melo <acme@redhat.com> - 2015-10-19 21:00 +0200
Re: [PATCH 08/14] perf/bench/mem: Rename 'routine' to 'routine_str' Ingo Molnar <mingo@kernel.org> - 2015-10-19 21:10 +0200
Re: [PATCH 08/14] perf/bench/mem: Rename 'routine' to 'routine_str' Arnaldo Carvalho de Melo <acme@redhat.com> - 2015-10-19 21:30 +0200
Re: [PATCH 08/14] perf/bench/mem: Rename 'routine' to 'routine_str' Arnaldo Carvalho de Melo <acme@redhat.com> - 2015-10-19 21:30 +0200
Re: [PATCH 08/14] perf/bench/mem: Rename 'routine' to 'routine_str' Ingo Molnar <mingo@kernel.org> - 2015-10-20 09:40 +0200
[tip:perf/core] perf bench mem: Rename 'routine' to 'routine_str' tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-10-20 09:50 +0200
[PATCH 02/14] perf/bench: Default to all routines in 'perf bench mem' Ingo Molnar <mingo@kernel.org> - 2015-10-19 10:20 +0200
Re: [PATCH 02/14] perf/bench: Default to all routines in 'perf bench mem' Linus Torvalds <torvalds@linux-foundation.org> - 2015-10-19 17:30 +0200
Re: [PATCH 02/14] perf/bench: Default to all routines in 'perf bench mem' Ingo Molnar <mingo@kernel.org> - 2015-10-19 19:50 +0200
[tip:perf/core] perf bench: Default to all routines in ' perf bench mem' tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-10-20 09:50 +0200
[PATCH 06/14] perf/bench: List output formatting options on 'perf bench -h' Ingo Molnar <mingo@kernel.org> - 2015-10-19 10:20 +0200
Re: [PATCH 06/14] perf/bench: List output formatting options on 'perf bench -h' David Ahern <dsahern@gmail.com> - 2015-10-19 15:30 +0200
Re: [PATCH 06/14] perf/bench: List output formatting options on 'perf bench -h' Arnaldo Carvalho de Melo <acme@redhat.com> - 2015-10-19 21:00 +0200
[tip:perf/core] perf bench: List output formatting options on ' perf bench -h' tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-10-20 09:50 +0200
[PATCH 05/14] perf/bench: Remove the prefaulting complication from 'perf bench mem mem*' Ingo Molnar <mingo@kernel.org> - 2015-10-19 10:20 +0200
[tip:perf/core] perf bench: Remove the prefaulting complication from 'perf bench mem mem*' tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-10-20 09:50 +0200
[PATCH 04/14] perf/bench: Rename 'mem-memcpy.c' => 'mem-functions.c' Ingo Molnar <mingo@kernel.org> - 2015-10-19 10:20 +0200
Re: [PATCH 04/14] perf/bench: Rename 'mem-memcpy.c' => 'mem-functions.c' Arnaldo Carvalho de Melo <acme@redhat.com> - 2015-10-19 20:40 +0200
Re: [PATCH 04/14] perf/bench: Rename 'mem-memcpy.c' => 'mem-functions.c' Arnaldo Carvalho de Melo <acme@redhat.com> - 2015-10-19 20:40 +0200
[tip:perf/core] perf bench: Rename 'mem-memcpy.c' => ' mem-functions.c' tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-10-20 09:50 +0200
[PATCH 03/14] perf/bench: Eliminate unused argument from bench_mem_common() Ingo Molnar <mingo@kernel.org> - 2015-10-19 10:20 +0200
[tip:perf/core] perf bench: Eliminate unused argument from bench_mem_common() tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-10-20 09:50 +0200
[PATCH 01/14] perf/bench: Improve the 'perf bench mem memcpy' code readability Ingo Molnar <mingo@kernel.org> - 2015-10-19 10:20 +0200
[tip:perf/core] perf bench: Improve the 'perf bench mem memcpy' code readability tip-bot for Ingo Molnar <tipbot@zytor.com> - 2015-10-20 09:50 +0200
Re: [PATCH 00/14] perf bench: Misc improvements David Ahern <dsahern@gmail.com> - 2015-10-19 15:50 +0200
Re: [PATCH 00/14] perf bench: Misc improvements Arnaldo Carvalho de Melo <acme@redhat.com> - 2015-10-19 21:10 +0200
Page 1 of 3 [1] 2 3 Next page →
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2015-10-19 10:10 +0200 |
| Subject | [PATCH 00/14] perf bench: Misc improvements |
| Message-ID | <qldG1-6ST-3@gated-at.bofh.it> |
So I'm working towards adding more 'perf bench' benchmarks and found
a few rough edges - fixed by the series below.
Thanks,
Ingo
Ingo Molnar (14):
perf/bench: Improve the 'perf bench mem memcpy' code readability
perf/bench: Default to all routines in 'perf bench mem'
perf/bench: Eliminate unused argument from bench_mem_common()
perf/bench: Rename 'mem-memcpy.c' => 'mem-functions.c'
perf/bench: Remove the prefaulting complication from 'perf bench mem mem*'
perf/bench: List output formatting options on 'perf bench -h'
perf/bench/mem: Change 'cycle' to 'cycles'
perf/bench/mem: Rename 'routine' to 'routine_str'
perf/bench/mem: Fix 'length' vs. 'size' naming confusion
perf/bench/mem: Improve user visible strings
perf/bench/mem: Reorganize the code a bit
perf/bench: Harmonize all the -l/--nr_loops options
perf/bench/mem: Rename 'routine' to 'function'
perf/bench: Run benchmarks, don't test them
tools/perf/bench/Build | 2 +-
tools/perf/bench/mem-functions.c | 379 +++++++++++++++++++++++++++++++++++++++++++++++++
tools/perf/bench/mem-memcpy.c | 434 ---------------------------------------------------------
tools/perf/bench/numa.c | 4 +-
tools/perf/bench/sched-messaging.c | 10 +-
tools/perf/builtin-bench.c | 14 +-
6 files changed, 394 insertions(+), 449 deletions(-)
create mode 100644 tools/perf/bench/mem-functions.c
delete mode 100644 tools/perf/bench/mem-memcpy.c
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2015-10-19 10:10 +0200 |
| Subject | [PATCH 12/14] perf/bench: Harmonize all the -l/--nr_loops options |
| Message-ID | <qldG1-6ST-9@gated-at.bofh.it> |
| In reply to | #1250418 |
We have three benchmarking subsystems that specify some sort of
'number of loops' parameter - but all of them do it inconsistently:
numa: -l/--nr_loops
sched messaging: -l/--loops
mem memset/memcpy: -i/--iterations
Harmonize them to -l/--nr_loops by picking the numa variant - which
is also the most likely one to have existing scripting which we don't
want to break.
Plus improve the parameter help texts to indicate the default value
for the nr_loops variable to keep users from guessing ...
Also propagate the naming to internal variables.
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
tools/perf/bench/mem-functions.c | 22 +++++++++++-----------
tools/perf/bench/numa.c | 4 ++--
tools/perf/bench/sched-messaging.c | 10 +++++-----
3 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/tools/perf/bench/mem-functions.c b/tools/perf/bench/mem-functions.c
index f701b5b56079..65e7297de4b1 100644
--- a/tools/perf/bench/mem-functions.c
+++ b/tools/perf/bench/mem-functions.c
@@ -25,20 +25,20 @@
static const char *size_str = "1MB";
static const char *routine_str = "all";
-static int iterations = 1;
+static int nr_loops = 1;
static bool use_cycles;
static int cycles_fd;
static const struct option options[] = {
- OPT_STRING('l', "size", &size_str, "1MB",
+ OPT_STRING('s', "size", &size_str, "1MB",
"Specify the size of the memory buffers. "
"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, \"help\" lists them"),
- OPT_INTEGER('i', "iterations", &iterations,
- "Repeat the function this number of times"),
+ OPT_INTEGER('l', "nr_loops", &nr_loops,
+ "Specify the number of loops to run. (default: 1)"),
OPT_BOOLEAN('c', "cycles", &use_cycles,
"Use a cycles event instead of gettimeofday() to measure performance"),
@@ -159,7 +159,7 @@ static int bench_mem_common(int argc, const char **argv, struct bench_mem_info *
init_cycles();
size = (size_t)perf_atoll((char *)size_str);
- size_total = (double)size * iterations;
+ size_total = (double)size * nr_loops;
if ((s64)size <= 0) {
fprintf(stderr, "Invalid size:%s\n", size_str);
@@ -222,7 +222,7 @@ static u64 do_memcpy_cycles(const struct routine *r, size_t size)
fn(dst, src, size);
cycle_start = get_cycles();
- for (i = 0; i < iterations; ++i)
+ for (i = 0; i < nr_loops; ++i)
fn(dst, src, size);
cycle_end = get_cycles();
@@ -247,7 +247,7 @@ static double do_memcpy_gettimeofday(const struct routine *r, size_t size)
fn(dst, src, size);
BUG_ON(gettimeofday(&tv_start, NULL));
- for (i = 0; i < iterations; ++i)
+ for (i = 0; i < nr_loops; ++i)
fn(dst, src, size);
BUG_ON(gettimeofday(&tv_end, NULL));
@@ -256,7 +256,7 @@ static double do_memcpy_gettimeofday(const struct routine *r, size_t size)
free(src);
free(dst);
- return (double)(((double)size * iterations) / timeval2double(&tv_diff));
+ return (double)(((double)size * nr_loops) / timeval2double(&tv_diff));
}
struct routine memcpy_routines[] = {
@@ -313,7 +313,7 @@ static u64 do_memset_cycles(const struct routine *r, size_t size)
fn(dst, -1, size);
cycle_start = get_cycles();
- for (i = 0; i < iterations; ++i)
+ for (i = 0; i < nr_loops; ++i)
fn(dst, i, size);
cycle_end = get_cycles();
@@ -337,14 +337,14 @@ static double do_memset_gettimeofday(const struct routine *r, size_t size)
fn(dst, -1, size);
BUG_ON(gettimeofday(&tv_start, NULL));
- for (i = 0; i < iterations; ++i)
+ for (i = 0; i < nr_loops; ++i)
fn(dst, i, size);
BUG_ON(gettimeofday(&tv_end, NULL));
timersub(&tv_end, &tv_start, &tv_diff);
free(dst);
- return (double)(((double)size * iterations) / timeval2double(&tv_diff));
+ return (double)(((double)size * nr_loops) / timeval2double(&tv_diff));
}
static const char * const bench_mem_memset_usage[] = {
diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c
index 870b7e665a20..492df2752a2d 100644
--- a/tools/perf/bench/numa.c
+++ b/tools/perf/bench/numa.c
@@ -164,8 +164,8 @@ static const struct option options[] = {
OPT_STRING('L', "mb_proc_locked", &p0.mb_proc_locked_str,"MB", "process serialized/locked memory access (MBs), <= process_memory"),
OPT_STRING('T', "mb_thread" , &p0.mb_thread_str, "MB", "thread memory (MBs)"),
- OPT_UINTEGER('l', "nr_loops" , &p0.nr_loops, "max number of loops to run"),
- OPT_UINTEGER('s', "nr_secs" , &p0.nr_secs, "max number of seconds to run"),
+ OPT_UINTEGER('l', "nr_loops" , &p0.nr_loops, "max number of loops to run (default: unlimited)"),
+ OPT_UINTEGER('s', "nr_secs" , &p0.nr_secs, "max number of seconds to run (default: 5 secs)"),
OPT_UINTEGER('u', "usleep" , &p0.sleep_usecs, "usecs to sleep per loop iteration"),
OPT_BOOLEAN('R', "data_reads" , &p0.data_reads, "access the data via writes (can be mixed with -W)"),
diff --git a/tools/perf/bench/sched-messaging.c b/tools/perf/bench/sched-messaging.c
index d7f281c2828d..d4ff1b539cfd 100644
--- a/tools/perf/bench/sched-messaging.c
+++ b/tools/perf/bench/sched-messaging.c
@@ -33,7 +33,7 @@
#define DATASIZE 100
static bool use_pipes = false;
-static unsigned int loops = 100;
+static unsigned int nr_loops = 100;
static bool thread_mode = false;
static unsigned int num_groups = 10;
@@ -79,7 +79,7 @@ static void ready(int ready_out, int wakefd)
err(EXIT_FAILURE, "poll");
}
-/* Sender sprays loops messages down each file descriptor */
+/* Sender sprays nr_loops messages down each file descriptor */
static void *sender(struct sender_context *ctx)
{
char data[DATASIZE];
@@ -88,7 +88,7 @@ static void *sender(struct sender_context *ctx)
ready(ctx->ready_out, ctx->wakefd);
/* Now pump to every receiver. */
- for (i = 0; i < loops; i++) {
+ for (i = 0; i < nr_loops; i++) {
for (j = 0; j < ctx->num_fds; j++) {
int ret, done = 0;
@@ -213,7 +213,7 @@ static unsigned int group(pthread_t *pth,
/* Create the pipe between client and server */
fdpair(fds);
- ctx->num_packets = num_fds * loops;
+ ctx->num_packets = num_fds * nr_loops;
ctx->in_fds[0] = fds[0];
ctx->in_fds[1] = fds[1];
ctx->ready_out = ready_out;
@@ -250,7 +250,7 @@ static const struct option options[] = {
OPT_BOOLEAN('t', "thread", &thread_mode,
"Be multi thread instead of multi process"),
OPT_UINTEGER('g', "group", &num_groups, "Specify number of groups"),
- OPT_UINTEGER('l', "loop", &loops, "Specify number of loops"),
+ OPT_UINTEGER('l', "nr_loops", &nr_loops, "Specify the number of loops to run (default: 100)"),
OPT_END()
};
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Ingo Molnar <tipbot@zytor.com> |
|---|---|
| Date | 2015-10-20 09:50 +0200 |
| Subject | [tip:perf/core] perf bench: Harmonize all the -l/ --nr_loops options |
| Message-ID | <qlzQf-5Bb-47@gated-at.bofh.it> |
| In reply to | #1250419 |
Commit-ID: b0d22e52e3d2c2b151dfaa0f6e01bafa5475344f
Gitweb: http://git.kernel.org/tip/b0d22e52e3d2c2b151dfaa0f6e01bafa5475344f
Author: Ingo Molnar <mingo@kernel.org>
AuthorDate: Mon, 19 Oct 2015 10:04:28 +0200
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 19 Oct 2015 16:10:05 -0300
perf bench: Harmonize all the -l/--nr_loops options
We have three benchmarking subsystems that specify some sort of 'number
of loops' parameter - but all of them do it inconsistently:
numa: -l/--nr_loops
sched messaging: -l/--loops
mem memset/memcpy: -i/--iterations
Harmonize them to -l/--nr_loops by picking the numa variant - which is
also the most likely one to have existing scripting which we don't want
to break.
Plus improve the parameter help texts to indicate the default value for
the nr_loops variable to keep users from guessing ...
Also propagate the naming to internal variables.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1445241870-24854-13-git-send-email-mingo@kernel.org
[ Let the harmonisation reach the perf-bench man page as well ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Documentation/perf-bench.txt | 10 +++++-----
tools/perf/bench/mem-functions.c | 22 +++++++++++-----------
tools/perf/bench/numa.c | 4 ++--
tools/perf/bench/sched-messaging.c | 10 +++++-----
4 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/tools/perf/Documentation/perf-bench.txt b/tools/perf/Documentation/perf-bench.txt
index bbd27d8..ddfb3e1 100644
--- a/tools/perf/Documentation/perf-bench.txt
+++ b/tools/perf/Documentation/perf-bench.txt
@@ -82,7 +82,7 @@ Be multi thread instead of multi process
Specify number of groups
-l::
---loop=::
+--nr_loops=::
Specify number of loops
Example of *messaging*
@@ -149,8 +149,8 @@ Specify routine to copy (default: default).
Available routines are depend on the architecture.
On x86-64, x86-64-unrolled, x86-64-movsq and x86-64-movsb are supported.
--i::
---iterations::
+-l::
+--nr_loops::
Repeat memcpy invocation this number of times.
-c::
@@ -173,8 +173,8 @@ Specify routine to set (default: default).
Available routines are depend on the architecture.
On x86-64, x86-64-unrolled, x86-64-stosq and x86-64-stosb are supported.
--i::
---iterations::
+-l::
+--nr_loops::
Repeat memset invocation this number of times.
-c::
diff --git a/tools/perf/bench/mem-functions.c b/tools/perf/bench/mem-functions.c
index 8d980d4..c5dfabd 100644
--- a/tools/perf/bench/mem-functions.c
+++ b/tools/perf/bench/mem-functions.c
@@ -25,20 +25,20 @@
static const char *size_str = "1MB";
static const char *routine_str = "all";
-static int iterations = 1;
+static int nr_loops = 1;
static bool use_cycles;
static int cycles_fd;
static const struct option options[] = {
- OPT_STRING('l', "size", &size_str, "1MB",
+ OPT_STRING('s', "size", &size_str, "1MB",
"Specify the size of the memory buffers. "
"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, \"help\" lists them"),
- OPT_INTEGER('i', "iterations", &iterations,
- "Repeat the function this number of times"),
+ OPT_INTEGER('l', "nr_loops", &nr_loops,
+ "Specify the number of loops to run. (default: 1)"),
OPT_BOOLEAN('c', "cycles", &use_cycles,
"Use a cycles event instead of gettimeofday() to measure performance"),
@@ -159,7 +159,7 @@ static int bench_mem_common(int argc, const char **argv, struct bench_mem_info *
init_cycles();
size = (size_t)perf_atoll((char *)size_str);
- size_total = (double)size * iterations;
+ size_total = (double)size * nr_loops;
if ((s64)size <= 0) {
fprintf(stderr, "Invalid size:%s\n", size_str);
@@ -222,7 +222,7 @@ static u64 do_memcpy_cycles(const struct routine *r, size_t size)
fn(dst, src, size);
cycle_start = get_cycles();
- for (i = 0; i < iterations; ++i)
+ for (i = 0; i < nr_loops; ++i)
fn(dst, src, size);
cycle_end = get_cycles();
@@ -247,7 +247,7 @@ static double do_memcpy_gettimeofday(const struct routine *r, size_t size)
fn(dst, src, size);
BUG_ON(gettimeofday(&tv_start, NULL));
- for (i = 0; i < iterations; ++i)
+ for (i = 0; i < nr_loops; ++i)
fn(dst, src, size);
BUG_ON(gettimeofday(&tv_end, NULL));
@@ -256,7 +256,7 @@ static double do_memcpy_gettimeofday(const struct routine *r, size_t size)
free(src);
free(dst);
- return (double)(((double)size * iterations) / timeval2double(&tv_diff));
+ return (double)(((double)size * nr_loops) / timeval2double(&tv_diff));
}
struct routine memcpy_routines[] = {
@@ -313,7 +313,7 @@ static u64 do_memset_cycles(const struct routine *r, size_t size)
fn(dst, -1, size);
cycle_start = get_cycles();
- for (i = 0; i < iterations; ++i)
+ for (i = 0; i < nr_loops; ++i)
fn(dst, i, size);
cycle_end = get_cycles();
@@ -337,14 +337,14 @@ static double do_memset_gettimeofday(const struct routine *r, size_t size)
fn(dst, -1, size);
BUG_ON(gettimeofday(&tv_start, NULL));
- for (i = 0; i < iterations; ++i)
+ for (i = 0; i < nr_loops; ++i)
fn(dst, i, size);
BUG_ON(gettimeofday(&tv_end, NULL));
timersub(&tv_end, &tv_start, &tv_diff);
free(dst);
- return (double)(((double)size * iterations) / timeval2double(&tv_diff));
+ return (double)(((double)size * nr_loops) / timeval2double(&tv_diff));
}
static const char * const bench_mem_memset_usage[] = {
diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c
index 870b7e6..492df27 100644
--- a/tools/perf/bench/numa.c
+++ b/tools/perf/bench/numa.c
@@ -164,8 +164,8 @@ static const struct option options[] = {
OPT_STRING('L', "mb_proc_locked", &p0.mb_proc_locked_str,"MB", "process serialized/locked memory access (MBs), <= process_memory"),
OPT_STRING('T', "mb_thread" , &p0.mb_thread_str, "MB", "thread memory (MBs)"),
- OPT_UINTEGER('l', "nr_loops" , &p0.nr_loops, "max number of loops to run"),
- OPT_UINTEGER('s', "nr_secs" , &p0.nr_secs, "max number of seconds to run"),
+ OPT_UINTEGER('l', "nr_loops" , &p0.nr_loops, "max number of loops to run (default: unlimited)"),
+ OPT_UINTEGER('s', "nr_secs" , &p0.nr_secs, "max number of seconds to run (default: 5 secs)"),
OPT_UINTEGER('u', "usleep" , &p0.sleep_usecs, "usecs to sleep per loop iteration"),
OPT_BOOLEAN('R', "data_reads" , &p0.data_reads, "access the data via writes (can be mixed with -W)"),
diff --git a/tools/perf/bench/sched-messaging.c b/tools/perf/bench/sched-messaging.c
index d7f281c..d4ff1b5 100644
--- a/tools/perf/bench/sched-messaging.c
+++ b/tools/perf/bench/sched-messaging.c
@@ -33,7 +33,7 @@
#define DATASIZE 100
static bool use_pipes = false;
-static unsigned int loops = 100;
+static unsigned int nr_loops = 100;
static bool thread_mode = false;
static unsigned int num_groups = 10;
@@ -79,7 +79,7 @@ static void ready(int ready_out, int wakefd)
err(EXIT_FAILURE, "poll");
}
-/* Sender sprays loops messages down each file descriptor */
+/* Sender sprays nr_loops messages down each file descriptor */
static void *sender(struct sender_context *ctx)
{
char data[DATASIZE];
@@ -88,7 +88,7 @@ static void *sender(struct sender_context *ctx)
ready(ctx->ready_out, ctx->wakefd);
/* Now pump to every receiver. */
- for (i = 0; i < loops; i++) {
+ for (i = 0; i < nr_loops; i++) {
for (j = 0; j < ctx->num_fds; j++) {
int ret, done = 0;
@@ -213,7 +213,7 @@ static unsigned int group(pthread_t *pth,
/* Create the pipe between client and server */
fdpair(fds);
- ctx->num_packets = num_fds * loops;
+ ctx->num_packets = num_fds * nr_loops;
ctx->in_fds[0] = fds[0];
ctx->in_fds[1] = fds[1];
ctx->ready_out = ready_out;
@@ -250,7 +250,7 @@ static const struct option options[] = {
OPT_BOOLEAN('t', "thread", &thread_mode,
"Be multi thread instead of multi process"),
OPT_UINTEGER('g', "group", &num_groups, "Specify number of groups"),
- OPT_UINTEGER('l', "loop", &loops, "Specify number of loops"),
+ OPT_UINTEGER('l', "nr_loops", &nr_loops, "Specify the number of loops to run (default: 100)"),
OPT_END()
};
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2015-10-19 10:10 +0200 |
| Subject | [PATCH 09/14] perf/bench/mem: Fix 'length' vs. 'size' naming confusion |
| Message-ID | <qldG1-6ST-1@gated-at.bofh.it> |
| In reply to | #1250418 |
So 'perf bench mem memcpy/memset' consistently uses 'len' and 'length'
for buffer sizes - while it's really a memory buffer size. (strings
have length.)
Rename all affected variables.
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
tools/perf/bench/mem-functions.c | 92 ++++++++++++++++++++++++++++++------------------------------
1 file changed, 46 insertions(+), 46 deletions(-)
diff --git a/tools/perf/bench/mem-functions.c b/tools/perf/bench/mem-functions.c
index fc2afd1bfb4e..0cd9020b8601 100644
--- a/tools/perf/bench/mem-functions.c
+++ b/tools/perf/bench/mem-functions.c
@@ -23,15 +23,15 @@
#define K 1024
-static const char *length_str = "1MB";
+static const char *size_str = "1MB";
static const char *routine_str = "all";
static int iterations = 1;
static bool use_cycles;
static int cycles_fd;
static const struct option options[] = {
- OPT_STRING('l', "length", &length_str, "1MB",
- "Specify length of memory to copy. "
+ 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)"),
OPT_STRING('r', "routine", &routine_str, "all",
"Specify the routine to run, \"all\" runs all available routines"),
@@ -117,12 +117,12 @@ static double timeval2double(struct timeval *ts)
struct bench_mem_info {
const struct routine *routines;
- u64 (*do_cycles)(const struct routine *r, size_t len);
- double (*do_gettimeofday)(const struct routine *r, size_t len);
+ u64 (*do_cycles)(const struct routine *r, size_t size);
+ double (*do_gettimeofday)(const struct routine *r, size_t size);
const char *const *usage;
};
-static void __bench_mem_routine(struct bench_mem_info *info, int r_idx, size_t len, double totallen)
+static void __bench_mem_routine(struct bench_mem_info *info, int r_idx, size_t size, double size_total)
{
const struct routine *r = &info->routines[r_idx];
double result_bps = 0.0;
@@ -131,18 +131,18 @@ static void __bench_mem_routine(struct bench_mem_info *info, int r_idx, size_t l
printf("routine %s (%s)\n", r->name, r->desc);
if (bench_format == BENCH_FORMAT_DEFAULT)
- printf("# Copying %s Bytes ...\n\n", length_str);
+ printf("# Copying %s Bytes ...\n\n", size_str);
if (use_cycles) {
- result_cycles = info->do_cycles(r, len);
+ result_cycles = info->do_cycles(r, size);
} else {
- result_bps = info->do_gettimeofday(r, len);
+ result_bps = info->do_gettimeofday(r, size);
}
switch (bench_format) {
case BENCH_FORMAT_DEFAULT:
if (use_cycles) {
- printf(" %14lf cycles/Byte\n", (double)result_cycles/totallen);
+ printf(" %14lf cycles/Byte\n", (double)result_cycles/size_total);
} else {
print_bps(result_bps);
}
@@ -150,7 +150,7 @@ static void __bench_mem_routine(struct bench_mem_info *info, int r_idx, size_t l
case BENCH_FORMAT_SIMPLE:
if (use_cycles) {
- printf("%lf\n", (double)result_cycles/totallen);
+ printf("%lf\n", (double)result_cycles/size_total);
} else {
printf("%lf\n", result_bps);
}
@@ -165,25 +165,25 @@ static void __bench_mem_routine(struct bench_mem_info *info, int r_idx, size_t l
static int bench_mem_common(int argc, const char **argv, struct bench_mem_info *info)
{
int i;
- size_t len;
- double totallen;
+ size_t size;
+ double size_total;
argc = parse_options(argc, argv, options, info->usage, 0);
if (use_cycles)
init_cycles();
- len = (size_t)perf_atoll((char *)length_str);
- totallen = (double)len * iterations;
+ size = (size_t)perf_atoll((char *)size_str);
+ size_total = (double)size * iterations;
- if ((s64)len <= 0) {
- fprintf(stderr, "Invalid length:%s\n", length_str);
+ if ((s64)size <= 0) {
+ fprintf(stderr, "Invalid size:%s\n", size_str);
return 1;
}
if (!strncmp(routine_str, "all", 3)) {
for (i = 0; info->routines[i].name; i++)
- __bench_mem_routine(info, i, len, totallen);
+ __bench_mem_routine(info, i, size, size_total);
return 0;
}
@@ -201,43 +201,43 @@ static int bench_mem_common(int argc, const char **argv, struct bench_mem_info *
return 1;
}
- __bench_mem_routine(info, i, len, totallen);
+ __bench_mem_routine(info, i, size, size_total);
return 0;
}
-static void memcpy_alloc_mem(void **dst, void **src, size_t length)
+static void memcpy_alloc_mem(void **dst, void **src, size_t size)
{
- *dst = zalloc(length);
+ *dst = zalloc(size);
if (!*dst)
- die("memory allocation failed - maybe length is too large?\n");
+ die("memory allocation failed - maybe size is too large?\n");
- *src = zalloc(length);
+ *src = zalloc(size);
if (!*src)
- die("memory allocation failed - maybe length is too large?\n");
+ die("memory allocation failed - maybe size is too large?\n");
/* Make sure to always prefault zero pages even if MMAP_THRESH is crossed: */
- memset(*src, 0, length);
+ memset(*src, 0, size);
}
-static u64 do_memcpy_cycles(const struct routine *r, size_t len)
+static u64 do_memcpy_cycles(const struct routine *r, size_t size)
{
u64 cycle_start = 0ULL, cycle_end = 0ULL;
void *src = NULL, *dst = NULL;
memcpy_t fn = r->fn.memcpy;
int i;
- memcpy_alloc_mem(&dst, &src, len);
+ memcpy_alloc_mem(&dst, &src, size);
/*
* We prefault the freshly allocated memory range here,
* to not measure page fault overhead:
*/
- fn(dst, src, len);
+ fn(dst, src, size);
cycle_start = get_cycles();
for (i = 0; i < iterations; ++i)
- fn(dst, src, len);
+ fn(dst, src, size);
cycle_end = get_cycles();
free(src);
@@ -245,24 +245,24 @@ static u64 do_memcpy_cycles(const struct routine *r, size_t len)
return cycle_end - cycle_start;
}
-static double do_memcpy_gettimeofday(const struct routine *r, size_t len)
+static double do_memcpy_gettimeofday(const struct routine *r, size_t size)
{
struct timeval tv_start, tv_end, tv_diff;
memcpy_t fn = r->fn.memcpy;
void *src = NULL, *dst = NULL;
int i;
- memcpy_alloc_mem(&dst, &src, len);
+ memcpy_alloc_mem(&dst, &src, size);
/*
* We prefault the freshly allocated memory range here,
* to not measure page fault overhead:
*/
- fn(dst, src, len);
+ fn(dst, src, size);
BUG_ON(gettimeofday(&tv_start, NULL));
for (i = 0; i < iterations; ++i)
- fn(dst, src, len);
+ fn(dst, src, size);
BUG_ON(gettimeofday(&tv_end, NULL));
timersub(&tv_end, &tv_start, &tv_diff);
@@ -270,7 +270,7 @@ static double do_memcpy_gettimeofday(const struct routine *r, size_t len)
free(src);
free(dst);
- return (double)(((double)len * iterations) / timeval2double(&tv_diff));
+ return (double)(((double)size * iterations) / timeval2double(&tv_diff));
}
int bench_mem_memcpy(int argc, const char **argv, const char *prefix __maybe_unused)
@@ -285,61 +285,61 @@ int bench_mem_memcpy(int argc, const char **argv, const char *prefix __maybe_unu
return bench_mem_common(argc, argv, &info);
}
-static void memset_alloc_mem(void **dst, size_t length)
+static void memset_alloc_mem(void **dst, size_t size)
{
- *dst = zalloc(length);
+ *dst = zalloc(size);
if (!*dst)
- die("memory allocation failed - maybe length is too large?\n");
+ die("memory allocation failed - maybe size is too large?\n");
}
-static u64 do_memset_cycles(const struct routine *r, size_t len)
+static u64 do_memset_cycles(const struct routine *r, size_t size)
{
u64 cycle_start = 0ULL, cycle_end = 0ULL;
memset_t fn = r->fn.memset;
void *dst = NULL;
int i;
- memset_alloc_mem(&dst, len);
+ memset_alloc_mem(&dst, size);
/*
* We prefault the freshly allocated memory range here,
* to not measure page fault overhead:
*/
- fn(dst, -1, len);
+ fn(dst, -1, size);
cycle_start = get_cycles();
for (i = 0; i < iterations; ++i)
- fn(dst, i, len);
+ fn(dst, i, size);
cycle_end = get_cycles();
free(dst);
return cycle_end - cycle_start;
}
-static double do_memset_gettimeofday(const struct routine *r, size_t len)
+static double do_memset_gettimeofday(const struct routine *r, size_t size)
{
struct timeval tv_start, tv_end, tv_diff;
memset_t fn = r->fn.memset;
void *dst = NULL;
int i;
- memset_alloc_mem(&dst, len);
+ memset_alloc_mem(&dst, size);
/*
* We prefault the freshly allocated memory range here,
* to not measure page fault overhead:
*/
- fn(dst, -1, len);
+ fn(dst, -1, size);
BUG_ON(gettimeofday(&tv_start, NULL));
for (i = 0; i < iterations; ++i)
- fn(dst, i, len);
+ fn(dst, i, size);
BUG_ON(gettimeofday(&tv_end, NULL));
timersub(&tv_end, &tv_start, &tv_diff);
free(dst);
- return (double)(((double)len * iterations) / timeval2double(&tv_diff));
+ return (double)(((double)size * iterations) / timeval2double(&tv_diff));
}
static const char * const bench_mem_memset_usage[] = {
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Ingo Molnar <tipbot@zytor.com> |
|---|---|
| Date | 2015-10-20 09:50 +0200 |
| Subject | [tip:perf/core] perf bench mem: Fix 'length' vs. 'size' naming confusion |
| Message-ID | <qlzQd-5Bb-7@gated-at.bofh.it> |
| In reply to | #1250420 |
Commit-ID: a69b4f741340a52d0976636a45c9976a883f03a0
Gitweb: http://git.kernel.org/tip/a69b4f741340a52d0976636a45c9976a883f03a0
Author: Ingo Molnar <mingo@kernel.org>
AuthorDate: Mon, 19 Oct 2015 10:04:25 +0200
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 19 Oct 2015 16:07:11 -0300
perf bench mem: Fix 'length' vs. 'size' naming confusion
So 'perf bench mem memcpy/memset' consistently uses 'len' and 'length'
for buffer sizes - while it's really a memory buffer size. (strings have
length.)
Rename all affected variables.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1445241870-24854-10-git-send-email-mingo@kernel.org
[ Update perf-bench man page ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Documentation/perf-bench.txt | 8 +--
tools/perf/bench/mem-functions.c | 92 ++++++++++++++++-----------------
2 files changed, 50 insertions(+), 50 deletions(-)
diff --git a/tools/perf/Documentation/perf-bench.txt b/tools/perf/Documentation/perf-bench.txt
index 17135ef..bbd27d8 100644
--- a/tools/perf/Documentation/perf-bench.txt
+++ b/tools/perf/Documentation/perf-bench.txt
@@ -139,8 +139,8 @@ Suite for evaluating performance of simple memory copy in various ways.
Options of *memcpy*
^^^^^^^^^^^^^^^^^^^
-l::
---length::
-Specify length of memory to copy (default: 1MB).
+--size::
+Specify size of memory to copy (default: 1MB).
Available units are B, KB, MB, GB and TB (case insensitive).
-r::
@@ -163,8 +163,8 @@ Suite for evaluating performance of simple memory set in various ways.
Options of *memset*
^^^^^^^^^^^^^^^^^^^
-l::
---length::
-Specify length of memory to set (default: 1MB).
+--size::
+Specify size of memory to set (default: 1MB).
Available units are B, KB, MB, GB and TB (case insensitive).
-r::
diff --git a/tools/perf/bench/mem-functions.c b/tools/perf/bench/mem-functions.c
index a76e57f..1605249 100644
--- a/tools/perf/bench/mem-functions.c
+++ b/tools/perf/bench/mem-functions.c
@@ -23,15 +23,15 @@
#define K 1024
-static const char *length_str = "1MB";
+static const char *size_str = "1MB";
static const char *routine_str = "all";
static int iterations = 1;
static bool use_cycles;
static int cycles_fd;
static const struct option options[] = {
- OPT_STRING('l', "length", &length_str, "1MB",
- "Specify length of memory to copy. "
+ 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)"),
OPT_STRING('r', "routine", &routine_str, "all",
"Specify the routine to run, \"all\" runs all available routines"),
@@ -117,12 +117,12 @@ static double timeval2double(struct timeval *ts)
struct bench_mem_info {
const struct routine *routines;
- u64 (*do_cycles)(const struct routine *r, size_t len);
- double (*do_gettimeofday)(const struct routine *r, size_t len);
+ u64 (*do_cycles)(const struct routine *r, size_t size);
+ double (*do_gettimeofday)(const struct routine *r, size_t size);
const char *const *usage;
};
-static void __bench_mem_routine(struct bench_mem_info *info, int r_idx, size_t len, double totallen)
+static void __bench_mem_routine(struct bench_mem_info *info, int r_idx, size_t size, double size_total)
{
const struct routine *r = &info->routines[r_idx];
double result_bps = 0.0;
@@ -131,18 +131,18 @@ static void __bench_mem_routine(struct bench_mem_info *info, int r_idx, size_t l
printf("Routine %s (%s)\n", r->name, r->desc);
if (bench_format == BENCH_FORMAT_DEFAULT)
- printf("# Copying %s Bytes ...\n\n", length_str);
+ printf("# Copying %s Bytes ...\n\n", size_str);
if (use_cycles) {
- result_cycles = info->do_cycles(r, len);
+ result_cycles = info->do_cycles(r, size);
} else {
- result_bps = info->do_gettimeofday(r, len);
+ result_bps = info->do_gettimeofday(r, size);
}
switch (bench_format) {
case BENCH_FORMAT_DEFAULT:
if (use_cycles) {
- printf(" %14lf cycles/Byte\n", (double)result_cycles/totallen);
+ printf(" %14lf cycles/Byte\n", (double)result_cycles/size_total);
} else {
print_bps(result_bps);
}
@@ -150,7 +150,7 @@ static void __bench_mem_routine(struct bench_mem_info *info, int r_idx, size_t l
case BENCH_FORMAT_SIMPLE:
if (use_cycles) {
- printf("%lf\n", (double)result_cycles/totallen);
+ printf("%lf\n", (double)result_cycles/size_total);
} else {
printf("%lf\n", result_bps);
}
@@ -165,25 +165,25 @@ static void __bench_mem_routine(struct bench_mem_info *info, int r_idx, size_t l
static int bench_mem_common(int argc, const char **argv, struct bench_mem_info *info)
{
int i;
- size_t len;
- double totallen;
+ size_t size;
+ double size_total;
argc = parse_options(argc, argv, options, info->usage, 0);
if (use_cycles)
init_cycles();
- len = (size_t)perf_atoll((char *)length_str);
- totallen = (double)len * iterations;
+ size = (size_t)perf_atoll((char *)size_str);
+ size_total = (double)size * iterations;
- if ((s64)len <= 0) {
- fprintf(stderr, "Invalid length:%s\n", length_str);
+ if ((s64)size <= 0) {
+ fprintf(stderr, "Invalid size:%s\n", size_str);
return 1;
}
if (!strncmp(routine_str, "all", 3)) {
for (i = 0; info->routines[i].name; i++)
- __bench_mem_routine(info, i, len, totallen);
+ __bench_mem_routine(info, i, size, size_total);
return 0;
}
@@ -201,43 +201,43 @@ static int bench_mem_common(int argc, const char **argv, struct bench_mem_info *
return 1;
}
- __bench_mem_routine(info, i, len, totallen);
+ __bench_mem_routine(info, i, size, size_total);
return 0;
}
-static void memcpy_alloc_mem(void **dst, void **src, size_t length)
+static void memcpy_alloc_mem(void **dst, void **src, size_t size)
{
- *dst = zalloc(length);
+ *dst = zalloc(size);
if (!*dst)
- die("memory allocation failed - maybe length is too large?\n");
+ die("memory allocation failed - maybe size is too large?\n");
- *src = zalloc(length);
+ *src = zalloc(size);
if (!*src)
- die("memory allocation failed - maybe length is too large?\n");
+ die("memory allocation failed - maybe size is too large?\n");
/* Make sure to always prefault zero pages even if MMAP_THRESH is crossed: */
- memset(*src, 0, length);
+ memset(*src, 0, size);
}
-static u64 do_memcpy_cycles(const struct routine *r, size_t len)
+static u64 do_memcpy_cycles(const struct routine *r, size_t size)
{
u64 cycle_start = 0ULL, cycle_end = 0ULL;
void *src = NULL, *dst = NULL;
memcpy_t fn = r->fn.memcpy;
int i;
- memcpy_alloc_mem(&dst, &src, len);
+ memcpy_alloc_mem(&dst, &src, size);
/*
* We prefault the freshly allocated memory range here,
* to not measure page fault overhead:
*/
- fn(dst, src, len);
+ fn(dst, src, size);
cycle_start = get_cycles();
for (i = 0; i < iterations; ++i)
- fn(dst, src, len);
+ fn(dst, src, size);
cycle_end = get_cycles();
free(src);
@@ -245,24 +245,24 @@ static u64 do_memcpy_cycles(const struct routine *r, size_t len)
return cycle_end - cycle_start;
}
-static double do_memcpy_gettimeofday(const struct routine *r, size_t len)
+static double do_memcpy_gettimeofday(const struct routine *r, size_t size)
{
struct timeval tv_start, tv_end, tv_diff;
memcpy_t fn = r->fn.memcpy;
void *src = NULL, *dst = NULL;
int i;
- memcpy_alloc_mem(&dst, &src, len);
+ memcpy_alloc_mem(&dst, &src, size);
/*
* We prefault the freshly allocated memory range here,
* to not measure page fault overhead:
*/
- fn(dst, src, len);
+ fn(dst, src, size);
BUG_ON(gettimeofday(&tv_start, NULL));
for (i = 0; i < iterations; ++i)
- fn(dst, src, len);
+ fn(dst, src, size);
BUG_ON(gettimeofday(&tv_end, NULL));
timersub(&tv_end, &tv_start, &tv_diff);
@@ -270,7 +270,7 @@ static double do_memcpy_gettimeofday(const struct routine *r, size_t len)
free(src);
free(dst);
- return (double)(((double)len * iterations) / timeval2double(&tv_diff));
+ return (double)(((double)size * iterations) / timeval2double(&tv_diff));
}
int bench_mem_memcpy(int argc, const char **argv, const char *prefix __maybe_unused)
@@ -285,61 +285,61 @@ int bench_mem_memcpy(int argc, const char **argv, const char *prefix __maybe_unu
return bench_mem_common(argc, argv, &info);
}
-static void memset_alloc_mem(void **dst, size_t length)
+static void memset_alloc_mem(void **dst, size_t size)
{
- *dst = zalloc(length);
+ *dst = zalloc(size);
if (!*dst)
- die("memory allocation failed - maybe length is too large?\n");
+ die("memory allocation failed - maybe size is too large?\n");
}
-static u64 do_memset_cycles(const struct routine *r, size_t len)
+static u64 do_memset_cycles(const struct routine *r, size_t size)
{
u64 cycle_start = 0ULL, cycle_end = 0ULL;
memset_t fn = r->fn.memset;
void *dst = NULL;
int i;
- memset_alloc_mem(&dst, len);
+ memset_alloc_mem(&dst, size);
/*
* We prefault the freshly allocated memory range here,
* to not measure page fault overhead:
*/
- fn(dst, -1, len);
+ fn(dst, -1, size);
cycle_start = get_cycles();
for (i = 0; i < iterations; ++i)
- fn(dst, i, len);
+ fn(dst, i, size);
cycle_end = get_cycles();
free(dst);
return cycle_end - cycle_start;
}
-static double do_memset_gettimeofday(const struct routine *r, size_t len)
+static double do_memset_gettimeofday(const struct routine *r, size_t size)
{
struct timeval tv_start, tv_end, tv_diff;
memset_t fn = r->fn.memset;
void *dst = NULL;
int i;
- memset_alloc_mem(&dst, len);
+ memset_alloc_mem(&dst, size);
/*
* We prefault the freshly allocated memory range here,
* to not measure page fault overhead:
*/
- fn(dst, -1, len);
+ fn(dst, -1, size);
BUG_ON(gettimeofday(&tv_start, NULL));
for (i = 0; i < iterations; ++i)
- fn(dst, i, len);
+ fn(dst, i, size);
BUG_ON(gettimeofday(&tv_end, NULL));
timersub(&tv_end, &tv_start, &tv_diff);
free(dst);
- return (double)(((double)len * iterations) / timeval2double(&tv_diff));
+ return (double)(((double)size * iterations) / timeval2double(&tv_diff));
}
static const char * const bench_mem_memset_usage[] = {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2015-10-19 10:10 +0200 |
| Subject | [PATCH 07/14] perf/bench/mem: Change 'cycle' to 'cycles' |
| Message-ID | <qldG1-6ST-17@gated-at.bofh.it> |
| In reply to | #1250418 |
So 'perf bench mem memset/memcpy' has a CPU cycles measurement method,
but calls it 'cycle' (singular) throughout the code, which makes it
harder to read.
Rename all related functions, variables and options to a plural 'cycles'
nomenclature.
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
tools/perf/bench/mem-functions.c | 56 ++++++++++++++++++++++++++++----------------------------
1 file changed, 28 insertions(+), 28 deletions(-)
diff --git a/tools/perf/bench/mem-functions.c b/tools/perf/bench/mem-functions.c
index d822ee0c6003..150414de1497 100644
--- a/tools/perf/bench/mem-functions.c
+++ b/tools/perf/bench/mem-functions.c
@@ -26,8 +26,8 @@
static const char *length_str = "1MB";
static const char *routine = "all";
static int iterations = 1;
-static bool use_cycle;
-static int cycle_fd;
+static bool use_cycles;
+static int cycles_fd;
static const struct option options[] = {
OPT_STRING('l', "length", &length_str, "1MB",
@@ -37,8 +37,8 @@ static const struct option options[] = {
"Specify routine to copy, \"all\" runs all available routines"),
OPT_INTEGER('i', "iterations", &iterations,
"repeat memcpy() invocation this number of times"),
- OPT_BOOLEAN('c', "cycle", &use_cycle,
- "Use cycles event instead of gettimeofday() for measuring"),
+ OPT_BOOLEAN('c', "cycles", &use_cycles,
+ "Use a cycles event instead of gettimeofday() to measure performance"),
OPT_END()
};
@@ -78,22 +78,22 @@ static struct perf_event_attr cycle_attr = {
.config = PERF_COUNT_HW_CPU_CYCLES
};
-static void init_cycle(void)
+static void init_cycles(void)
{
- cycle_fd = sys_perf_event_open(&cycle_attr, getpid(), -1, -1, perf_event_open_cloexec_flag());
+ cycles_fd = sys_perf_event_open(&cycle_attr, getpid(), -1, -1, perf_event_open_cloexec_flag());
- if (cycle_fd < 0 && errno == ENOSYS)
+ if (cycles_fd < 0 && errno == ENOSYS)
die("No CONFIG_PERF_EVENTS=y kernel support configured?\n");
else
- BUG_ON(cycle_fd < 0);
+ BUG_ON(cycles_fd < 0);
}
-static u64 get_cycle(void)
+static u64 get_cycles(void)
{
int ret;
u64 clk;
- ret = read(cycle_fd, &clk, sizeof(u64));
+ ret = read(cycles_fd, &clk, sizeof(u64));
BUG_ON(ret != sizeof(u64));
return clk;
@@ -117,7 +117,7 @@ static double timeval2double(struct timeval *ts)
struct bench_mem_info {
const struct routine *routines;
- u64 (*do_cycle)(const struct routine *r, size_t len);
+ u64 (*do_cycles)(const struct routine *r, size_t len);
double (*do_gettimeofday)(const struct routine *r, size_t len);
const char *const *usage;
};
@@ -126,31 +126,31 @@ static void __bench_mem_routine(struct bench_mem_info *info, int r_idx, size_t l
{
const struct routine *r = &info->routines[r_idx];
double result_bps = 0.0;
- u64 result_cycle = 0;
+ u64 result_cycles = 0;
printf("Routine %s (%s)\n", r->name, r->desc);
if (bench_format == BENCH_FORMAT_DEFAULT)
printf("# Copying %s Bytes ...\n\n", length_str);
- if (use_cycle) {
- result_cycle = info->do_cycle(r, len);
+ if (use_cycles) {
+ result_cycles = info->do_cycles(r, len);
} else {
result_bps = info->do_gettimeofday(r, len);
}
switch (bench_format) {
case BENCH_FORMAT_DEFAULT:
- if (use_cycle) {
- printf(" %14lf Cycle/Byte\n", (double)result_cycle/totallen);
+ if (use_cycles) {
+ printf(" %14lf cycles/Byte\n", (double)result_cycles/totallen);
} else {
print_bps(result_bps);
}
break;
case BENCH_FORMAT_SIMPLE:
- if (use_cycle) {
- printf("%lf\n", (double)result_cycle/totallen);
+ if (use_cycles) {
+ printf("%lf\n", (double)result_cycles/totallen);
} else {
printf("%lf\n", result_bps);
}
@@ -170,8 +170,8 @@ static int bench_mem_common(int argc, const char **argv, struct bench_mem_info *
argc = parse_options(argc, argv, options, info->usage, 0);
- if (use_cycle)
- init_cycle();
+ if (use_cycles)
+ init_cycles();
len = (size_t)perf_atoll((char *)length_str);
totallen = (double)len * iterations;
@@ -220,7 +220,7 @@ static void memcpy_alloc_mem(void **dst, void **src, size_t length)
memset(*src, 0, length);
}
-static u64 do_memcpy_cycle(const struct routine *r, size_t len)
+static u64 do_memcpy_cycles(const struct routine *r, size_t len)
{
u64 cycle_start = 0ULL, cycle_end = 0ULL;
void *src = NULL, *dst = NULL;
@@ -235,10 +235,10 @@ static u64 do_memcpy_cycle(const struct routine *r, size_t len)
*/
fn(dst, src, len);
- cycle_start = get_cycle();
+ cycle_start = get_cycles();
for (i = 0; i < iterations; ++i)
fn(dst, src, len);
- cycle_end = get_cycle();
+ cycle_end = get_cycles();
free(src);
free(dst);
@@ -277,7 +277,7 @@ int bench_mem_memcpy(int argc, const char **argv, const char *prefix __maybe_unu
{
struct bench_mem_info info = {
.routines = memcpy_routines,
- .do_cycle = do_memcpy_cycle,
+ .do_cycles = do_memcpy_cycles,
.do_gettimeofday = do_memcpy_gettimeofday,
.usage = bench_mem_memcpy_usage,
};
@@ -292,7 +292,7 @@ static void memset_alloc_mem(void **dst, size_t length)
die("memory allocation failed - maybe length is too large?\n");
}
-static u64 do_memset_cycle(const struct routine *r, size_t len)
+static u64 do_memset_cycles(const struct routine *r, size_t len)
{
u64 cycle_start = 0ULL, cycle_end = 0ULL;
memset_t fn = r->fn.memset;
@@ -307,10 +307,10 @@ static u64 do_memset_cycle(const struct routine *r, size_t len)
*/
fn(dst, -1, len);
- cycle_start = get_cycle();
+ cycle_start = get_cycles();
for (i = 0; i < iterations; ++i)
fn(dst, i, len);
- cycle_end = get_cycle();
+ cycle_end = get_cycles();
free(dst);
return cycle_end - cycle_start;
@@ -365,7 +365,7 @@ int bench_mem_memset(int argc, const char **argv, const char *prefix __maybe_unu
{
struct bench_mem_info info = {
.routines = memset_routines,
- .do_cycle = do_memset_cycle,
+ .do_cycles = do_memset_cycles,
.do_gettimeofday = do_memset_gettimeofday,
.usage = bench_mem_memset_usage,
};
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Ingo Molnar <tipbot@zytor.com> |
|---|---|
| Date | 2015-10-20 09:50 +0200 |
| Subject | [tip:perf/core] perf bench mem: Change 'cycle' to 'cycles' |
| Message-ID | <qlzQg-5Bb-77@gated-at.bofh.it> |
| In reply to | #1250423 |
Commit-ID: b14f2d357675bd7fb4e5a705ac7320a9638ecab5
Gitweb: http://git.kernel.org/tip/b14f2d357675bd7fb4e5a705ac7320a9638ecab5
Author: Ingo Molnar <mingo@kernel.org>
AuthorDate: Mon, 19 Oct 2015 10:04:23 +0200
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 19 Oct 2015 16:05:01 -0300
perf bench mem: Change 'cycle' to 'cycles'
So 'perf bench mem memset/memcpy' has a CPU cycles measurement method,
but calls it 'cycle' (singular) throughout the code, which makes it
harder to read.
Rename all related functions, variables and options to a plural 'cycles'
nomenclature.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1445241870-24854-8-git-send-email-mingo@kernel.org
[ s/--cycle/--cycles/g in perf-bench man page ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Documentation/perf-bench.txt | 4 +--
tools/perf/bench/mem-functions.c | 56 ++++++++++++++++-----------------
2 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/tools/perf/Documentation/perf-bench.txt b/tools/perf/Documentation/perf-bench.txt
index 9cb60ab..17135ef 100644
--- a/tools/perf/Documentation/perf-bench.txt
+++ b/tools/perf/Documentation/perf-bench.txt
@@ -154,7 +154,7 @@ On x86-64, x86-64-unrolled, x86-64-movsq and x86-64-movsb are supported.
Repeat memcpy invocation this number of times.
-c::
---cycle::
+--cycles::
Use perf's cpu-cycles event instead of gettimeofday syscall.
*memset*::
@@ -178,7 +178,7 @@ On x86-64, x86-64-unrolled, x86-64-stosq and x86-64-stosb are supported.
Repeat memset invocation this number of times.
-c::
---cycle::
+--cycles::
Use perf's cpu-cycles event instead of gettimeofday syscall.
SUITES FOR 'numa'
diff --git a/tools/perf/bench/mem-functions.c b/tools/perf/bench/mem-functions.c
index 9c18a4b..6fe8667 100644
--- a/tools/perf/bench/mem-functions.c
+++ b/tools/perf/bench/mem-functions.c
@@ -26,8 +26,8 @@
static const char *length_str = "1MB";
static const char *routine = "all";
static int iterations = 1;
-static bool use_cycle;
-static int cycle_fd;
+static bool use_cycles;
+static int cycles_fd;
static const struct option options[] = {
OPT_STRING('l', "length", &length_str, "1MB",
@@ -37,8 +37,8 @@ static const struct option options[] = {
"Specify routine to copy, \"all\" runs all available routines"),
OPT_INTEGER('i', "iterations", &iterations,
"repeat memcpy() invocation this number of times"),
- OPT_BOOLEAN('c', "cycle", &use_cycle,
- "Use cycles event instead of gettimeofday() for measuring"),
+ OPT_BOOLEAN('c', "cycles", &use_cycles,
+ "Use a cycles event instead of gettimeofday() to measure performance"),
OPT_END()
};
@@ -78,22 +78,22 @@ static struct perf_event_attr cycle_attr = {
.config = PERF_COUNT_HW_CPU_CYCLES
};
-static void init_cycle(void)
+static void init_cycles(void)
{
- cycle_fd = sys_perf_event_open(&cycle_attr, getpid(), -1, -1, perf_event_open_cloexec_flag());
+ cycles_fd = sys_perf_event_open(&cycle_attr, getpid(), -1, -1, perf_event_open_cloexec_flag());
- if (cycle_fd < 0 && errno == ENOSYS)
+ if (cycles_fd < 0 && errno == ENOSYS)
die("No CONFIG_PERF_EVENTS=y kernel support configured?\n");
else
- BUG_ON(cycle_fd < 0);
+ BUG_ON(cycles_fd < 0);
}
-static u64 get_cycle(void)
+static u64 get_cycles(void)
{
int ret;
u64 clk;
- ret = read(cycle_fd, &clk, sizeof(u64));
+ ret = read(cycles_fd, &clk, sizeof(u64));
BUG_ON(ret != sizeof(u64));
return clk;
@@ -117,7 +117,7 @@ static double timeval2double(struct timeval *ts)
struct bench_mem_info {
const struct routine *routines;
- u64 (*do_cycle)(const struct routine *r, size_t len);
+ u64 (*do_cycles)(const struct routine *r, size_t len);
double (*do_gettimeofday)(const struct routine *r, size_t len);
const char *const *usage;
};
@@ -126,31 +126,31 @@ static void __bench_mem_routine(struct bench_mem_info *info, int r_idx, size_t l
{
const struct routine *r = &info->routines[r_idx];
double result_bps = 0.0;
- u64 result_cycle = 0;
+ u64 result_cycles = 0;
printf("Routine %s (%s)\n", r->name, r->desc);
if (bench_format == BENCH_FORMAT_DEFAULT)
printf("# Copying %s Bytes ...\n\n", length_str);
- if (use_cycle) {
- result_cycle = info->do_cycle(r, len);
+ if (use_cycles) {
+ result_cycles = info->do_cycles(r, len);
} else {
result_bps = info->do_gettimeofday(r, len);
}
switch (bench_format) {
case BENCH_FORMAT_DEFAULT:
- if (use_cycle) {
- printf(" %14lf Cycle/Byte\n", (double)result_cycle/totallen);
+ if (use_cycles) {
+ printf(" %14lf cycles/Byte\n", (double)result_cycles/totallen);
} else {
print_bps(result_bps);
}
break;
case BENCH_FORMAT_SIMPLE:
- if (use_cycle) {
- printf("%lf\n", (double)result_cycle/totallen);
+ if (use_cycles) {
+ printf("%lf\n", (double)result_cycles/totallen);
} else {
printf("%lf\n", result_bps);
}
@@ -170,8 +170,8 @@ static int bench_mem_common(int argc, const char **argv, struct bench_mem_info *
argc = parse_options(argc, argv, options, info->usage, 0);
- if (use_cycle)
- init_cycle();
+ if (use_cycles)
+ init_cycles();
len = (size_t)perf_atoll((char *)length_str);
totallen = (double)len * iterations;
@@ -220,7 +220,7 @@ static void memcpy_alloc_mem(void **dst, void **src, size_t length)
memset(*src, 0, length);
}
-static u64 do_memcpy_cycle(const struct routine *r, size_t len)
+static u64 do_memcpy_cycles(const struct routine *r, size_t len)
{
u64 cycle_start = 0ULL, cycle_end = 0ULL;
void *src = NULL, *dst = NULL;
@@ -235,10 +235,10 @@ static u64 do_memcpy_cycle(const struct routine *r, size_t len)
*/
fn(dst, src, len);
- cycle_start = get_cycle();
+ cycle_start = get_cycles();
for (i = 0; i < iterations; ++i)
fn(dst, src, len);
- cycle_end = get_cycle();
+ cycle_end = get_cycles();
free(src);
free(dst);
@@ -277,7 +277,7 @@ int bench_mem_memcpy(int argc, const char **argv, const char *prefix __maybe_unu
{
struct bench_mem_info info = {
.routines = memcpy_routines,
- .do_cycle = do_memcpy_cycle,
+ .do_cycles = do_memcpy_cycles,
.do_gettimeofday = do_memcpy_gettimeofday,
.usage = bench_mem_memcpy_usage,
};
@@ -292,7 +292,7 @@ static void memset_alloc_mem(void **dst, size_t length)
die("memory allocation failed - maybe length is too large?\n");
}
-static u64 do_memset_cycle(const struct routine *r, size_t len)
+static u64 do_memset_cycles(const struct routine *r, size_t len)
{
u64 cycle_start = 0ULL, cycle_end = 0ULL;
memset_t fn = r->fn.memset;
@@ -307,10 +307,10 @@ static u64 do_memset_cycle(const struct routine *r, size_t len)
*/
fn(dst, -1, len);
- cycle_start = get_cycle();
+ cycle_start = get_cycles();
for (i = 0; i < iterations; ++i)
fn(dst, i, len);
- cycle_end = get_cycle();
+ cycle_end = get_cycles();
free(dst);
return cycle_end - cycle_start;
@@ -365,7 +365,7 @@ int bench_mem_memset(int argc, const char **argv, const char *prefix __maybe_unu
{
struct bench_mem_info info = {
.routines = memset_routines,
- .do_cycle = do_memset_cycle,
+ .do_cycles = do_memset_cycles,
.do_gettimeofday = do_memset_gettimeofday,
.usage = bench_mem_memset_usage,
};
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2015-10-19 10:10 +0200 |
| Subject | [PATCH 14/14] perf/bench: Run benchmarks, don't test them |
| Message-ID | <qldG2-6ST-23@gated-at.bofh.it> |
| In reply to | #1250418 |
So right now we output this text:
memcpy: Benchmark for memcpy() functions
memset: Benchmark for memset() functions
all: Test all memory access benchmarks
But the right verb to use with benchmarks is to 'run' them,
not 'test' them.
So change this (and all similar texts) to:
memcpy: Benchmark for memcpy() functions
memset: Benchmark for memset() functions
all: Run all memory access benchmarks
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
tools/perf/builtin-bench.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/perf/builtin-bench.c b/tools/perf/builtin-bench.c
index a8fc948c8ace..b17aed36ca16 100644
--- a/tools/perf/builtin-bench.c
+++ b/tools/perf/builtin-bench.c
@@ -36,7 +36,7 @@ struct bench {
#ifdef HAVE_LIBNUMA_SUPPORT
static struct bench numa_benchmarks[] = {
{ "mem", "Benchmark for NUMA workloads", bench_numa },
- { "all", "Test all NUMA benchmarks", NULL },
+ { "all", "Run all NUMA benchmarks", NULL },
{ NULL, NULL, NULL }
};
#endif
@@ -44,14 +44,14 @@ static struct bench numa_benchmarks[] = {
static struct bench sched_benchmarks[] = {
{ "messaging", "Benchmark for scheduling and IPC", bench_sched_messaging },
{ "pipe", "Benchmark for pipe() between two processes", bench_sched_pipe },
- { "all", "Test all scheduler benchmarks", NULL },
+ { "all", "Run all scheduler benchmarks", NULL },
{ NULL, NULL, NULL }
};
static struct bench mem_benchmarks[] = {
{ "memcpy", "Benchmark for memcpy() functions", bench_mem_memcpy },
{ "memset", "Benchmark for memset() functions", bench_mem_memset },
- { "all", "Test all memory access benchmarks", NULL },
+ { "all", "Run all memory access benchmarks", NULL },
{ NULL, NULL, NULL }
};
@@ -62,7 +62,7 @@ static struct bench futex_benchmarks[] = {
{ "requeue", "Benchmark for futex requeue calls", bench_futex_requeue },
/* pi-futexes */
{ "lock-pi", "Benchmark for futex lock_pi calls", bench_futex_lock_pi },
- { "all", "Test all futex benchmarks", NULL },
+ { "all", "Run all futex benchmarks", NULL },
{ NULL, NULL, NULL }
};
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Ingo Molnar <tipbot@zytor.com> |
|---|---|
| Date | 2015-10-20 09:50 +0200 |
| Subject | [tip:perf/core] perf bench: Run benchmarks, don't test them |
| Message-ID | <qlzQf-5Bb-53@gated-at.bofh.it> |
| In reply to | #1250425 |
Commit-ID: aa254af25c40d6d1cdc3f354db29eaf3e85a5ede
Gitweb: http://git.kernel.org/tip/aa254af25c40d6d1cdc3f354db29eaf3e85a5ede
Author: Ingo Molnar <mingo@kernel.org>
AuthorDate: Mon, 19 Oct 2015 10:04:30 +0200
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 19 Oct 2015 16:10:25 -0300
perf bench: Run benchmarks, don't test them
So right now we output this text:
memcpy: Benchmark for memcpy() functions
memset: Benchmark for memset() functions
all: Test all memory access benchmarks
But the right verb to use with benchmarks is to 'run' them, not 'test'
them.
So change this (and all similar texts) to:
memcpy: Benchmark for memcpy() functions
memset: Benchmark for memset() functions
all: Run all memory access benchmarks
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1445241870-24854-15-git-send-email-mingo@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-bench.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/perf/builtin-bench.c b/tools/perf/builtin-bench.c
index a8fc948..b17aed3 100644
--- a/tools/perf/builtin-bench.c
+++ b/tools/perf/builtin-bench.c
@@ -36,7 +36,7 @@ struct bench {
#ifdef HAVE_LIBNUMA_SUPPORT
static struct bench numa_benchmarks[] = {
{ "mem", "Benchmark for NUMA workloads", bench_numa },
- { "all", "Test all NUMA benchmarks", NULL },
+ { "all", "Run all NUMA benchmarks", NULL },
{ NULL, NULL, NULL }
};
#endif
@@ -44,14 +44,14 @@ static struct bench numa_benchmarks[] = {
static struct bench sched_benchmarks[] = {
{ "messaging", "Benchmark for scheduling and IPC", bench_sched_messaging },
{ "pipe", "Benchmark for pipe() between two processes", bench_sched_pipe },
- { "all", "Test all scheduler benchmarks", NULL },
+ { "all", "Run all scheduler benchmarks", NULL },
{ NULL, NULL, NULL }
};
static struct bench mem_benchmarks[] = {
{ "memcpy", "Benchmark for memcpy() functions", bench_mem_memcpy },
{ "memset", "Benchmark for memset() functions", bench_mem_memset },
- { "all", "Test all memory access benchmarks", NULL },
+ { "all", "Run all memory access benchmarks", NULL },
{ NULL, NULL, NULL }
};
@@ -62,7 +62,7 @@ static struct bench futex_benchmarks[] = {
{ "requeue", "Benchmark for futex requeue calls", bench_futex_requeue },
/* pi-futexes */
{ "lock-pi", "Benchmark for futex lock_pi calls", bench_futex_lock_pi },
- { "all", "Test all futex benchmarks", NULL },
+ { "all", "Run all futex benchmarks", NULL },
{ NULL, NULL, NULL }
};
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2015-10-19 10:10 +0200 |
| Subject | [PATCH 10/14] perf/bench/mem: Improve user visible strings |
| Message-ID | <qldG2-6ST-25@gated-at.bofh.it> |
| In reply to | #1250418 |
- 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'.
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
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 0cd9020b8601..34faeccdce34 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 1b585213ba5a..a8fc948c8ace 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 }
};
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Ingo Molnar <tipbot@zytor.com> |
|---|---|
| Date | 2015-10-20 09:50 +0200 |
| Subject | [tip:perf/core] perf bench mem: Improve user visible strings |
| Message-ID | <qlzQe-5Bb-25@gated-at.bofh.it> |
| In reply to | #1250426 |
Commit-ID: 13b1fdce8d46027f346c0533a4323b58e2b5bad8
Gitweb: http://git.kernel.org/tip/13b1fdce8d46027f346c0533a4323b58e2b5bad8
Author: Ingo Molnar <mingo@kernel.org>
AuthorDate: Mon, 19 Oct 2015 10:04:26 +0200
Committer: Arnaldo Carvalho de Melo <acme@redhat.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@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1445241870-24854-11-git-send-email-mingo@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2015-10-19 10:10 +0200 |
| Subject | [PATCH 11/14] perf/bench/mem: Reorganize the code a bit |
| Message-ID | <qldG2-6ST-29@gated-at.bofh.it> |
| In reply to | #1250418 |
Reorder functions a bit, so that we synchronize the layout of the
memcpy() and memset() portions of the code.
This improves the code, especially after we'll add an strlcpy()
variant as well.
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
tools/perf/bench/mem-functions.c | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/tools/perf/bench/mem-functions.c b/tools/perf/bench/mem-functions.c
index 34faeccdce34..f701b5b56079 100644
--- a/tools/perf/bench/mem-functions.c
+++ b/tools/perf/bench/mem-functions.c
@@ -58,25 +58,6 @@ struct routine {
} fn;
};
-struct routine memcpy_routines[] = {
- { .name = "default",
- .desc = "Default memcpy() provided by glibc",
- .fn.memcpy = memcpy },
-
-#ifdef HAVE_ARCH_X86_64_SUPPORT
-# define MEMCPY_FN(_fn, _name, _desc) {.name = _name, .desc = _desc, .fn.memcpy = _fn},
-# include "mem-memcpy-x86-64-asm-def.h"
-# undef MEMCPY_FN
-#endif
-
- { NULL, }
-};
-
-static const char * const bench_mem_memcpy_usage[] = {
- "perf bench mem memcpy <options>",
- NULL
-};
-
static struct perf_event_attr cycle_attr = {
.type = PERF_TYPE_HARDWARE,
.config = PERF_COUNT_HW_CPU_CYCLES
@@ -278,6 +259,25 @@ static double do_memcpy_gettimeofday(const struct routine *r, size_t size)
return (double)(((double)size * iterations) / timeval2double(&tv_diff));
}
+struct routine memcpy_routines[] = {
+ { .name = "default",
+ .desc = "Default memcpy() provided by glibc",
+ .fn.memcpy = memcpy },
+
+#ifdef HAVE_ARCH_X86_64_SUPPORT
+# define MEMCPY_FN(_fn, _name, _desc) {.name = _name, .desc = _desc, .fn.memcpy = _fn},
+# include "mem-memcpy-x86-64-asm-def.h"
+# undef MEMCPY_FN
+#endif
+
+ { NULL, }
+};
+
+static const char * const bench_mem_memcpy_usage[] = {
+ "perf bench mem memcpy <options>",
+ NULL
+};
+
int bench_mem_memcpy(int argc, const char **argv, const char *prefix __maybe_unused)
{
struct bench_mem_info info = {
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Ingo Molnar <tipbot@zytor.com> |
|---|---|
| Date | 2015-10-20 09:50 +0200 |
| Subject | [tip:perf/core] perf bench mem: Reorganize the code a bit |
| Message-ID | <qlzQf-5Bb-55@gated-at.bofh.it> |
| In reply to | #1250428 |
Commit-ID: 5dd93304a5d386c73c0a59117752acdca67f857d
Gitweb: http://git.kernel.org/tip/5dd93304a5d386c73c0a59117752acdca67f857d
Author: Ingo Molnar <mingo@kernel.org>
AuthorDate: Mon, 19 Oct 2015 10:04:27 +0200
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 19 Oct 2015 16:07:19 -0300
perf bench mem: Reorganize the code a bit
Reorder functions a bit, so that we synchronize the layout of the
memcpy() and memset() portions of the code.
This improves the code, especially after we'll add an strlcpy() variant
as well.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1445241870-24854-12-git-send-email-mingo@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/bench/mem-functions.c | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/tools/perf/bench/mem-functions.c b/tools/perf/bench/mem-functions.c
index 318da34..8d980d4 100644
--- a/tools/perf/bench/mem-functions.c
+++ b/tools/perf/bench/mem-functions.c
@@ -58,25 +58,6 @@ struct routine {
} fn;
};
-struct routine memcpy_routines[] = {
- { .name = "default",
- .desc = "Default memcpy() provided by glibc",
- .fn.memcpy = memcpy },
-
-#ifdef HAVE_ARCH_X86_64_SUPPORT
-# define MEMCPY_FN(_fn, _name, _desc) {.name = _name, .desc = _desc, .fn.memcpy = _fn},
-# include "mem-memcpy-x86-64-asm-def.h"
-# undef MEMCPY_FN
-#endif
-
- { NULL, }
-};
-
-static const char * const bench_mem_memcpy_usage[] = {
- "perf bench mem memcpy <options>",
- NULL
-};
-
static struct perf_event_attr cycle_attr = {
.type = PERF_TYPE_HARDWARE,
.config = PERF_COUNT_HW_CPU_CYCLES
@@ -278,6 +259,25 @@ static double do_memcpy_gettimeofday(const struct routine *r, size_t size)
return (double)(((double)size * iterations) / timeval2double(&tv_diff));
}
+struct routine memcpy_routines[] = {
+ { .name = "default",
+ .desc = "Default memcpy() provided by glibc",
+ .fn.memcpy = memcpy },
+
+#ifdef HAVE_ARCH_X86_64_SUPPORT
+# define MEMCPY_FN(_fn, _name, _desc) {.name = _name, .desc = _desc, .fn.memcpy = _fn},
+# include "mem-memcpy-x86-64-asm-def.h"
+# undef MEMCPY_FN
+#endif
+
+ { NULL, }
+};
+
+static const char * const bench_mem_memcpy_usage[] = {
+ "perf bench mem memcpy <options>",
+ NULL
+};
+
int bench_mem_memcpy(int argc, const char **argv, const char *prefix __maybe_unused)
{
struct bench_mem_info info = {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2015-10-19 10:10 +0200 |
| Subject | [PATCH 13/14] perf/bench/mem: Rename 'routine' to 'function' |
| Message-ID | <qldG2-6ST-31@gated-at.bofh.it> |
| In reply to | #1250418 |
So right now there's a somewhat inconsistent mess of the benchmarking
code and options sometimes calling benchmarked functions 'functions',
sometimes calling them 'routines'.
Name them 'functions' consistently.
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
tools/perf/bench/mem-functions.c | 60 ++++++++++++++++++++++++++++++------------------------------
1 file changed, 30 insertions(+), 30 deletions(-)
diff --git a/tools/perf/bench/mem-functions.c b/tools/perf/bench/mem-functions.c
index 65e7297de4b1..d8fc59092b39 100644
--- a/tools/perf/bench/mem-functions.c
+++ b/tools/perf/bench/mem-functions.c
@@ -24,7 +24,7 @@
#define K 1024
static const char *size_str = "1MB";
-static const char *routine_str = "all";
+static const char *function_str = "all";
static int nr_loops = 1;
static bool use_cycles;
static int cycles_fd;
@@ -34,8 +34,8 @@ static const struct option options[] = {
"Specify the size of the memory buffers. "
"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, \"help\" lists them"),
+ OPT_STRING('f', "function", &function_str, "all",
+ "Specify the function to run, \"all\" runs all available functions, \"help\" lists them"),
OPT_INTEGER('l', "nr_loops", &nr_loops,
"Specify the number of loops to run. (default: 1)"),
@@ -49,7 +49,7 @@ static const struct option options[] = {
typedef void *(*memcpy_t)(void *, const void *, size_t);
typedef void *(*memset_t)(void *, int, size_t);
-struct routine {
+struct function {
const char *name;
const char *desc;
union {
@@ -101,19 +101,19 @@ static double timeval2double(struct timeval *ts)
} while (0)
struct bench_mem_info {
- const struct routine *routines;
- u64 (*do_cycles)(const struct routine *r, size_t size);
- double (*do_gettimeofday)(const struct routine *r, size_t size);
+ const struct function *functions;
+ u64 (*do_cycles)(const struct function *r, size_t size);
+ double (*do_gettimeofday)(const struct function *r, size_t size);
const char *const *usage;
};
-static void __bench_mem_routine(struct bench_mem_info *info, int r_idx, size_t size, double size_total)
+static void __bench_mem_function(struct bench_mem_info *info, int r_idx, size_t size, double size_total)
{
- const struct routine *r = &info->routines[r_idx];
+ const struct function *r = &info->functions[r_idx];
double result_bps = 0.0;
u64 result_cycles = 0;
- printf("# Routine '%s' (%s)\n", r->name, r->desc);
+ printf("# function '%s' (%s)\n", r->name, r->desc);
if (bench_format == BENCH_FORMAT_DEFAULT)
printf("# Copying %s bytes ...\n\n", size_str);
@@ -166,28 +166,28 @@ static int bench_mem_common(int argc, const char **argv, struct bench_mem_info *
return 1;
}
- if (!strncmp(routine_str, "all", 3)) {
- for (i = 0; info->routines[i].name; i++)
- __bench_mem_routine(info, i, size, size_total);
+ if (!strncmp(function_str, "all", 3)) {
+ for (i = 0; info->functions[i].name; i++)
+ __bench_mem_function(info, i, size, size_total);
return 0;
}
- for (i = 0; info->routines[i].name; i++) {
- if (!strcmp(info->routines[i].name, routine_str))
+ for (i = 0; info->functions[i].name; i++) {
+ if (!strcmp(info->functions[i].name, function_str))
break;
}
- if (!info->routines[i].name) {
- 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++) {
+ if (!info->functions[i].name) {
+ if (strcmp(function_str, "help") && strcmp(function_str, "h"))
+ printf("Unknown function: %s\n", function_str);
+ printf("Available functions:\n");
+ for (i = 0; info->functions[i].name; i++) {
printf("\t%s ... %s\n",
- info->routines[i].name, info->routines[i].desc);
+ info->functions[i].name, info->functions[i].desc);
}
return 1;
}
- __bench_mem_routine(info, i, size, size_total);
+ __bench_mem_function(info, i, size, size_total);
return 0;
}
@@ -206,7 +206,7 @@ static void memcpy_alloc_mem(void **dst, void **src, size_t size)
memset(*src, 0, size);
}
-static u64 do_memcpy_cycles(const struct routine *r, size_t size)
+static u64 do_memcpy_cycles(const struct function *r, size_t size)
{
u64 cycle_start = 0ULL, cycle_end = 0ULL;
void *src = NULL, *dst = NULL;
@@ -231,7 +231,7 @@ static u64 do_memcpy_cycles(const struct routine *r, size_t size)
return cycle_end - cycle_start;
}
-static double do_memcpy_gettimeofday(const struct routine *r, size_t size)
+static double do_memcpy_gettimeofday(const struct function *r, size_t size)
{
struct timeval tv_start, tv_end, tv_diff;
memcpy_t fn = r->fn.memcpy;
@@ -259,7 +259,7 @@ static double do_memcpy_gettimeofday(const struct routine *r, size_t size)
return (double)(((double)size * nr_loops) / timeval2double(&tv_diff));
}
-struct routine memcpy_routines[] = {
+struct function memcpy_functions[] = {
{ .name = "default",
.desc = "Default memcpy() provided by glibc",
.fn.memcpy = memcpy },
@@ -281,7 +281,7 @@ static const char * const bench_mem_memcpy_usage[] = {
int bench_mem_memcpy(int argc, const char **argv, const char *prefix __maybe_unused)
{
struct bench_mem_info info = {
- .routines = memcpy_routines,
+ .functions = memcpy_functions,
.do_cycles = do_memcpy_cycles,
.do_gettimeofday = do_memcpy_gettimeofday,
.usage = bench_mem_memcpy_usage,
@@ -297,7 +297,7 @@ static void memset_alloc_mem(void **dst, size_t size)
die("memory allocation failed - maybe size is too large?\n");
}
-static u64 do_memset_cycles(const struct routine *r, size_t size)
+static u64 do_memset_cycles(const struct function *r, size_t size)
{
u64 cycle_start = 0ULL, cycle_end = 0ULL;
memset_t fn = r->fn.memset;
@@ -321,7 +321,7 @@ static u64 do_memset_cycles(const struct routine *r, size_t size)
return cycle_end - cycle_start;
}
-static double do_memset_gettimeofday(const struct routine *r, size_t size)
+static double do_memset_gettimeofday(const struct function *r, size_t size)
{
struct timeval tv_start, tv_end, tv_diff;
memset_t fn = r->fn.memset;
@@ -352,7 +352,7 @@ static const char * const bench_mem_memset_usage[] = {
NULL
};
-static const struct routine memset_routines[] = {
+static const struct function memset_functions[] = {
{ .name = "default",
.desc = "Default memset() provided by glibc",
.fn.memset = memset },
@@ -369,7 +369,7 @@ static const struct routine memset_routines[] = {
int bench_mem_memset(int argc, const char **argv, const char *prefix __maybe_unused)
{
struct bench_mem_info info = {
- .routines = memset_routines,
+ .functions = memset_functions,
.do_cycles = do_memset_cycles,
.do_gettimeofday = do_memset_gettimeofday,
.usage = bench_mem_memset_usage,
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Ingo Molnar <tipbot@zytor.com> |
|---|---|
| Date | 2015-10-20 09:50 +0200 |
| Subject | [tip:perf/core] perf bench mem: Rename 'routine' to 'function' |
| Message-ID | <qlzQe-5Bb-23@gated-at.bofh.it> |
| In reply to | #1250429 |
Commit-ID: 2f211c84ad40469c15226e899b720624fbd28e20
Gitweb: http://git.kernel.org/tip/2f211c84ad40469c15226e899b720624fbd28e20
Author: Ingo Molnar <mingo@kernel.org>
AuthorDate: Mon, 19 Oct 2015 10:04:29 +0200
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 19 Oct 2015 16:10:25 -0300
perf bench mem: Rename 'routine' to 'function'
So right now there's a somewhat inconsistent mess of the benchmarking
code and options sometimes calling benchmarked functions 'functions',
sometimes calling them 'routines'.
Name them 'functions' consistently.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1445241870-24854-14-git-send-email-mingo@kernel.org
[ Updated perf-bench man page, pointed out by David Ahern ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/Documentation/perf-bench.txt | 16 ++++-----
tools/perf/bench/mem-functions.c | 60 ++++++++++++++++-----------------
2 files changed, 38 insertions(+), 38 deletions(-)
diff --git a/tools/perf/Documentation/perf-bench.txt b/tools/perf/Documentation/perf-bench.txt
index ddfb3e1..34750fc 100644
--- a/tools/perf/Documentation/perf-bench.txt
+++ b/tools/perf/Documentation/perf-bench.txt
@@ -143,10 +143,10 @@ Options of *memcpy*
Specify size of memory to copy (default: 1MB).
Available units are B, KB, MB, GB and TB (case insensitive).
--r::
---routine::
-Specify routine to copy (default: default).
-Available routines are depend on the architecture.
+-f::
+--function::
+Specify function to copy (default: default).
+Available functions are depend on the architecture.
On x86-64, x86-64-unrolled, x86-64-movsq and x86-64-movsb are supported.
-l::
@@ -167,10 +167,10 @@ Options of *memset*
Specify size of memory to set (default: 1MB).
Available units are B, KB, MB, GB and TB (case insensitive).
--r::
---routine::
-Specify routine to set (default: default).
-Available routines are depend on the architecture.
+-f::
+--function::
+Specify function to set (default: default).
+Available functions are depend on the architecture.
On x86-64, x86-64-unrolled, x86-64-stosq and x86-64-stosb are supported.
-l::
diff --git a/tools/perf/bench/mem-functions.c b/tools/perf/bench/mem-functions.c
index c5dfabd..d1de9c4 100644
--- a/tools/perf/bench/mem-functions.c
+++ b/tools/perf/bench/mem-functions.c
@@ -24,7 +24,7 @@
#define K 1024
static const char *size_str = "1MB";
-static const char *routine_str = "all";
+static const char *function_str = "all";
static int nr_loops = 1;
static bool use_cycles;
static int cycles_fd;
@@ -34,8 +34,8 @@ static const struct option options[] = {
"Specify the size of the memory buffers. "
"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, \"help\" lists them"),
+ OPT_STRING('f', "function", &function_str, "all",
+ "Specify the function to run, \"all\" runs all available functions, \"help\" lists them"),
OPT_INTEGER('l', "nr_loops", &nr_loops,
"Specify the number of loops to run. (default: 1)"),
@@ -49,7 +49,7 @@ static const struct option options[] = {
typedef void *(*memcpy_t)(void *, const void *, size_t);
typedef void *(*memset_t)(void *, int, size_t);
-struct routine {
+struct function {
const char *name;
const char *desc;
union {
@@ -101,19 +101,19 @@ static double timeval2double(struct timeval *ts)
} while (0)
struct bench_mem_info {
- const struct routine *routines;
- u64 (*do_cycles)(const struct routine *r, size_t size);
- double (*do_gettimeofday)(const struct routine *r, size_t size);
+ const struct function *functions;
+ u64 (*do_cycles)(const struct function *r, size_t size);
+ double (*do_gettimeofday)(const struct function *r, size_t size);
const char *const *usage;
};
-static void __bench_mem_routine(struct bench_mem_info *info, int r_idx, size_t size, double size_total)
+static void __bench_mem_function(struct bench_mem_info *info, int r_idx, size_t size, double size_total)
{
- const struct routine *r = &info->routines[r_idx];
+ const struct function *r = &info->functions[r_idx];
double result_bps = 0.0;
u64 result_cycles = 0;
- printf("# Routine '%s' (%s)\n", r->name, r->desc);
+ printf("# function '%s' (%s)\n", r->name, r->desc);
if (bench_format == BENCH_FORMAT_DEFAULT)
printf("# Copying %s bytes ...\n\n", size_str);
@@ -166,28 +166,28 @@ static int bench_mem_common(int argc, const char **argv, struct bench_mem_info *
return 1;
}
- if (!strncmp(routine_str, "all", 3)) {
- for (i = 0; info->routines[i].name; i++)
- __bench_mem_routine(info, i, size, size_total);
+ if (!strncmp(function_str, "all", 3)) {
+ for (i = 0; info->functions[i].name; i++)
+ __bench_mem_function(info, i, size, size_total);
return 0;
}
- for (i = 0; info->routines[i].name; i++) {
- if (!strcmp(info->routines[i].name, routine_str))
+ for (i = 0; info->functions[i].name; i++) {
+ if (!strcmp(info->functions[i].name, function_str))
break;
}
- if (!info->routines[i].name) {
- 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++) {
+ if (!info->functions[i].name) {
+ if (strcmp(function_str, "help") && strcmp(function_str, "h"))
+ printf("Unknown function: %s\n", function_str);
+ printf("Available functions:\n");
+ for (i = 0; info->functions[i].name; i++) {
printf("\t%s ... %s\n",
- info->routines[i].name, info->routines[i].desc);
+ info->functions[i].name, info->functions[i].desc);
}
return 1;
}
- __bench_mem_routine(info, i, size, size_total);
+ __bench_mem_function(info, i, size, size_total);
return 0;
}
@@ -206,7 +206,7 @@ static void memcpy_alloc_mem(void **dst, void **src, size_t size)
memset(*src, 0, size);
}
-static u64 do_memcpy_cycles(const struct routine *r, size_t size)
+static u64 do_memcpy_cycles(const struct function *r, size_t size)
{
u64 cycle_start = 0ULL, cycle_end = 0ULL;
void *src = NULL, *dst = NULL;
@@ -231,7 +231,7 @@ static u64 do_memcpy_cycles(const struct routine *r, size_t size)
return cycle_end - cycle_start;
}
-static double do_memcpy_gettimeofday(const struct routine *r, size_t size)
+static double do_memcpy_gettimeofday(const struct function *r, size_t size)
{
struct timeval tv_start, tv_end, tv_diff;
memcpy_t fn = r->fn.memcpy;
@@ -259,7 +259,7 @@ static double do_memcpy_gettimeofday(const struct routine *r, size_t size)
return (double)(((double)size * nr_loops) / timeval2double(&tv_diff));
}
-struct routine memcpy_routines[] = {
+struct function memcpy_functions[] = {
{ .name = "default",
.desc = "Default memcpy() provided by glibc",
.fn.memcpy = memcpy },
@@ -281,7 +281,7 @@ static const char * const bench_mem_memcpy_usage[] = {
int bench_mem_memcpy(int argc, const char **argv, const char *prefix __maybe_unused)
{
struct bench_mem_info info = {
- .routines = memcpy_routines,
+ .functions = memcpy_functions,
.do_cycles = do_memcpy_cycles,
.do_gettimeofday = do_memcpy_gettimeofday,
.usage = bench_mem_memcpy_usage,
@@ -297,7 +297,7 @@ static void memset_alloc_mem(void **dst, size_t size)
die("memory allocation failed - maybe size is too large?\n");
}
-static u64 do_memset_cycles(const struct routine *r, size_t size)
+static u64 do_memset_cycles(const struct function *r, size_t size)
{
u64 cycle_start = 0ULL, cycle_end = 0ULL;
memset_t fn = r->fn.memset;
@@ -321,7 +321,7 @@ static u64 do_memset_cycles(const struct routine *r, size_t size)
return cycle_end - cycle_start;
}
-static double do_memset_gettimeofday(const struct routine *r, size_t size)
+static double do_memset_gettimeofday(const struct function *r, size_t size)
{
struct timeval tv_start, tv_end, tv_diff;
memset_t fn = r->fn.memset;
@@ -352,7 +352,7 @@ static const char * const bench_mem_memset_usage[] = {
NULL
};
-static const struct routine memset_routines[] = {
+static const struct function memset_functions[] = {
{ .name = "default",
.desc = "Default memset() provided by glibc",
.fn.memset = memset },
@@ -369,7 +369,7 @@ static const struct routine memset_routines[] = {
int bench_mem_memset(int argc, const char **argv, const char *prefix __maybe_unused)
{
struct bench_mem_info info = {
- .routines = memset_routines,
+ .functions = memset_functions,
.do_cycles = do_memset_cycles,
.do_gettimeofday = do_memset_gettimeofday,
.usage = bench_mem_memset_usage,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2015-10-19 10:10 +0200 |
| Subject | [PATCH 08/14] perf/bench/mem: Rename 'routine' to 'routine_str' |
| Message-ID | <qldG3-6ST-39@gated-at.bofh.it> |
| In reply to | #1250418 |
So bench/mem-functions.c has a 'routine' name for the routines
parameter string, but a 'length_str' name for the length parameter string.
We also have another entity named 'routine': 'struct routine'.
This is inconsistent and confusing: rename 'routine' to 'routine_str'.
Also fix typos in the --routine help text.
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
tools/perf/bench/mem-functions.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/perf/bench/mem-functions.c b/tools/perf/bench/mem-functions.c
index 150414de1497..fc2afd1bfb4e 100644
--- a/tools/perf/bench/mem-functions.c
+++ b/tools/perf/bench/mem-functions.c
@@ -24,7 +24,7 @@
#define K 1024
static const char *length_str = "1MB";
-static const char *routine = "all";
+static const char *routine_str = "all";
static int iterations = 1;
static bool use_cycles;
static int cycles_fd;
@@ -33,8 +33,8 @@ static const struct option options[] = {
OPT_STRING('l', "length", &length_str, "1MB",
"Specify length of memory to copy. "
"Available units: B, KB, MB, GB and TB (upper and lower)"),
- OPT_STRING('r', "routine", &routine, "all",
- "Specify routine to copy, \"all\" runs all available routines"),
+ OPT_STRING('r', "routine", &routine_str, "all",
+ "Specify the routine to run, \"all\" runs all available routines"),
OPT_INTEGER('i', "iterations", &iterations,
"repeat memcpy() invocation this number of times"),
OPT_BOOLEAN('c', "cycles", &use_cycles,
@@ -128,7 +128,7 @@ static void __bench_mem_routine(struct bench_mem_info *info, int r_idx, size_t l
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", length_str);
@@ -181,18 +181,18 @@ static int bench_mem_common(int argc, const char **argv, struct bench_mem_info *
return 1;
}
- if (!strncmp(routine, "all", 3)) {
+ if (!strncmp(routine_str, "all", 3)) {
for (i = 0; info->routines[i].name; i++)
__bench_mem_routine(info, i, len, totallen);
return 0;
}
for (i = 0; info->routines[i].name; i++) {
- if (!strcmp(info->routines[i].name, routine))
+ if (!strcmp(info->routines[i].name, routine_str))
break;
}
if (!info->routines[i].name) {
- printf("Unknown routine:%s\n", routine);
+ printf("Unknown routine: %s\n", routine_str);
printf("Available routines...\n");
for (i = 0; info->routines[i].name; i++) {
printf("\t%s ... %s\n",
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | David Ahern <dsahern@gmail.com> |
|---|---|
| Date | 2015-10-19 15:40 +0200 |
| Subject | Re: [PATCH 08/14] perf/bench/mem: Rename 'routine' to 'routine_str' |
| Message-ID | <qliPp-5PM-37@gated-at.bofh.it> |
| In reply to | #1250430 |
On 10/19/15 2:04 AM, Ingo Molnar wrote:
> @@ -128,7 +128,7 @@ static void __bench_mem_routine(struct bench_mem_info *info, int r_idx, size_t l
> 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", length_str);
Seems like 'R' is more appropriate here.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@redhat.com> |
|---|---|
| Date | 2015-10-19 21:00 +0200 |
| Subject | Re: [PATCH 08/14] perf/bench/mem: Rename 'routine' to 'routine_str' |
| Message-ID | <qlnP4-4FP-9@gated-at.bofh.it> |
| In reply to | #1250717 |
Em Mon, Oct 19, 2015 at 07:34:46AM -0600, David Ahern escreveu:
> On 10/19/15 2:04 AM, Ingo Molnar wrote:
> >@@ -128,7 +128,7 @@ static void __bench_mem_routine(struct bench_mem_info *info, int r_idx, size_t l
> > 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", length_str);
>
> Seems like 'R' is more appropriate here.
Right, changed it.
- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@redhat.com> |
|---|---|
| Date | 2015-10-19 21:00 +0200 |
| Subject | Re: [PATCH 08/14] perf/bench/mem: Rename 'routine' to 'routine_str' |
| Message-ID | <qlnP5-4FP-35@gated-at.bofh.it> |
| In reply to | #1251007 |
Em Mon, Oct 19, 2015 at 04:54:47PM -0200, Arnaldo Carvalho de Melo escreveu:
> Em Mon, Oct 19, 2015 at 07:34:46AM -0600, David Ahern escreveu:
> > On 10/19/15 2:04 AM, Ingo Molnar wrote:
> > >@@ -128,7 +128,7 @@ static void __bench_mem_routine(struct bench_mem_info *info, int r_idx, size_t l
> > > 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", length_str);
> >
> > Seems like 'R' is more appropriate here.
>
> Right, changed it.
And then, he does that on a later patch, duh.
- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2015-10-19 21:10 +0200 |
| Subject | Re: [PATCH 08/14] perf/bench/mem: Rename 'routine' to 'routine_str' |
| Message-ID | <qlnYK-56E-31@gated-at.bofh.it> |
| In reply to | #1251014 |
* Arnaldo Carvalho de Melo <acme@redhat.com> wrote:
> Em Mon, Oct 19, 2015 at 04:54:47PM -0200, Arnaldo Carvalho de Melo escreveu:
> > Em Mon, Oct 19, 2015 at 07:34:46AM -0600, David Ahern escreveu:
> > > On 10/19/15 2:04 AM, Ingo Molnar wrote:
> > > >@@ -128,7 +128,7 @@ static void __bench_mem_routine(struct bench_mem_info *info, int r_idx, size_t l
> > > > 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", length_str);
> > >
> > > Seems like 'R' is more appropriate here.
> >
> > Right, changed it.
>
> And then, he does that on a later patch, duh.
Yeah, indeed - I messed that up: tried to introduce __unused but noticed during
development and testing on other distros that '__unused' is way too crowded a
namespace (various fields in random headers are named like that), so after a bit
of a fight with those headers I changed it back to __maybe_unused ... but the
original change slipped into the series.
Do you want me to resend the series to fix this and the other problems David and
you noticed?
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
Page 1 of 3 [1] 2 3 Next page →
Back to top | Article view | linux.kernel
csiph-web