函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__lock_set_class

函数原型:static int __lock_set_class(struct lockdep_map *lock, const char *name, struct lock_class_key *key, unsigned int subclass, unsigned long ip)

返回类型:int

参数:

类型参数名称
struct lockdep_map *lock
const char *name
struct lock_class_key *key
unsigned intsubclass
unsigned longip
4119  curr等于当前进程
4120  merged等于0
4125  如果此条件成立可能性小(为编译器优化)(!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)则返回:0
4128  depth等于lockdep_depth
4133  如果DEBUG_LOCKS_WARN_ON(!depth)则返回:0
4136  hlock等于@depth must not be zero
4137  如果非hlock
4138  print_unlock_imbalance_bug(curr, lock, ip)
4139  返回:0
4142  Initialize a lock instance's lock-class mapping info:
4143  class等于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.
4144  class_idx等于classlock_classes
4146  lockdep_depth等于i
4147  curr_chain_key等于prev_chain_key
4149  如果reacquire_held_locks(curr, depth, i, & merged)则返回:0
4156  如果DEBUG_LOCKS_WARN_ON(lockdep_depth != depth - merged)则返回:0
4158  返回:1
调用者
名称描述
lock_set_class