diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-02-18 11:40:57 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-02-19 17:12:43 -0500 |
commit | 6880bbf96930ec6f8b40b5b93f21973f3297672a (patch) | |
tree | 75ef5c56f62c1e1c9944dabfdf3fc24011dc9bb4 /tools/perf/tests/code-reading.c | |
parent | d9aade7fd27a604bbffd363e6a68416ef51bab88 (diff) |
perf tests: Use perf_evlist__strerror_open() to provide hints about max_freq
Before:
# perf test -v "code reading" 2>&1 | tail -4
perf_evlist__open failed
test child finished with -1
---- end ----
Test object code reading: FAILED!
#
After:
# perf test -v "code reading" 2>&1 | tail -7
perf_evlist__open() failed!
Error: Invalid argument.
Hint: Check /proc/sys/kernel/perf_event_max_sample_rate.
Hint: The current value is 1000 and 4000 is being requested.
test child finished with -1
---- end ----
Test object code reading: FAILED!
#
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Steven Noonan <steven@uplinklabs.net>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-ifbx7vmrc38loe6317owz2jx@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests/code-reading.c')
-rw-r--r-- | tools/perf/tests/code-reading.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c index 313a48c6b2bc..f84339cb7f95 100644 --- a/tools/perf/tests/code-reading.c +++ b/tools/perf/tests/code-reading.c | |||
@@ -559,7 +559,13 @@ static int do_test_code_reading(bool try_kcore) | |||
559 | evlist = NULL; | 559 | evlist = NULL; |
560 | continue; | 560 | continue; |
561 | } | 561 | } |
562 | pr_debug("perf_evlist__open failed\n"); | 562 | |
563 | if (verbose) { | ||
564 | char errbuf[512]; | ||
565 | perf_evlist__strerror_open(evlist, errno, errbuf, sizeof(errbuf)); | ||
566 | pr_debug("perf_evlist__open() failed!\n%s\n", errbuf); | ||
567 | } | ||
568 | |||
563 | goto out_put; | 569 | goto out_put; |
564 | } | 570 | } |
565 | break; | 571 | break; |