linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: David Ahern <dsahern@gmail.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Jiri Olsa <jolsa@redhat.com>, Mike Galbraith <efault@gmx.de>,
	Paul Mackerras <paulus@samba.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Stephane Eranian <eranian@google.com>,
	linux-kernel@vger.kernel.org
Subject: Re: "Test object code reading" failing, debug messages don't help
Date: Tue, 12 Nov 2013 09:59:33 +0200	[thread overview]
Message-ID: <5281DFE5.3000909@intel.com> (raw)
In-Reply-To: <20131111195810.GK27198@ghostprotocols.net>

On 11/11/13 21:58, Arnaldo Carvalho de Melo wrote:
> Em Mon, Nov 11, 2013 at 04:55:59PM -0300, Arnaldo Carvalho de Melo escreveu:
>> Em Mon, Nov 11, 2013 at 04:51:17PM -0300, Arnaldo Carvalho de Melo escreveu:
>>> Hi Adrian,
>>>
>>> 	I have perf test failing here:
>>>
>>> [root@ssdandy ~]# perf test 21
>>> 21: Test object code reading                               : FAILED!
>>> [root@ssdandy ~]# 
>>>
>>> Try it with -v, but all messages, except for that elf header, which I
>>> assume is for a previous entry that is not suitable and should not be
>>> considered, seems to say all is well, except that the test fails :-\
>>
>> If I try gdb on test__code_reading, go on stepping thru it to try to
>> figure out why it fails, it works :-\
> 
> Why this is so is still unclear, but since the other problem I had was
> due to the kernel reducing the max sample_freq, I tried:
> 
> [root@ssdandy ~]# echo 10000 > /proc/sys/kernel/perf_event_max_sample_rate 
> [root@ssdandy ~]# perf test 21
> 21: Test object code reading                               : Ok
> [root@ssdandy ~]# echo 7000 > /proc/sys/kernel/perf_event_max_sample_rate 
> [root@ssdandy ~]# perf test 21
> 21: Test object code reading                               : FAILED!
> [root@ssdandy ~]# 


From: Adrian Hunter <adrian.hunter@intel.com>
Subject: [PATCH] perf tests: Handle throttle events in 'object code reading' test

Unhandled events cause an error that fails the test

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 tools/perf/tests/code-reading.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index 6d9dc19..85d4919 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -275,8 +275,19 @@ static int process_event(struct machine *machine, struct perf_evlist *evlist,
 	if (event->header.type == PERF_RECORD_SAMPLE)
 		return process_sample_event(machine, evlist, event, state);
 
-	if (event->header.type < PERF_RECORD_MAX)
-		return machine__process_event(machine, event, NULL);
+	if (event->header.type == PERF_RECORD_THROTTLE ||
+	    event->header.type == PERF_RECORD_UNTHROTTLE)
+		return 0;
+
+	if (event->header.type < PERF_RECORD_MAX) {
+		int ret;
+
+		ret = machine__process_event(machine, event, NULL);
+		if (ret < 0)
+			pr_debug("machine__process_event failed, event type %u\n",
+				 event->header.type);
+		return ret;
+	}
 
 	return 0;
 }
-- 
1.7.11.7



  reply	other threads:[~2013-11-12  7:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-11 19:51 "Test object code reading" failing, debug messages don't help Arnaldo Carvalho de Melo
2013-11-11 19:55 ` Arnaldo Carvalho de Melo
2013-11-11 19:58   ` Arnaldo Carvalho de Melo
2013-11-12  7:59     ` Adrian Hunter [this message]
2013-11-12 21:57       ` [tip:perf/urgent] perf tests: Handle throttle events in ' object code reading' test 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=5281DFE5.3000909@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=acme@ghostprotocols.net \
    --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=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).