Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1338560

[PATCH 04/22] perf tests: Use perf_evlist__strerror_open() to provide hints about max_freq

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 04/22] perf tests: Use perf_evlist__strerror_open() to provide hints about max_freq
Date 2016-02-19 23:50 +0100
Message-ID <r4227-3Wq-37@gated-at.bofh.it> (permalink)
References <r4226-3Wq-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Arnaldo Carvalho de Melo <acme@redhat.com>

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>
---
 tools/perf/tests/code-reading.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

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)
 				evlist = NULL;
 				continue;
 			}
-			pr_debug("perf_evlist__open failed\n");
+
+			if (verbose) {
+				char errbuf[512];
+				perf_evlist__strerror_open(evlist, errno, errbuf, sizeof(errbuf));
+				pr_debug("perf_evlist__open() failed!\n%s\n", errbuf);
+			}
+
 			goto out_put;
 		}
 		break;
-- 
2.5.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[GIT PULL 00/22] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-19 23:50 +0100
  [PATCH 09/22] perf tools: Create config_term_names array Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-19 23:50 +0100
  [PATCH 11/22] perf tools: Rename and move pmu_event_name to get_config_name Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-19 23:50 +0100
  [PATCH 18/22] perf callchain: Add enum match_result for match_chain() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-19 23:50 +0100
  [PATCH 03/22] perf evlist: Handle -EINVAL for sample_freq > max_sample_rate in strerror_open() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-19 23:50 +0100
  [PATCH 16/22] perf callchain: Check return value of add_child() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-19 23:50 +0100
  [PATCH 05/22] perf test: Reduce the sample_freq for the 'object code reading' test Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-19 23:50 +0100
  [PATCH 13/22] perf tools: Enable config raw and numeric events Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-19 23:50 +0100
  [PATCH 17/22] perf callchain: Check return value of fill_node() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-19 23:50 +0100
  [PATCH 12/22] perf tools: Introduce opt_event_config nonterminal Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-19 23:50 +0100
  [PATCH 01/22] perf evlist: Reference count the cpu and thread maps at set_maps() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-19 23:50 +0100
  [PATCH 04/22] perf tests: Use perf_evlist__strerror_open() to provide hints about max_freq Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-19 23:50 +0100
  [PATCH 21/22] perf hists: Return error from hists__collapse_resort() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-19 23:50 +0100
  [PATCH 19/22] perf callchain: Check return value of split_add_child() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-19 23:50 +0100
  [PATCH 06/22] perf stat: Handled scaled == -1 case for counters Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-19 23:50 +0100
  [PATCH 02/22] perf record: Add --all-user/--all-kernel options Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-19 23:50 +0100
  [PATCH 22/22] perf report: Check error during report__collapse_hists() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-19 23:50 +0100
  [PATCH 08/22] perf tools: Fix checking asprintf return value Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-19 23:50 +0100
  [PATCH 07/22] perf bpf: Rename bpf_prog_priv__clear() to clear_prog_priv() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-19 23:50 +0100
  [PATCH 20/22] perf callchain: Check return value of append_chain_children() Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-19 23:50 +0100
  [PATCH 15/22] perf hists browser: Fix percentage update on key press Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-19 23:50 +0100
  [PATCH 14/22] perf tools: Enable config and setting names for legacy cache events Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-19 23:50 +0100
  Re: [GIT PULL 00/22] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2016-02-20 12:00 +0100

csiph-web