mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wang Nan <wangnan0@huawei.com>
To: <acme@kernel.org>, <jolsa@redhat.com>
Cc: <linux-kernel@vger.kernel.org>, <pi3orama@163.com>,
	<lizefan@huawei.com>, Arnaldo Carvalho de Melo <acme@redhat.com>,
	Wang Nan <wangnan0@huawei.com>
Subject: [PATCH v12 1/8] perf tests: Skip backward ring buffer on old kernel
Date: Fri, 1 Jul 2016 02:23:44 +0000	[thread overview]
Message-ID: <1467339831-171169-2-git-send-email-wangnan0@huawei.com> (raw)
In-Reply-To: <1467339831-171169-1-git-send-email-wangnan0@huawei.com>

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

'perf test backward' FAILED on old kernel:

 [root@jouet ~]# perf test -v backward
 45: Test backward reading from ring buffer                   :
 --- start ---
 <SNIP>
 mmap size 1052672B
 Unexpected counter: sample_count=0, comm_count=0
 ---- end ----
 Test backward reading from ring buffer: FAILED!
 [root@jouet ~]#

Reason: when kernel doesn't support 'attr.backward', perf_evsel__open() will
trim this bit and try again, unless evsel->overwrite is true.

Set evsel->overwrite in this test.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/tests/backward-ring-buffer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/tests/backward-ring-buffer.c b/tools/perf/tests/backward-ring-buffer.c
index e70313f..0731b0b 100644
--- a/tools/perf/tests/backward-ring-buffer.c
+++ b/tools/perf/tests/backward-ring-buffer.c
@@ -118,8 +118,10 @@ int test__backward_ring_buffer(int subtest __maybe_unused)
 	perf_evlist__config(evlist, &opts, NULL);
 
 	/* Set backward bit, ring buffer should be writing from end */
-	evlist__for_each_entry(evlist, evsel)
+	evlist__for_each_entry(evlist, evsel) {
+		evsel->overwrite = true;
 		evsel->attr.write_backward = 1;
+	}
 
 	err = perf_evlist__open(evlist);
 	if (err < 0) {
-- 
1.8.3.4

  reply	other threads:[~2016-07-01  2:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-01  2:23 [PATCH v12 0/8] perf tools: Support overwritable ring buffer Wang Nan
2016-07-01  2:23 ` Wang Nan [this message]
2016-07-01 13:40   ` [PATCH v12 1/8] perf tests: Skip backward ring buffer on old kernel Arnaldo Carvalho de Melo
2016-07-01 14:27     ` pi3orama
2016-07-01 14:43       ` Arnaldo Carvalho de Melo
2016-07-01  2:23 ` [PATCH v12 2/8] perf evlist: Introduce aux evlist Wang Nan
2016-07-01  2:23 ` [PATCH v12 3/8] perf tests: Add testcase for auxiliary evlist Wang Nan
2016-07-01  2:23 ` [PATCH v12 4/8] perf record: Introduce rec->overwrite_evlist for overwritable events Wang Nan
2016-07-01  2:23 ` [PATCH v12 5/8] perf record: Read from overwritable ring buffer Wang Nan
2016-07-01  2:23 ` [PATCH v12 6/8] perf tools: Enable overwrite settings Wang Nan
2016-07-01  2:23 ` [PATCH v12 7/8] perf tools: Don't warn about out of order event if write_backward is used Wang Nan
2016-07-01  2:23 ` [PATCH v12 8/8] perf tools: Add --tail-synthesize option Wang Nan

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=1467339831-171169-2-git-send-email-wangnan0@huawei.com \
    --to=wangnan0@huawei.com \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=pi3orama@163.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®