From 3e430a8b01ae13bac878863663bd3e2efd995c6d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 17 Aug 2013 18:09:40 +0100 Subject: overlay: Fix wraparound handling of perf ringbuffer Signed-off-by: Chris Wilson --- overlay/gpu-perf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'overlay/gpu-perf.c') diff --git a/overlay/gpu-perf.c b/overlay/gpu-perf.c index d2f09f55..77511323 100644 --- a/overlay/gpu-perf.c +++ b/overlay/gpu-perf.c @@ -226,7 +226,7 @@ int gpu_perf_update(struct gpu_perf *gp) rmb(); if (head < tail) - tail = head; /* XXX */ + head += size; data = (uint8_t *)mmap + gp->page_size; while (head - tail >= sizeof (struct perf_event_header)) { @@ -262,7 +262,7 @@ int gpu_perf_update(struct gpu_perf *gp) tail += header->size; } - mmap->data_tail = tail; + mmap->data_tail = tail & mask; } free(buffer); -- cgit v1.2.3