函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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.

函数原型:static struct perf_event_context *perf_event_ctx_lock_nested(struct perf_event *event, int nesting)

返回类型:struct perf_event_context

参数:

类型参数名称
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  如果非_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
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  转到: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  如果ctx不等于ctx
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  转到:again
1286  返回:ctx
调用者
名称描述
perf_event_ctx_lock
perf_try_init_event