linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	David Ahern <dsahern@gmail.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Jiri Olsa <jolsa@redhat.com>, Mike Galbraith <efault@gmx.de>,
	Namhyung Kim <namhyung@kernel.org>,
	Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Stephane Eranian <eranian@google.com>
Subject: [PATCH 10/10] perf tests: Use lower sample_freq in sw clock event period test
Date: Mon, 11 Nov 2013 17:22:33 -0300	[thread overview]
Message-ID: <1384201353-23863-11-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1384201353-23863-1-git-send-email-acme@infradead.org>

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

We were using it at 10 kHz, which doesn't work in machines where somehow
the max freq was auto reduced by the kernel:

[root@ssdandy ~]# perf test 19
19: Test software clock events have valid period values    : FAILED!
[root@ssdandy ~]# perf test -v 19
19: Test software clock events have valid period values    :
--- start ---
Couldn't open evlist: Invalid argument
---- end ----
Test software clock events have valid period values: FAILED!
[root@ssdandy ~]#

[root@ssdandy ~]# cat /proc/sys/kernel/perf_event_max_sample_rate
7000

Reducing it to 500 Hz should be good enough for this test and also
shouldn't affect what it is testing.

But warn the user if it fails, informing the knob and the freq tried.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-548rhj1uo6xbwnxa95kw3hqe@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/tests/sw-clock.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/perf/tests/sw-clock.c b/tools/perf/tests/sw-clock.c
index ed777728dfe7..93a7139ff5f7 100644
--- a/tools/perf/tests/sw-clock.c
+++ b/tools/perf/tests/sw-clock.c
@@ -34,7 +34,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
 		.freq = 1,
 	};
 
-	attr.sample_freq = 10000;
+	attr.sample_freq = 500;
 
 	evlist = perf_evlist__new();
 	if (evlist == NULL) {
@@ -58,8 +58,11 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
 	}
 
 	if (perf_evlist__open(evlist)) {
+		const char *knob = "/proc/sys/kernel/perf_event_max_sample_rate";
+
 		err = -errno;
-		pr_debug("Couldn't open evlist: %s\n", strerror(errno));
+		pr_debug("Couldn't open evlist: %s\nHint: check %s, using %" PRIu64 " in this test.\n",
+			 strerror(errno), knob, (u64)attr.sample_freq);
 		goto out_delete_maps;
 	}
 
-- 
1.8.1.4


  parent reply	other threads:[~2013-11-11 20:23 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-11 20:22 [GIT PULL 00/10] perf/core improvements and fixes Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 01/10] perf ui tui progress: Don't force a refresh during progress update Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 02/10] perf evsel: Remove idx parm from constructor Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 03/10] perf record: Synthesize non-exec MMAP records when --data used Arnaldo Carvalho de Melo
2013-11-11 20:38   ` David Ahern
2013-11-11 21:02     ` Vince Weaver
2013-11-11 20:22 ` [PATCH 04/10] perf machine: Introduce synthesize_threads method out of open coded equivalent Arnaldo Carvalho de Melo
2013-11-11 20:40   ` David Ahern
2013-11-11 20:50     ` Ingo Molnar
2013-11-12 11:34       ` Arnaldo Carvalho de Melo
2013-11-12 12:44         ` Ingo Molnar
2013-11-12 21:57         ` [tip:perf/urgent] perf target: Shorten perf_target__ to target__ tip-bot for Arnaldo Carvalho de Melo
2014-01-12 18:33         ` [tip:perf/core] perf tools: Rename 'perf_record_opts' to ' record_opts tip-bot for Arnaldo Carvalho de Melo
2014-01-12 18:35         ` [tip:perf/core] perf report: Rename 'perf_report' to 'report' tip-bot for Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 05/10] perf machine: Simplify synthesize_threads method Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 06/10] perf tools: Prevent condition that all sort keys are elided Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 07/10] perf record: Use correct return type for write() Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 08/10] perf record: Move existing write_output into helper function Arnaldo Carvalho de Melo
2013-11-11 20:22 ` [PATCH 09/10] perf tests: Check return of perf_evlist__open sw clock event period test Arnaldo Carvalho de Melo
2013-11-11 20:22 ` Arnaldo Carvalho de Melo [this message]
2013-11-11 20:45   ` [PATCH 10/10] perf tests: Use lower sample_freq in " David Ahern
2013-11-12  7:07   ` Adrian Hunter
2013-11-12  8:40     ` Namhyung Kim
2013-11-12 11:59       ` Arnaldo Carvalho de Melo
2013-11-12 14:41     ` Arnaldo Carvalho de Melo
2013-11-15  6:03       ` Namhyung Kim
2013-11-12 21:56     ` [tip:perf/urgent] perf tests: Compensate lower sample freq with longer test loop tip-bot for Adrian Hunter

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=1384201353-23863-11-git-send-email-acme@infradead.org \
    --to=acme@infradead.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=dsahern@gmail.com \
    --cc=efault@gmx.de \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).