Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Because of perf_event::ctx migration in sys_perf_event_open::move_group and* perf_pmu_migrate_context() we need some magic.* Those places that change perf_event::ctx will hold both* perf_event_ctx::mutex of the 'old' and 'new' ctx value.

Proto:static struct perf_event_context *perf_event_ctx_lock_nested(struct perf_event *event, int nesting)

Type:struct perf_event_context

Parameter:

TypeParameterName
struct perf_event *event
intnesting
1270  again :
1271  _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
1272  ctx = READ_ONCE(ctx)
1273  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
1274  _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()
1275  Go to again
1277  _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()
1279  mutex_lock_nested( & 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., nesting)
1280  If ctx != ctx Then
1281  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.
1282  put_ctx(ctx)
1283  Go to again
1286  Return ctx
Caller
NameDescribe
perf_event_ctx_lock
perf_try_init_event