mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-10 17:36:11 +00:00
overlay: Fix wraparound handling of perf ringbuffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
cc45a9a3db
commit
3e430a8b01
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user