[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1513879734-237492-7-git-send-email-kan.liang@intel.com>
Date: Thu, 21 Dec 2017 10:08:48 -0800
From: kan.liang@...el.com
To: acme@...nel.org, peterz@...radead.org, mingo@...hat.com,
linux-kernel@...r.kernel.org
Cc: wangnan0@...wei.com, jolsa@...nel.org, namhyung@...nel.org,
ak@...ux.intel.com, yao.jin@...ux.intel.com,
Kan Liang <kan.liang@...el.com>
Subject: [PATCH V3 06/12] perf test: update mmap read functions for backward-ring-buffer test
From: Kan Liang <kan.liang@...el.com>
Use the new perf_mmap__read_* interfaces for overwrite ringbuffer test.
Signed-off-by: Kan Liang <kan.liang@...el.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;
}
--
2.5.5
Powered by blists - more mailing lists