Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\events\core.c Create Date:2022-07-28 13:34:50
Last Modify:2022-05-20 07:50:19 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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.

Proto:int perf_event_release_kernel(struct perf_event *event)

Type:int

Parameter:

TypeParameterName
struct perf_event *event
4720  ctx = ctx
4722  LIST_HEAD(free_list)
4728  If Not ctx Then
4729  WARN_ON_ONCE(attach_state & (PERF_ATTACH_CONTEXT | PERF_ATTACH_GROUP))
4731  Go to no_ctx
4734  If Not is_kernel_event(event) Then 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  raw_spin_lock_irq( & 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  If tmp == child Then
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  list_move - delete from one list and add as another's head*@list: the entry to move*@head: the head that will precede our entry
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  Go to 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  deletes entry from list
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  Return 0
Caller
NameDescribe
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.