mirror of
https://github.com/torvalds/linux.git
synced 2026-11-23 23:11:40 +00:00
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@seventh ~]# 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@seventh ~]# Signed-off-by: Kan Liang <[email protected]> Acked-by: Jiri Olsa <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Jin Yao <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Wang Nan <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
committed by
Arnaldo Carvalho de Melo
parent
7bb4597295
commit
600a7cfe88
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user