Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1251118 > unrolled thread
| Started by | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| First post | 2015-10-19 23:50 +0200 |
| Last post | 2015-10-20 09:40 +0200 |
| Articles | 6 — 2 participants |
Back to article view | Back to linux.kernel
[GIT PULL 00/23] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-10-19 23:50 +0200
[PATCH 14/23] perf bench: Harmonize all the -l/--nr_loops options Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-10-19 23:50 +0200
[PATCH 08/23] perf bench: List output formatting options on 'perf bench -h' Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-10-19 23:50 +0200
[PATCH 01/23] perf test: Silence tracepoint event failures Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-10-19 23:50 +0200
[PATCH 12/23] perf bench mem: Improve user visible strings Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-10-19 23:50 +0200
Re: [GIT PULL 00/23] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2015-10-20 09:40 +0200
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2015-10-19 23:50 +0200 |
| Subject | [GIT PULL 00/23] perf/core improvements and fixes |
| Message-ID | <qlqtz-eC-7@gated-at.bofh.it> |
Hi Ingo,
Please consider pulling,
- Arnaldo
The following changes since commit e9363deeb286e916353f11b11d1f351c6ff54082:
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-10-14 15:06:33 +0200)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo
for you to fetch changes up to a4c6a3e8bbb675a601f529881c51ff226f83c3f1:
perf bench: Use named initializers in the trailer too (2015-10-19 18:17:25 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
User visible:
- 'perf bench mem' now prefaults unconditionally, no sense in
providing modes where page faults are measured (Ingo Molnar)
- Harmonize -l/--nr_loops accross 'perf bench' (Ingo Molnar)
- Various 'perf bench' consistency improvements (Ingo Molnar)
- Suppress libtraceevent warnings in non-verbose 'perf test' mode
(Namhyung Kim)
- Move some tracepoint event test error messages to the verbose mode
of 'perf test' (Namhyung Kim)
- Make 'perf help' usage message consistent with other tools (Yunlong Song)
Build fixes:
- Fix 'perf bench' build with gcc 4.4.7 (Arnaldo Carvalho de Melo)
Infrastructure:
- 'perf stat' prep work for the 'perf stat scripting' patchkit (Jiri Olsa)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Arnaldo Carvalho de Melo (1):
perf bench: Use named initializers in the trailer too
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
Jiri Olsa (5):
perf stat: Rename perf_stat struct into perf_stat_evsel
perf stat: Add AGGR_UNSET mode
perf cpu_map: Make cpu_map__build_map global
perf cpu_map: Add data arg to cpu_map__build_map callback
perf script: Check output fields only for samples
Namhyung Kim (2):
perf test: Silence tracepoint event failures
perf test: Suppress libtraceevent warnings
Yunlong Song (1):
perf help: Change 'usage' to 'Usage' for consistency
tools/perf/Documentation/perf-bench.txt | 54 ++--
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 +-
tools/perf/builtin-help.c | 2 +-
tools/perf/builtin-script.c | 5 +-
tools/perf/builtin-stat.c | 23 +-
tools/perf/tests/openat-syscall-all-cpus.c | 2 +-
tools/perf/tests/openat-syscall-tp-fields.c | 2 +-
tools/perf/tests/openat-syscall.c | 2 +-
tools/perf/tests/parse-events.c | 14 +
tools/perf/tests/topology.c | 4 +-
tools/perf/util/cpumap.c | 17 +-
tools/perf/util/cpumap.h | 7 +-
tools/perf/util/parse-options.c | 4 +-
tools/perf/util/stat.c | 13 +-
tools/perf/util/stat.h | 3 +-
tools/perf/util/usage.c | 5 +
tools/perf/util/util.h | 1 +
22 files changed, 487 insertions(+), 514 deletions(-)
create mode 100644 tools/perf/bench/mem-functions.c
delete mode 100644 tools/perf/bench/mem-memcpy.c
--
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 | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2015-10-19 23:50 +0200 |
| Subject | [PATCH 14/23] perf bench: Harmonize all the -l/--nr_loops options |
| Message-ID | <qlqtB-eC-53@gated-at.bofh.it> |
| In reply to | #1251118 |
From: Ingo Molnar <mingo@kernel.org>
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 bbd27d89b50a..ddfb3e10e88c 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 8d980d4a64e5..c5dfabdbd8d0 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.0
--
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@kernel.org> |
|---|---|
| Date | 2015-10-19 23:50 +0200 |
| Subject | [PATCH 08/23] perf bench: List output formatting options on 'perf bench -h' |
| Message-ID | <qlqtB-eC-55@gated-at.bofh.it> |
| In reply to | #1251118 |
From: Ingo Molnar <mingo@kernel.org>
So 'perf bench -h' is not very helpful when printing the help line
about the output formatting options:
-f, --format <default>
Specify format style
There are two output format styles, 'default' and 'simple', so improve
the help text to:
-f, --format <default|simple>
Specify the output formatting style
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-7-git-send-email-mingo@kernel.org
[ Removed leftovers from the mem-functions.c rename ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-bench.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/builtin-bench.c b/tools/perf/builtin-bench.c
index f67934d46d40..1b585213ba5a 100644
--- a/tools/perf/builtin-bench.c
+++ b/tools/perf/builtin-bench.c
@@ -110,7 +110,7 @@ int bench_format = BENCH_FORMAT_DEFAULT;
unsigned int bench_repeat = 10; /* default number of times to repeat the run */
static const struct option bench_options[] = {
- OPT_STRING('f', "format", &bench_format_str, "default", "Specify format style"),
+ OPT_STRING('f', "format", &bench_format_str, "default|simple", "Specify the output formatting style"),
OPT_UINTEGER('r', "repeat", &bench_repeat, "Specify amount of times to repeat the run"),
OPT_END()
};
--
2.1.0
--
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@kernel.org> |
|---|---|
| Date | 2015-10-19 23:50 +0200 |
| Subject | [PATCH 01/23] perf test: Silence tracepoint event failures |
| Message-ID | <qlqtB-eC-57@gated-at.bofh.it> |
| In reply to | #1251118 |
From: Namhyung Kim <namhyung@kernel.org>
Currently, when 'perf test' is run by a normal user, it'll fail to
access tracepoint events. The output becomes somewhat messy because it
tries to be nice with long error messages and hints.
IMHO this is not needed for 'perf test' by default and AFAIK 'perf test'
uses pr_debug() rather than pr_err() for such messages so that one can
use -v option to see further details on failed testcases if needed.
Before:
$ perf test
1: vmlinux symtab matches kallsyms : FAILED!
2: detect openat syscall event :Error:
No permissions to read
/sys/kernel/debug/tracing/events/syscalls/sys_enter_openat
Hint: Try 'sudo mount -o remount,mode=755 /sys/kernel/debug/tracing'
FAILED!
3: detect openat syscall event on all cpus :Error:
No permissions to read
/sys/kernel/debug/tracing/events/syscalls/sys_enter_openat
Hint: Try 'sudo mount -o remount,mode=755 /sys/kernel/debug/tracing'
FAILED!
...
After:
$ perf test
1: vmlinux symtab matches kallsyms : FAILED!
2: detect openat syscall event : FAILED!
3: detect openat syscall event on all cpus : FAILED!
...
$ perf test -v 2
2: detect openat syscall event :
--- start ---
test child forked, pid 30575
Error: No permissions to read
/sys/kernel/debug/tracing/events/syscalls/sys_enter_openat
Hint: Try 'sudo mount -o remount,mode=755 /sys/kernel/debug/tracing'
test child finished with -1
---- end ----
detect openat syscall event: FAILED!
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1445268229-1601-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/tests/openat-syscall-all-cpus.c | 2 +-
tools/perf/tests/openat-syscall-tp-fields.c | 2 +-
tools/perf/tests/openat-syscall.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/perf/tests/openat-syscall-all-cpus.c b/tools/perf/tests/openat-syscall-all-cpus.c
index 9e104a2e973d..2006485a2859 100644
--- a/tools/perf/tests/openat-syscall-all-cpus.c
+++ b/tools/perf/tests/openat-syscall-all-cpus.c
@@ -34,7 +34,7 @@ int test__openat_syscall_event_on_all_cpus(void)
evsel = perf_evsel__newtp("syscalls", "sys_enter_openat");
if (IS_ERR(evsel)) {
tracing_path__strerror_open_tp(errno, errbuf, sizeof(errbuf), "syscalls", "sys_enter_openat");
- pr_err("%s\n", errbuf);
+ pr_debug("%s\n", errbuf);
goto out_thread_map_delete;
}
diff --git a/tools/perf/tests/openat-syscall-tp-fields.c b/tools/perf/tests/openat-syscall-tp-fields.c
index 473d3869727e..5e811cd8f1c3 100644
--- a/tools/perf/tests/openat-syscall-tp-fields.c
+++ b/tools/perf/tests/openat-syscall-tp-fields.c
@@ -89,7 +89,7 @@ int test__syscall_openat_tp_fields(void)
err = perf_evsel__parse_sample(evsel, event, &sample);
if (err) {
- pr_err("Can't parse sample, err = %d\n", err);
+ pr_debug("Can't parse sample, err = %d\n", err);
goto out_delete_evlist;
}
diff --git a/tools/perf/tests/openat-syscall.c b/tools/perf/tests/openat-syscall.c
index 7b1db8306098..033b54797b8a 100644
--- a/tools/perf/tests/openat-syscall.c
+++ b/tools/perf/tests/openat-syscall.c
@@ -22,7 +22,7 @@ int test__openat_syscall_event(void)
evsel = perf_evsel__newtp("syscalls", "sys_enter_openat");
if (IS_ERR(evsel)) {
tracing_path__strerror_open_tp(errno, errbuf, sizeof(errbuf), "syscalls", "sys_enter_openat");
- pr_err("%s\n", errbuf);
+ pr_debug("%s\n", errbuf);
goto out_thread_map_delete;
}
--
2.1.0
--
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@kernel.org> |
|---|---|
| Date | 2015-10-19 23:50 +0200 |
| Subject | [PATCH 12/23] perf bench mem: Improve user visible strings |
| Message-ID | <qlqtB-eC-59@gated-at.bofh.it> |
| In reply to | #1251118 |
From: Ingo Molnar <mingo@kernel.org>
- 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 1605249d2912..318da3421e69 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.0
--
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-20 09:40 +0200 |
| Message-ID | <qlzGy-5pm-31@gated-at.bofh.it> |
| In reply to | #1251118 |
* Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > Hi Ingo, > > Please consider pulling, > > - Arnaldo > > The following changes since commit e9363deeb286e916353f11b11d1f351c6ff54082: > > Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core (2015-10-14 15:06:33 +0200) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo > > for you to fetch changes up to a4c6a3e8bbb675a601f529881c51ff226f83c3f1: > > perf bench: Use named initializers in the trailer too (2015-10-19 18:17:25 -0300) > > ---------------------------------------------------------------- > perf/core improvements and fixes: > > User visible: > > - 'perf bench mem' now prefaults unconditionally, no sense in > providing modes where page faults are measured (Ingo Molnar) > > - Harmonize -l/--nr_loops accross 'perf bench' (Ingo Molnar) > > - Various 'perf bench' consistency improvements (Ingo Molnar) > > - Suppress libtraceevent warnings in non-verbose 'perf test' mode > (Namhyung Kim) > > - Move some tracepoint event test error messages to the verbose mode > of 'perf test' (Namhyung Kim) > > - Make 'perf help' usage message consistent with other tools (Yunlong Song) > > Build fixes: > > - Fix 'perf bench' build with gcc 4.4.7 (Arnaldo Carvalho de Melo) > > Infrastructure: > > - 'perf stat' prep work for the 'perf stat scripting' patchkit (Jiri Olsa) > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> > > ---------------------------------------------------------------- > Arnaldo Carvalho de Melo (1): > perf bench: Use named initializers in the trailer too > > 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 > > Jiri Olsa (5): > perf stat: Rename perf_stat struct into perf_stat_evsel > perf stat: Add AGGR_UNSET mode > perf cpu_map: Make cpu_map__build_map global > perf cpu_map: Add data arg to cpu_map__build_map callback > perf script: Check output fields only for samples > > Namhyung Kim (2): > perf test: Silence tracepoint event failures > perf test: Suppress libtraceevent warnings > > Yunlong Song (1): > perf help: Change 'usage' to 'Usage' for consistency > > tools/perf/Documentation/perf-bench.txt | 54 ++-- > 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 +- > tools/perf/builtin-help.c | 2 +- > tools/perf/builtin-script.c | 5 +- > tools/perf/builtin-stat.c | 23 +- > tools/perf/tests/openat-syscall-all-cpus.c | 2 +- > tools/perf/tests/openat-syscall-tp-fields.c | 2 +- > tools/perf/tests/openat-syscall.c | 2 +- > tools/perf/tests/parse-events.c | 14 + > tools/perf/tests/topology.c | 4 +- > tools/perf/util/cpumap.c | 17 +- > tools/perf/util/cpumap.h | 7 +- > tools/perf/util/parse-options.c | 4 +- > tools/perf/util/stat.c | 13 +- > tools/perf/util/stat.h | 3 +- > tools/perf/util/usage.c | 5 + > tools/perf/util/util.h | 1 + > 22 files changed, 487 insertions(+), 514 deletions(-) > create mode 100644 tools/perf/bench/mem-functions.c > delete mode 100644 tools/perf/bench/mem-memcpy.c Pulled, thanks a lot Arnaldo! 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] | [standalone]
Back to top | Article view | linux.kernel
csiph-web