函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\locking\lockdep.c Create Date:2022-07-27 10:50:07
Last Modify:2020-03-17 14:16:01 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Initialize a lock instance's lock-class mapping info:

函数原型:void lockdep_init_map(struct lockdep_map *lock, const char *name, struct lock_class_key *key, int subclass)

返回类型:void

参数:

类型参数名称
struct lockdep_map *lock
const char *name
struct lock_class_key *key
intsubclass
3714 i小于NR_LOCKDEP_CACHING_CLASSES循环class_cache[i] = NULL
3724  如果DEBUG_LOCKS_WARN_ON(!name)则
3725  name等于"NULL"
3726  返回
3729  name等于name
3734  如果DEBUG_LOCKS_WARN_ON(!key)则返回
3740  如果非Is this the address of a static object:且非Check whether a key has been registered as a dynamic key.
3741  如果We want to turn all lock-debugging facilities on/off at once,* via a global flag. The reason is that once a single bug has been* detected and reported, there might be cascade of followup bugs* that would just muddy the log. So we report the first one andprintk(r conditions "BUG: key %px has not been registered!\n", key)
3743  DEBUG_LOCKS_WARN_ON(1)
3744  返回
3746  key等于key
3748  如果此条件成立可能性小(为编译器优化)(!We want to turn all lock-debugging facilities on/off at once,* via a global flag. The reason is that once a single bug has been* detected and reported, there might be cascade of followup bugs* that would just muddy the log. So we report the first one and)则返回
3751  如果subclass
3754  如果DEBUG_LOCKS_WARN_ON(lockdep_recursion)则返回
3757  raw_local_irq_save(flags)
3758  lockdep_recursion等于1
3759  Register a lock's class in the hash-table, if the class is not present* yet. Otherwise we look it up. We cache the result in the lock object* itself, so actual lookup of the hash should be once per lock object.
3760  lockdep_recursion等于0
3761  raw_local_irq_restore(flags)
调用者
名称描述
bucket_table_alloc
__alloc_bucket_spinlocksAllocate an array of spinlocks to be accessed by a hash. Two arguments* indicate the number of elements to allocate in the array. max_size* gives the maximum number of elements to allocate. cpu_mult gives* the number of locks per CPU to allocate
__init_rwsemInitialize an rwsem:
debug_mutex_init
__lock_set_class
debug_rt_mutex_init
__raw_spin_lock_init
__rwlock_init
__init_srcu_struct
__init_srcu_struct
do_init_timer