[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-600a7cfe88de2c6e44e23d61dd721b996b790eb2@git.kernel.org>
Date: Fri, 16 Feb 2018 01:38:15 -0800
From: tip-bot for Kan Liang <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: namhyung@...nel.org, mingo@...nel.org, acme@...hat.com,
ak@...ux.intel.com, hpa@...or.com, peterz@...radead.org,
jolsa@...nel.org, linux-kernel@...r.kernel.org, tglx@...utronix.de,
yao.jin@...ux.intel.com, kan.liang@...el.com, wangnan0@...wei.com
Subject: [tip:perf/urgent] perf test: Update mmap read functions for
backward-ring-buffer test
Commit-ID: 600a7cfe88de2c6e44e23d61dd721b996b790eb2
Gitweb: https://git.kernel.org/tip/600a7cfe88de2c6e44e23d61dd721b996b790eb2
Author: Kan Liang <kan.liang@...el.com>
AuthorDate: Thu, 18 Jan 2018 13:26:24 -0800
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Thu, 15 Feb 2018 09:54:08 -0300
perf test: Update mmap read functions for backward-ring-buffer test
Use the new perf_mmap__read_* interfaces for overwrite ringbuffer test.
Commiter notes:
Testing:
[root@...enth ~]# perf test -v backward
48: Read backward ring buffer :
--- start ---
test child forked, pid 8309
Using CPUID GenuineIntel-6-9E
mmap size 1052672B
mmap size 8192B
Finished reading overwrite ring buffer: rewind
test child finished with 0
---- end ----
Read backward ring buffer: Ok
[root@...enth ~]#
Signed-off-by: Kan Liang <kan.liang@...el.com>
Acked-by: Jiri Olsa <jolsa@...nel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Andi Kleen <ak@...ux.intel.com>
Cc: Jin Yao <yao.jin@...ux.intel.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Wang Nan <wangnan0@...wei.com>
Link: http://lkml.kernel.org/r/1516310792-208685-10-git-send-email-kan.liang@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/tests/backward-ring-buffer.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/perf/tests/backward-ring-buffer.c b/tools/perf/tests/backward-ring-buffer.c
index 4035d43..e0b1b41 100644
--- a/tools/perf/tests/backward-ring-buffer.c
+++ b/tools/perf/tests/backward-ring-buffer.c
@@ -31,10 +31,12 @@ static int count_samples(struct perf_evlist *evlist, int *sample_count,
int i;
for (i = 0; i < evlist->nr_mmaps; i++) {
+ struct perf_mmap *map = &evlist->overwrite_mmap[i];
union perf_event *event;
+ u64 start, end;
- perf_mmap__read_catchup(&evlist->overwrite_mmap[i]);
- while ((event = perf_mmap__read_backward(&evlist->overwrite_mmap[i])) != NULL) {
+ perf_mmap__read_init(map, true, &start, &end);
+ while ((event = perf_mmap__read_event(map, true, &start, end)) != NULL) {
const u32 type = event->header.type;
switch (type) {
@@ -49,6 +51,7 @@ static int count_samples(struct perf_evlist *evlist, int *sample_count,
return TEST_FAIL;
}
}
+ perf_mmap__read_done(map);
}
return TEST_OK;
}
Powered by blists - more mailing lists