函数逻辑报告 |
Source Code:kernel\locking\lockdep.c |
Create Date:2022-07-27 10:50:14 |
Last Modify:2020-03-17 14:16:01 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:This gets called for every mutex_lock*()/spin_lock*() operation
函数原型:static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass, int trylock, int read, int check, int hardirqs_off, struct lockdep_map *nest_lock, unsigned long ip, int references, int pin_count)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct lockdep_map * | lock | |
unsigned int | subclass | |
int | trylock | |
int | read | |
int | check | |
int | hardirqs_off | |
struct lockdep_map * | nest_lock | |
unsigned long | ip | |
int | references | |
int | pin_count |
3817 | struct lock_class * class = NULL |
3820 | chain_head等于0 |
3827 | 如果非r sysctl 或key恒等于__lockdep_no_validate__则check等于0 |
3835 | 如果此条件成立可能性小(为编译器优化)(!class)则 |
3837 | 如果非class则返回:0 |
3841 | debug_class_ops_inc(class) |
3843 | 如果very_verbose(class)则 |
3848 | dump_stack() |
3856 | depth等于lockdep_depth |
3860 | 如果DEBUG_LOCKS_WARN_ON(depth >= MAX_LOCK_DEPTH)则返回:0 |
3863 | class_idx等于class减lock_classes |
3865 | 如果depth则 |
3866 | hlock等于held_locks加depth减1 |
3868 | 如果非references则references自加 |
3871 | 如果非references则references自加 |
3874 | references加等于references |
3877 | 如果DEBUG_LOCKS_WARN_ON(references < references)则返回:0 |
3880 | 返回:2 |
3884 | hlock等于held_locks加depth |
3889 | 如果DEBUG_LOCKS_WARN_ON(!class)则返回:0 |
3892 | acquire_ip等于ip |
3895 | irq_context等于task_irq_context(curr) |
3899 | hardirqs_off等于非非hardirqs_off |
3900 | references等于references |
3908 | 如果非mark_usage(curr, hlock, check)则返回:0 |
3924 | 如果DEBUG_LOCKS_WARN_ON(!st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting from)则返回:0 |
3927 | chain_key等于curr_chain_key |
3928 | 如果非depth则 |
3932 | 如果DEBUG_LOCKS_WARN_ON(chain_key != INITIAL_CHAIN_KEY)则返回:0 |
3934 | chain_head等于1 |
3937 | prev_chain_key等于chain_key |
3938 | 如果separate_irq_context(curr, hlock)则 |
3939 | chain_key等于INITIAL_CHAIN_KEY |
3940 | chain_head等于1 |
3944 | 如果nest_lock且非__lock_is_held(nest_lock, - 1)则 |
3945 | print_lock_nested_lock_not_held(curr, hlock, ip) |
3946 | 返回:0 |
3950 | WARN_ON_ONCE(depth && !key) |
3951 | WARN_ON_ONCE(!key) |
3954 | 如果非validate_chain(curr, hlock, chain_head, chain_key)则返回:0 |
3957 | curr_chain_key等于chain_key |
3958 | lockdep_depth自加 |
3964 | 如果此条件成立可能性小(为编译器优化)(lockdep_depth >= MAX_LOCK_DEPTH)则 |
3966 | print_lockdep_off("BUG: MAX_LOCK_DEPTH too low!") |
3967 | printk(debug-level messages "depth: %i max: %lu!\n", lockdep_depth, MAX_LOCK_DEPTH) |
3970 | lockdep_print_held_locks(当前进程) |
3971 | debug_show_all_locks() |
3972 | dump_stack() |
3974 | 返回:0 |
3980 | 返回:1 |
名称 | 描述 |
---|---|
reacquire_held_locks | |
lock_acquire | We are not always called with irqs disabled - do that here,* and also avoid lockdep recursion: |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |