函数逻辑报告 |
Source Code:kernel\locking\lockdep.c |
Create Date:2022-07-27 10:50:04 |
| Last Modify:2020-03-17 14:16:01 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称: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.
函数原型:static struct lock_class *register_lock_class(struct lockdep_map *lock, unsigned int subclass, int force)
返回类型:struct lock_class
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| struct lockdep_map * | lock | |
| unsigned int | subclass | |
| int | force |
| 1182 | DEBUG_LOCKS_WARN_ON(!已禁止中断()) |
| 1184 | class等于look_up_lock_class(lock, subclass) |
| 1185 | 如果此条件成立可能性大(为编译器优化)(class)则转到:out_set_class_cache |
| 1188 | 如果非key则 |
| 1192 | 返回:NULL |
| 1196 | hash_head等于classhashentry(key) |
| 1198 | 如果非graph_lock()则 |
| 1199 | 返回:NULL |
| 1206 | 如果key恒等于key则转到:out_unlock_set |
| 1215 | 如果非class则 |
| 1217 | 返回:NULL |
| 1220 | print_lockdep_off("BUG: MAX_LOCKDEP_KEYS too low!") |
| 1221 | dump_stack() |
| 1222 | 返回:NULL |
| 1224 | nr_lock_classes自加 |
| 1230 | WARN_ON_ONCE(!链表为空) |
| 1231 | WARN_ON_ONCE(!链表为空) |
| 1232 | name_version等于To make lock name printouts unique, we calculate a unique* class->name_version generation counter. The caller must hold the graph* lock. |
| 1237 | 添加哈希记录 |
| 1242 | 链表项移动到尾部 |
| 1245 | graph_unlock() |
| 1251 | dump_stack() |
| 1253 | 如果非graph_lock()则 |
| 1254 | 返回:NULL |
| 1257 | out_unlock_set : |
| 1258 | graph_unlock() |
| 1260 | out_set_class_cache : |
| 1261 | 如果非subclass或force则class_cache[0]等于class |
| 1263 | 否则如果subclass小于NR_LOCKDEP_CACHING_CLASSES则class_cache[subclass]等于class |
| 1270 | 如果DEBUG_LOCKS_WARN_ON(subclass != subclass)则返回:NULL |
| 1273 | 返回:class |
| 名称 | 描述 |
|---|---|
| lockdep_init_map | Initialize a lock instance's lock-class mapping info: |
| __lock_acquire | This gets called for every mutex_lock*()/spin_lock*() operation |
| __lock_set_class |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |