Lines Matching refs:head
396 u64 head = PERF_IDX2OFF(handle->head, buf);
398 memset(buf->base + head, ARM_SPE_BUF_PAD_BYTE, len);
407 u64 head = PERF_IDX2OFF(handle->head, buf);
416 if (head < limit >> 1)
421 * pad, move the head index and recompute the limit.
423 if (limit - head < spe_pmu->max_record_sz) {
424 arm_spe_pmu_pad_buf(handle, limit - head);
425 handle->head = PERF_IDX2OFF(limit, buf);
426 limit = ((buf->nr_pages * PAGE_SIZE) >> 1) + handle->head;
438 u64 head, tail, wakeup;
441 * The head can be misaligned for two reasons:
451 * moving the head index. If we run out of buffer space, we'll
454 head = PERF_IDX2OFF(handle->head, buf);
455 if (!IS_ALIGNED(head, spe_pmu->align)) {
456 unsigned long delta = roundup(head, spe_pmu->align) - head;
460 head = PERF_IDX2OFF(handle->head, buf);
467 /* Compute the tail and wakeup indices now that we've aligned head */
468 tail = PERF_IDX2OFF(handle->head + handle->size, buf);
473 * if we see head == tail we know that the buffer is empty. If
474 * head > tail, then there's nothing to clobber prior to
477 if (head < tail)
489 if (handle->wakeup < (handle->head + handle->size) && head <= wakeup)
492 if (limit > head)
507 u64 head = PERF_IDX2OFF(handle->head, buf);
510 * If the head has come too close to the end of the buffer,
513 if (limit && (limit - head < spe_pmu->max_record_sz)) {
514 arm_spe_pmu_pad_buf(handle, limit - head);
545 base = (u64)buf->base + PERF_IDX2OFF(handle->head, buf);
558 size = offset - PERF_IDX2OFF(handle->head, buf);
561 handle->head = offset;