Lines Matching refs:handle

20 static void perf_output_wakeup(struct perf_output_handle *handle)  in perf_output_wakeup()  argument
22 atomic_set(&handle->rb->poll, EPOLLIN); in perf_output_wakeup()
24 handle->event->pending_wakeup = 1; in perf_output_wakeup()
25 irq_work_queue(&handle->event->pending); in perf_output_wakeup()
36 static void perf_output_get_handle(struct perf_output_handle *handle) in perf_output_get_handle() argument
38 struct perf_buffer *rb = handle->rb; in perf_output_get_handle()
47 handle->wakeup = local_read(&rb->wakeup); in perf_output_get_handle()
50 static void perf_output_put_handle(struct perf_output_handle *handle) in perf_output_put_handle() argument
52 struct perf_buffer *rb = handle->rb; in perf_output_put_handle()
130 if (handle->wakeup != local_read(&rb->wakeup)) in perf_output_put_handle()
131 perf_output_wakeup(handle); in perf_output_put_handle()
149 __perf_output_begin(struct perf_output_handle *handle, in __perf_output_begin() argument
180 handle->rb = rb; in __perf_output_begin()
181 handle->event = event; in __perf_output_begin()
190 perf_output_get_handle(handle); in __perf_output_begin()
235 handle->page = (offset >> page_shift) & (rb->nr_pages - 1); in __perf_output_begin()
237 handle->addr = rb->data_pages[handle->page] + offset; in __perf_output_begin()
238 handle->size = (1UL << page_shift) - offset; in __perf_output_begin()
249 perf_output_put(handle, lost_event); in __perf_output_begin()
250 perf_event__output_id_sample(event, handle, data); in __perf_output_begin()
257 perf_output_put_handle(handle); in __perf_output_begin()
264 int perf_output_begin_forward(struct perf_output_handle *handle, in perf_output_begin_forward() argument
268 return __perf_output_begin(handle, data, event, size, false); in perf_output_begin_forward()
271 int perf_output_begin_backward(struct perf_output_handle *handle, in perf_output_begin_backward() argument
275 return __perf_output_begin(handle, data, event, size, true); in perf_output_begin_backward()
278 int perf_output_begin(struct perf_output_handle *handle, in perf_output_begin() argument
283 return __perf_output_begin(handle, data, event, size, in perf_output_begin()
287 unsigned int perf_output_copy(struct perf_output_handle *handle, in perf_output_copy() argument
290 return __output_copy(handle, buf, len); in perf_output_copy()
293 unsigned int perf_output_skip(struct perf_output_handle *handle, in perf_output_skip() argument
296 return __output_skip(handle, NULL, len); in perf_output_skip()
299 void perf_output_end(struct perf_output_handle *handle) in perf_output_end() argument
301 perf_output_put_handle(handle); in perf_output_end()
334 void perf_aux_output_flag(struct perf_output_handle *handle, u64 flags) in perf_aux_output_flag() argument
343 handle->aux_flags |= flags; in perf_aux_output_flag()
361 void *perf_aux_output_begin(struct perf_output_handle *handle, in perf_aux_output_begin() argument
410 handle->rb = rb; in perf_aux_output_begin()
411 handle->event = event; in perf_aux_output_begin()
412 handle->head = aux_head; in perf_aux_output_begin()
413 handle->size = 0; in perf_aux_output_begin()
414 handle->aux_flags = 0; in perf_aux_output_begin()
423 handle->wakeup = rb->aux_wakeup + rb->aux_watermark; in perf_aux_output_begin()
425 handle->size = CIRC_SPACE(aux_head, aux_tail, perf_aux_size(rb)); in perf_aux_output_begin()
432 if (!handle->size) { /* A, matches D */ in perf_aux_output_begin()
434 perf_output_wakeup(handle); in perf_aux_output_begin()
440 return handle->rb->aux_priv; in perf_aux_output_begin()
448 handle->event = NULL; in perf_aux_output_begin()
477 void perf_aux_output_end(struct perf_output_handle *handle, unsigned long size) in perf_aux_output_end() argument
479 bool wakeup = !!(handle->aux_flags & PERF_AUX_FLAG_TRUNCATED); in perf_aux_output_end()
480 struct perf_buffer *rb = handle->rb; in perf_aux_output_end()
485 handle->aux_flags |= PERF_AUX_FLAG_OVERWRITE; in perf_aux_output_end()
487 aux_head = handle->head; in perf_aux_output_end()
490 handle->aux_flags &= ~PERF_AUX_FLAG_OVERWRITE; in perf_aux_output_end()
508 if (size || (handle->aux_flags & ~(u64)PERF_AUX_FLAG_OVERWRITE)) in perf_aux_output_end()
509 perf_event_aux_event(handle->event, aux_head, size, in perf_aux_output_end()
510 handle->aux_flags); in perf_aux_output_end()
517 if (handle->aux_flags & PERF_AUX_FLAG_TRUNCATED) in perf_aux_output_end()
518 handle->event->pending_disable = smp_processor_id(); in perf_aux_output_end()
519 perf_output_wakeup(handle); in perf_aux_output_end()
522 handle->event = NULL; in perf_aux_output_end()
535 int perf_aux_output_skip(struct perf_output_handle *handle, unsigned long size) in perf_aux_output_skip() argument
537 struct perf_buffer *rb = handle->rb; in perf_aux_output_skip()
539 if (size > handle->size) in perf_aux_output_skip()
546 perf_output_wakeup(handle); in perf_aux_output_skip()
547 handle->wakeup = rb->aux_wakeup + rb->aux_watermark; in perf_aux_output_skip()
550 handle->head = rb->aux_head; in perf_aux_output_skip()
551 handle->size -= size; in perf_aux_output_skip()
557 void *perf_get_aux(struct perf_output_handle *handle) in perf_get_aux() argument
560 if (!handle->event) in perf_get_aux()
563 return handle->rb->aux_priv; in perf_get_aux()
571 struct perf_output_handle *handle, in perf_output_copy_aux() argument
591 remainder = perf_output_copy(handle, addr, tocopy); in perf_output_copy_aux()