函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Kill an event dead; while event:refcount will preserve the event* object, it will not preserve its functionality. Once the last 'user'* gives up the object, we'll destroy the thing.

函数原型:int perf_event_release_kernel(struct perf_event *event)

返回类型:int

参数:

类型参数名称
struct perf_event *event
4720  ctx等于ctx
4722  LIST_HEAD(free_list)
4728  如果非ctx
4729  WARN_ON_ONCE(attach_state & (PERF_ATTACH_CONTEXT | PERF_ATTACH_GROUP))
4731  转到:no_ctx
4734  如果非is_kernel_event(event)则Remove user event from the owner task.
4737  ctx等于perf_event_ctx_lock(event)
4738  WARN_ON_ONCE(These fields let us detect when two contexts have both* been cloned (inherited) from a common ancestor.)
4739  Remove the event from a task's (or a CPU's) list of events.* If event->ctx is a cloned context, callers must make sure that* every task struct that event->ctx->task could possibly point to* remains valid. This is OK when called from perf_release since
4741  关闭本地中断,获取所要保护的运行队列(runqueue)的自旋锁(spinlock),为查找可运行进程做准备。( & Protect the states of the events in the list,* nr_active, and the list:)
4753  state等于PERF_EVENT_STATE_DEAD
4754  raw_spin_unlock_irq( & Protect the states of the events in the list,* nr_active, and the list:)
4756  perf_event_ctx_unlock(event, ctx)
4758  again :
4759  mutex_lock( & child_mutex)
4766  ctx等于READ_ONCE(ctx)
4775  get_ctx(ctx)
4782  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.
4783  mutex_lock( & Protect the list of events. Locking either mutex or lock* is sufficient to ensure the list doesn't change; to change* the list you need to lock both the mutex and the spinlock.)
4784  mutex_lock( & child_mutex)
4791  tmp等于list_first_entry_or_null - get the first element from a list*@ptr: the list head to take the element from.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.( & child_list, structperf_event, child_list)
4793  如果tmp恒等于child
4794  Remove the event from a task's (or a CPU's) list of events.* If event->ctx is a cloned context, callers must make sure that* every task struct that event->ctx->task could possibly point to* remains valid. This is OK when called from perf_release since
4795  链表项移动到头部
4800  put_event(event)
4803  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.
4804  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.
4805  put_ctx(ctx)
4806  转到:again
4808  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.
4811  var等于refcount
4813  删除链表项
4814  Used to free events which have a known refcount of 1, such as in error paths* where the event isn't exposed yet and inherited events.
4820  smp_mb()
4821  wake_up_var(var)
4824  no_ctx :
4825  put_event(event)
4826  返回:0
调用者
名称描述
measure_residency_fn
hardlockup_detector_perf_inithardlockup_detector_perf_init - Probe whether NMI event is available at all
perf_releaseCalled when the last reference to the file is gone.
unregister_hw_breakpointregister_hw_breakpoint - unregister a user-space hardware breakpoint*@bp: the breakpoint structure to unregister
hardlockup_detector_perf_cleanuphardlockup_detector_perf_cleanup - Cleanup disabled events and destroy them* Called from lockup_detector_cleanup(). Serialized by the caller.