Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\events\ring_buffer.c Create Date:2022-07-28 13:42:21
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:This is called before hardware starts writing to the AUX area to* obtain an output handle and make sure there's room in the buffer

Proto:void *perf_aux_output_begin(struct perf_output_handle *handle, struct perf_event *event)

Type:void

Parameter:

TypeParameterName
struct perf_output_handle *handle
struct perf_event *event
362  output_event = event
367  If parent Then output_event = parent
375  rb = ring_buffer_get(output_event)
376  If Not rb Then Return NULL
379  If Not rb_has_aux(rb) Then Go to err
390  If Not atomic_read( & aux_mmap_count) Then Go to err
393  If Not _inc_not_zero - increment a refcount unless it is 0*@r: the refcount to increment* Similar to atomic_inc_not_zero(), but will saturate at REFCOUNT_SATURATED* and WARN.* Provides no memory ordering, it is assumed the caller has guaranteed the Then Go to err
396  nest = READ_ONCE(aux_nest)
401  If WARN_ON_ONCE(nest) Then Go to err_put
404  WRITE_ONCE(aux_nest, nest + 1)
406  aux_head = AUX area
408  rb = rb
409  event = event
410  head = aux_head
411  size = 0
412  aux_flags = 0
419  If Not aux_overwrite Then
420  aux_tail = READ_ONCE(aux_tail)
421  wakeup = last aux_watermark boundary crossed by aux_head + aux_watermark
422  If aux_head - aux_tail < perf_aux_size(rb) Then size = Return space available, 0..size-1. We always leave one free charas a completely full buffer has head == tail, which is the same asempty. (aux_head, aux_tail, perf_aux_size(rb))
430  If Not size Then
433  WRITE_ONCE(aux_nest, 0)
434  Go to err_put
438  Return aux_priv
440  err_put :
442  rb_free_aux(rb)
444  err :
445  ring_buffer_put(rb)
446  event = NULL
448  Return NULL