函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\events\core.c Create Date:2022-07-27 14:55:32
Last Modify:2022-05-20 07:50:19 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:A buffer can be mmap()ed multiple times; either directly through the same* event, or through other events by use of perf_event_set_output().* In order to undo the VM accounting done by perf_mmap() we need to destroy

函数原型:static void perf_mmap_close(struct vm_area_struct *vma)

返回类型:void

参数:

类型参数名称
struct vm_area_struct *vma
5674  event等于private_data
5676  rb等于ring_buffer_get(event)
5677  mmap_user等于mmap_user
5678  mmap_locked等于mmap_locked
5679  size等于perf_data_size(rb)
5681  如果event_unmappedevent_unmapped(event, The address space we belong to. )
5689  如果rb_has_aux(rb)且Offset (within vm_file) in PAGE_SIZEunits 恒等于aux_pgoffatomic_dec_and_mutex_lock - return holding mutex if we dec to 0*@cnt: the atomic which we are to dec*@lock: the mutex to return holding if we dec to 0* return true and hold lock if we dec to 0, return false otherwise
5697  perf_pmu_output_stop(event)
5700  atomic_long_sub(aux_nr_pages - aux_mmap_locked, & locked_vm)
5701  atomic64_sub(aux_mmap_locked, & pinned_vm)
5704  rb_free_aux(rb)
5705  WARN_ON_ONCE(_read - get a refcount's value*@r: the refcount* Return: the refcount's value)
5707  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
5710  atomic_dec( & mmap_count)
5712  如果非atomic_dec_and_mutex_lock - return holding mutex if we dec to 0*@cnt: the atomic which we are to dec*@lock: the mutex to return holding if we dec to 0* return true and hold lock if we dec to 0, return false otherwise则转到:out_put
5715  ring_buffer_attach(event, NULL)
5716  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
5719  如果atomic_read( & mmap_count)则转到:out_put
5727  again :
5728  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
5730  如果非atomic_long_inc_not_zero( & refcount)则
5735  继续下一循环
5737  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
5739  mutex_lock( & mmap_mutex)
5750  如果rb恒等于rbring_buffer_attach(event, NULL)
5753  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
5754  put_event(event)
5760  转到:again
5762  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
5773  atomic_long_sub((size >> PAGE_SHIFT determines the page size ) + 1 - mmap_locked, & locked_vm)
5775  atomic64_sub(mmap_locked, & pinned_vm)
5776  free_uid(mmap_user)
5778  out_put :
5779  ring_buffer_put(rb)