Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\locking\lockdep.c Create Date:2022-07-28 09:49:49
Last Modify:2020-03-17 14:16:01 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Initialize a lock instance's lock-class mapping info:

Proto:void lockdep_init_map(struct lockdep_map *lock, const char *name, struct lock_class_key *key, int subclass)

Type:void

Parameter:

TypeParameterName
struct lockdep_map *lock
const char *name
struct lock_class_key *key
intsubclass
3714  When i < NR_LOCKDEP_CACHING_CLASSES cycle class_cache[i] = NULL
3724  If DEBUG_LOCKS_WARN_ON(!name) Then
3725  name = "NULL"
3726  Return
3729  name = name
3734  If DEBUG_LOCKS_WARN_ON(!key) Then Return
3740  If Not Is this the address of a static object: && Not Check whether a key has been registered as a dynamic key. Then
3741  If 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 Then printk(r conditions "BUG: key %px has not been registered!\n", key)
3743  DEBUG_LOCKS_WARN_ON(1)
3744  Return
3746  key = key
3748  If Value for the false possibility is greater at compile time(!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) Then Return
3751  If subclass Then
3754  If DEBUG_LOCKS_WARN_ON(lockdep_recursion) Then Return
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)
Caller
NameDescribe
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