函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Static locks do not have their class-keys yet - for them the key is* the lock object itself. If the lock is in the per cpu area, the* canonical address of the lock (per cpu offset removed) is used.

函数原型:static bool assign_lock_key(struct lockdep_map *lock)

返回类型:bool

参数:

类型参数名称
struct lockdep_map *lock
855  addr等于lock
865  BUILD_BUG_ON - break compile if a condition is true(sizeof(structlock_class_key) > sizeof(raw_spinlock_t))
868  如果__is_kernel_percpu_address(addr, & can_addr)则key等于can_addr
870  否则如果__is_module_percpu_address(addr, & can_addr)则key等于can_addr
872  否则如果Is this the address of a static object:key等于lock
874  否则
876  Generic 'turn off all lock debugging' function:
877  打印错误信息("INFO: trying to register non-static key.\n")
878  打印错误信息("the code is fine but needs lockdep annotation.\n")
879  打印错误信息("turning off the locking correctness validator.\n")
880  dump_stack()
881  返回:false
884  返回:true
调用者
名称描述
register_lock_classRegister 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.