Function report |
Source Code:kernel\locking\lockdep.c |
Create Date:2022-07-28 09:49:57 |
| Last Modify:2020-03-17 14:16:01 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:This gets called for every mutex_lock*()/spin_lock*() operation
Proto: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)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| 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 |
| 3816 | curr = current process |
| 3817 | struct lock_class * class = NULL |
| 3820 | chain_head = 0 |
| 3827 | If Not r sysctl || key == __lockdep_no_validate__ Then check = 0 |
| 3830 | If subclass < NR_LOCKDEP_CACHING_CLASSES Then class = class_cache[subclass] |
| 3835 | If Value for the false possibility is greater at compile time(!class) Then |
| 3837 | If Not class Then Return 0 |
| 3841 | debug_class_ops_inc(class) |
| 3843 | If very_verbose(class) Then |
| 3848 | dump_stack() |
| 3856 | depth = lockdep_depth |
| 3860 | If DEBUG_LOCKS_WARN_ON(depth >= MAX_LOCK_DEPTH) Then Return 0 |
| 3863 | class_idx = class - lock_classes |
| 3865 | If depth Then |
| 3866 | hlock = held_locks + depth - 1 |
| 3868 | If Not references Then references++ |
| 3871 | If Not references Then references++ |
| 3874 | references += references |
| 3877 | If DEBUG_LOCKS_WARN_ON(references < references) Then Return 0 |
| 3880 | Return 2 |
| 3884 | hlock = held_locks + depth |
| 3889 | If DEBUG_LOCKS_WARN_ON(!class) Then Return 0 |
| 3892 | acquire_ip = ip |
| 3895 | irq_context = task_irq_context(curr) |
| 3899 | hardirqs_off = Not Not hardirqs_off |
| 3900 | references = references |
| 3908 | If Not mark_usage(curr, hlock, check) Then Return 0 |
| 3924 | If DEBUG_LOCKS_WARN_ON(!st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting from) Then Return 0 |
| 3927 | chain_key = curr_chain_key |
| 3928 | If Not depth Then |
| 3932 | If DEBUG_LOCKS_WARN_ON(chain_key != INITIAL_CHAIN_KEY) Then Return 0 |
| 3934 | chain_head = 1 |
| 3937 | prev_chain_key = chain_key |
| 3938 | If separate_irq_context(curr, hlock) Then |
| 3939 | chain_key = INITIAL_CHAIN_KEY |
| 3940 | chain_head = 1 |
| 3944 | If nest_lock && Not __lock_is_held(nest_lock, - 1) Then |
| 3945 | print_lock_nested_lock_not_held(curr, hlock, ip) |
| 3946 | Return 0 |
| 3950 | WARN_ON_ONCE(depth && !key) |
| 3951 | WARN_ON_ONCE(!key) |
| 3954 | If Not validate_chain(curr, hlock, chain_head, chain_key) Then Return 0 |
| 3957 | curr_chain_key = chain_key |
| 3958 | lockdep_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) |
| 3971 | debug_show_all_locks() |
| 3972 | dump_stack() |
| 3974 | Return 0 |
| 3977 | If Value for the false possibility is greater at compile time(lockdep_depth > max_lockdep_depth) Then max_lockdep_depth = lockdep_depth |
| 3980 | Return 1 |
| Name | Describe |
|---|---|
| reacquire_held_locks | |
| lock_acquire | We are not always called with irqs disabled - do that here,* and also avoid lockdep recursion: |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |