All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Arnaldo Carvalho de Melo <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: namhyung@kernel.org, tglx@linutronix.de, mingo@kernel.org,
	steven@uplinklabs.net, hpa@zytor.com, wangnan0@huawei.com,
	adrian.hunter@intel.com, acme@redhat.com, jolsa@kernel.org,
	linux-kernel@vger.kernel.org
Subject: [tip:perf/core] perf tests: Use perf_evlist__strerror_open() to provide hints about max_freq
Date: Sat, 20 Feb 2016 03:34:58 -0800	[thread overview]
Message-ID: <tip-ifbx7vmrc38loe6317owz2jx@git.kernel.org> (raw)

Commit-ID:  6880bbf96930ec6f8b40b5b93f21973f3297672a
Gitweb:     http://git.kernel.org/tip/6880bbf96930ec6f8b40b5b93f21973f3297672a
Author:     Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Thu, 18 Feb 2016 13:40:57 -0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 19 Feb 2016 19:12:43 -0300

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>
---
 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 313a48c..f84339c 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;

                 reply	other threads:[~2016-02-20 11:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-ifbx7vmrc38loe6317owz2jx@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=steven@uplinklabs.net \
    --cc=tglx@linutronix.de \
    --cc=wangnan0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.