• Home
  • Raw
  • Download

Lines Matching refs:class

294 struct lock_class_stats lock_stats(struct lock_class *class)  in lock_stats()  argument
302 &per_cpu(cpu_lock_stats, cpu)[class - lock_classes]; in lock_stats()
323 void clear_lock_stats(struct lock_class *class) in clear_lock_stats() argument
329 &per_cpu(cpu_lock_stats, cpu)[class - lock_classes]; in clear_lock_stats()
333 memset(class->contention_point, 0, sizeof(class->contention_point)); in clear_lock_stats()
334 memset(class->contending_point, 0, sizeof(class->contending_point)); in clear_lock_stats()
337 static struct lock_class_stats *get_lock_stats(struct lock_class *class) in get_lock_stats() argument
339 return &this_cpu_ptr(cpu_lock_stats)[class - lock_classes]; in get_lock_stats()
495 static int class_filter(struct lock_class *class) in class_filter() argument
499 if (class->name_version == 1 && in class_filter()
500 !strcmp(class->name, "lockname")) in class_filter()
502 if (class->name_version == 1 && in class_filter()
503 !strcmp(class->name, "&struct->lockfield")) in class_filter()
511 static int verbose(struct lock_class *class) in verbose() argument
514 return class_filter(class); in verbose()
673 static char get_usage_char(struct lock_class *class, enum lock_usage_bit bit) in get_usage_char() argument
689 if (class->usage_mask & lock_flag(bit + LOCK_USAGE_DIR_MASK)) { in get_usage_char()
691 if (class->usage_mask & lock_flag(bit)) in get_usage_char()
693 } else if (class->usage_mask & lock_flag(bit)) in get_usage_char()
699 void get_usage_chars(struct lock_class *class, char usage[LOCK_USAGE_CHARS]) in get_usage_chars() argument
704 usage[i++] = get_usage_char(class, LOCK_USED_IN_##__STATE); \ in get_usage_chars()
705 usage[i++] = get_usage_char(class, LOCK_USED_IN_##__STATE##_READ); in get_usage_chars()
712 static void __print_lock_name(struct lock_class *class) in __print_lock_name() argument
717 name = class->name; in __print_lock_name()
719 name = __get_key_name(class->key, str); in __print_lock_name()
723 if (class->name_version > 1) in __print_lock_name()
724 printk(KERN_CONT "#%d", class->name_version); in __print_lock_name()
725 if (class->subclass) in __print_lock_name()
726 printk(KERN_CONT "/%d", class->subclass); in __print_lock_name()
730 static void print_lock_name(struct lock_class *class) in print_lock_name() argument
734 get_usage_chars(class, usage); in print_lock_name()
737 __print_lock_name(class); in print_lock_name()
739 class->wait_type_outer ?: class->wait_type_inner, in print_lock_name()
740 class->wait_type_inner); in print_lock_name()
808 static int very_verbose(struct lock_class *class) in very_verbose() argument
811 return class_filter(class); in very_verbose()
862 struct lock_class *class; in count_matching_names() local
868 list_for_each_entry(class, &all_lock_classes, lock_entry) { in count_matching_names()
869 if (new_class->key - new_class->subclass == class->key) in count_matching_names()
870 return class->name_version; in count_matching_names()
871 if (class->name && !strcmp(class->name, new_class->name)) in count_matching_names()
872 count = max(count, class->name_version); in count_matching_names()
884 struct lock_class *class; in look_up_lock_class() local
924 hlist_for_each_entry_rcu_notrace(class, hash_head, hash_entry) { in look_up_lock_class()
925 if (class->key == key) { in look_up_lock_class()
930 WARN_ONCE(class->name != lock->name && in look_up_lock_class()
933 lock->name, lock->key, class->name); in look_up_lock_class()
934 return class; in look_up_lock_class()
1002 struct lock_class *class; in in_any_class_list() local
1006 class = &lock_classes[i]; in in_any_class_list()
1007 if (in_list(e, &class->locks_after) || in in_any_class_list()
1008 in_list(e, &class->locks_before)) in in_any_class_list()
1025 e->class && e->class->name ? e->class->name : in class_lock_list_valid()
1060 static bool in_any_zapped_class_list(struct lock_class *class) in in_any_zapped_class_list() argument
1066 if (in_list(&class->lock_entry, &pf->zapped)) in in_any_zapped_class_list()
1075 struct lock_class *class; in __check_data_structures() local
1083 class = &lock_classes[i]; in __check_data_structures()
1084 if (!in_list(&class->lock_entry, &all_lock_classes) && in __check_data_structures()
1085 !in_list(&class->lock_entry, &free_lock_classes) && in __check_data_structures()
1086 !in_any_zapped_class_list(class)) { in __check_data_structures()
1088 class, class->name ? : "(?)"); in __check_data_structures()
1095 class = &lock_classes[i]; in __check_data_structures()
1096 if (!class_lock_list_valid(class, &class->locks_before)) in __check_data_structures()
1098 if (!class_lock_list_valid(class, &class->locks_after)) in __check_data_structures()
1120 e->class->name ? : "(?)", in __check_data_structures()
1135 e->class && e->class->name ? e->class->name : in __check_data_structures()
1277 struct lock_class *class; in register_lock_class() local
1282 class = look_up_lock_class(lock, subclass); in register_lock_class()
1283 if (likely(class)) in register_lock_class()
1303 hlist_for_each_entry_rcu(class, hash_head, hash_entry) { in register_lock_class()
1304 if (class->key == key) in register_lock_class()
1311 class = list_first_entry_or_null(&free_lock_classes, typeof(*class), in register_lock_class()
1313 if (!class) { in register_lock_class()
1323 __set_bit(class - lock_classes, lock_classes_in_use); in register_lock_class()
1325 class->key = key; in register_lock_class()
1326 class->name = lock->name; in register_lock_class()
1327 class->subclass = subclass; in register_lock_class()
1328 WARN_ON_ONCE(!list_empty(&class->locks_before)); in register_lock_class()
1329 WARN_ON_ONCE(!list_empty(&class->locks_after)); in register_lock_class()
1330 class->name_version = count_matching_names(class); in register_lock_class()
1331 class->wait_type_inner = lock->wait_type_inner; in register_lock_class()
1332 class->wait_type_outer = lock->wait_type_outer; in register_lock_class()
1333 class->lock_type = lock->lock_type; in register_lock_class()
1338 hlist_add_head_rcu(&class->hash_entry, hash_head); in register_lock_class()
1343 list_move_tail(&class->lock_entry, &all_lock_classes); in register_lock_class()
1344 idx = class - lock_classes; in register_lock_class()
1348 if (verbose(class)) { in register_lock_class()
1351 printk("\nnew class %px: %s", class->key, class->name); in register_lock_class()
1352 if (class->name_version > 1) in register_lock_class()
1353 printk(KERN_CONT "#%d", class->name_version); in register_lock_class()
1366 lock->class_cache[0] = class; in register_lock_class()
1368 lock->class_cache[subclass] = class; in register_lock_class()
1374 if (DEBUG_LOCKS_WARN_ON(class->subclass != subclass)) in register_lock_class()
1377 return class; in register_lock_class()
1420 entry->class = this; in add_lock_to_list()
1512 lock->class->dep_gen_id = lockdep_dependency_gen_id; in mark_lock_accessed()
1523 return lock->class->dep_gen_id == lockdep_dependency_gen_id; in lock_accessed()
1552 void *lock_class = lock->class; in get_dep_list()
1643 struct lock_class *class) in __bfs_init_root() argument
1645 lock->class = class; in __bfs_init_root()
1735 if (!lock->class) in __bfs()
1863 print_lock_name(target->class); in print_circular_bug_entry()
1875 struct lock_class *parent = prt->class; in print_circular_lock_scenario()
1980 return hlock_class(hlock) == entry->class && /* Found A -> .. -> B */ in hlock_equal()
2007 return hlock_class(hlock) == entry->class && /* Found A -> .. -> B */ in hlock_conflict()
2077 unsigned long lockdep_count_forward_deps(struct lock_class *class) in lockdep_count_forward_deps() argument
2082 __bfs_init_root(&this, class); in lockdep_count_forward_deps()
2103 unsigned long lockdep_count_backward_deps(struct lock_class *class) in lockdep_count_backward_deps() argument
2108 __bfs_init_root(&this, class); in lockdep_count_backward_deps()
2222 *(unsigned long *)mask |= entry->class->usage_mask; in usage_accumulate()
2224 *(unsigned long *)mask |= (entry->class->usage_mask & LOCKF_IRQ); in usage_accumulate()
2241 return !!(entry->class->usage_mask & *(unsigned long *)mask); in usage_match()
2243 return !!((entry->class->usage_mask & LOCKF_IRQ) & *(unsigned long *)mask); in usage_match()
2274 if (entry->class->lock_type == LD_LOCK_PERCPU) { in usage_skip()
2275 if (DEBUG_LOCKS_WARN_ON(entry->class->wait_type_inner < LD_WAIT_CONFIG)) in usage_skip()
2321 static void print_lock_class_header(struct lock_class *class, int depth) in print_lock_class_header() argument
2326 print_lock_name(class); in print_lock_class_header()
2328 printk(KERN_CONT " ops: %lu", debug_class_ops_read(class)); in print_lock_class_header()
2333 if (class->usage_mask & (1 << bit)) { in print_lock_class_header()
2338 print_lock_trace(class->usage_traces[bit], len); in print_lock_class_header()
2344 depth, "", class->key, class->key); in print_lock_class_header()
2410 print_lock_class_header(entry->class, depth); in print_shortest_lock_dependencies()
2457 print_lock_class_header(entry->class, depth); in print_shortest_lock_dependencies_backwards()
2486 struct lock_class *safe_class = safe_entry->class; in print_irq_lock_scenario()
2487 struct lock_class *unsafe_class = unsafe_entry->class; in print_irq_lock_scenario()
2575 print_lock_name(backwards_entry->class); in print_bad_irq_dependency()
2578 print_lock_trace(backwards_entry->class->usage_traces[bit1], 1); in print_bad_irq_dependency()
2581 print_lock_name(forwards_entry->class); in print_bad_irq_dependency()
2585 print_lock_trace(forwards_entry->class->usage_traces[bit2], 1); in print_bad_irq_dependency()
2823 backward_mask = original_mask(target_entry1->class->usage_mask & LOCKF_ENABLED_IRQ_ALL); in check_irq_usage()
2837 ret = find_exclusive_match(target_entry->class->usage_mask, in check_irq_usage()
2838 target_entry1->class->usage_mask, in check_irq_usage()
3106 if (entry->class == hlock_class(next)) { in check_prev_add()
3128 if (entry->class == hlock_class(prev)) { in check_prev_add()
3737 struct lock_class *class = hlock_class(hlock); in lookup_chain_cache_add() local
3745 if (very_verbose(class)) { in lookup_chain_cache_add()
3749 class->key, class->name); in lookup_chain_cache_add()
3755 if (very_verbose(class)) { in lookup_chain_cache_add()
3757 (unsigned long long)chain_key, class->key, class->name); in lookup_chain_cache_add()
3908 struct lock_class *class = hlock_class(lock); in print_usage_bug_scenario() local
3914 __print_lock_name(class); in print_usage_bug_scenario()
3918 __print_lock_name(class); in print_usage_bug_scenario()
4004 print_lock_name(other->class); in print_irq_inversion_bug()
4022 middle ? middle->class : root->class, other->class); in print_irq_inversion_bug()
4025 middle ? middle->class : other->class, root->class); in print_irq_inversion_bug()
4063 if (target_entry->class->usage_mask & lock_flag(bit)) { in check_usage_forwards()
4098 if (target_entry->class->usage_mask & lock_flag(bit)) { in check_usage_backwards()
4128 static int HARDIRQ_verbose(struct lock_class *class) in HARDIRQ_verbose() argument
4131 return class_filter(class); in HARDIRQ_verbose()
4136 static int SOFTIRQ_verbose(struct lock_class *class) in SOFTIRQ_verbose() argument
4139 return class_filter(class); in SOFTIRQ_verbose()
4144 static int (*state_verbose_f[])(struct lock_class *class) = {
4152 struct lock_class *class) in state_verbose() argument
4154 return state_verbose_f[bit >> LOCK_USAGE_DIR_MASK](class); in state_verbose()
4909 struct lock_class *class = NULL; in __lock_acquire() local
4923 class = lock->class_cache[subclass]; in __lock_acquire()
4927 if (unlikely(!class)) { in __lock_acquire()
4928 class = register_lock_class(lock, subclass, 0); in __lock_acquire()
4929 if (!class) in __lock_acquire()
4933 debug_class_ops_inc(class); in __lock_acquire()
4935 if (very_verbose(class)) { in __lock_acquire()
4936 printk("\nacquire class [%px] %s", class->key, class->name); in __lock_acquire()
4937 if (class->name_version > 1) in __lock_acquire()
4938 printk(KERN_CONT "#%d", class->name_version); in __lock_acquire()
4955 class_idx = class - lock_classes; in __lock_acquire()
4981 if (DEBUG_LOCKS_WARN_ON(!class)) in __lock_acquire()
5112 const struct lock_class *class = lock->class_cache[0]; in match_held_lock() local
5114 if (!class) in match_held_lock()
5115 class = look_up_lock_class(lock, 0); in match_held_lock()
5123 if (!class) in match_held_lock()
5134 if (hlock->class_idx == class - lock_classes) in match_held_lock()
5217 struct lock_class *class; in __lock_set_class() local
5241 class = register_lock_class(lock, subclass, 0); in __lock_set_class()
5242 hlock->class_idx = class - lock_classes; in __lock_set_class()
5575 struct lock_class *class = look_up_lock_class(lock, subclass); in verify_lock_unused() local
5579 if (!class) in verify_lock_unused()
5589 if (!(class->usage_mask & mask)) in verify_lock_unused()
5592 hlock->class_idx = class - lock_classes; in verify_lock_unused()
5947 struct lock_class *class) in remove_class_from_lock_chain() argument
5953 if (chain_hlock_class_idx(chain_hlocks[i]) != class - lock_classes) in remove_class_from_lock_chain()
5982 struct lock_class *class) in remove_class_from_lock_chains() argument
5991 remove_class_from_lock_chain(pf, chain, class); in remove_class_from_lock_chains()
5999 static void zap_class(struct pending_free *pf, struct lock_class *class) in zap_class() argument
6004 WARN_ON_ONCE(!class->key); in zap_class()
6012 if (entry->class != class && entry->links_to != class) in zap_class()
6018 if (list_empty(&class->locks_after) && in zap_class()
6019 list_empty(&class->locks_before)) { in zap_class()
6020 list_move_tail(&class->lock_entry, &pf->zapped); in zap_class()
6021 hlist_del_rcu(&class->hash_entry); in zap_class()
6022 WRITE_ONCE(class->key, NULL); in zap_class()
6023 WRITE_ONCE(class->name, NULL); in zap_class()
6025 __clear_bit(class - lock_classes, lock_classes_in_use); in zap_class()
6026 if (class - lock_classes == max_lock_class_idx) in zap_class()
6030 class->name); in zap_class()
6033 remove_class_from_lock_chains(pf, class); in zap_class()
6037 static void reinit_class(struct lock_class *class) in reinit_class() argument
6039 WARN_ON_ONCE(!class->lock_entry.next); in reinit_class()
6040 WARN_ON_ONCE(!list_empty(&class->locks_after)); in reinit_class()
6041 WARN_ON_ONCE(!list_empty(&class->locks_before)); in reinit_class()
6042 memset_startat(class, 0, key); in reinit_class()
6043 WARN_ON_ONCE(!class->lock_entry.next); in reinit_class()
6044 WARN_ON_ONCE(!list_empty(&class->locks_after)); in reinit_class()
6045 WARN_ON_ONCE(!list_empty(&class->locks_before)); in reinit_class()
6091 struct lock_class *class; in __free_zapped_classes() local
6095 list_for_each_entry(class, &pf->zapped, lock_entry) in __free_zapped_classes()
6096 reinit_class(class); in __free_zapped_classes()
6141 struct lock_class *class; in __lockdep_free_key_range() local
6148 hlist_for_each_entry_rcu(class, head, hash_entry) { in __lockdep_free_key_range()
6149 if (!within(class->key, start, size) && in __lockdep_free_key_range()
6150 !within(class->name, start, size)) in __lockdep_free_key_range()
6152 zap_class(pf, class); in __lockdep_free_key_range()
6223 struct lock_class *class; in lock_class_cache_is_registered() local
6229 hlist_for_each_entry_rcu(class, head, hash_entry) { in lock_class_cache_is_registered()
6231 if (lock->class_cache[j] == class) in lock_class_cache_is_registered()
6242 struct lock_class *class; in __lockdep_reset_lock() local
6252 class = look_up_lock_class(lock, j); in __lockdep_reset_lock()
6253 if (class) in __lockdep_reset_lock()
6254 zap_class(pf, class); in __lockdep_reset_lock()