2 * kernel/lockdep_internals.h
4 * Runtime locking correctness validator
6 * lockdep subsystem internal functions and variables.
10 * MAX_LOCKDEP_ENTRIES is the maximum number of lock dependencies
13 * We use the per-lock dependency maps in two ways: we grow it by adding
14 * every to-be-taken lock to all currently held lock's own dependency
15 * table (if it's not there yet), and we check it for lock order
16 * conflicts and deadlocks.
18 #define MAX_LOCKDEP_ENTRIES 8192UL
20 #define MAX_LOCKDEP_KEYS_BITS 11
21 #define MAX_LOCKDEP_KEYS (1UL << MAX_LOCKDEP_KEYS_BITS)
23 #define MAX_LOCKDEP_CHAINS_BITS 14
24 #define MAX_LOCKDEP_CHAINS (1UL << MAX_LOCKDEP_CHAINS_BITS)
26 #define MAX_LOCKDEP_CHAIN_HLOCKS (MAX_LOCKDEP_CHAINS*5)
29 * Stack-trace: tightly packed array of stack backtrace
30 * addresses. Protected by the hash_lock.
32 #define MAX_STACK_TRACE_ENTRIES 262144UL
34 extern struct list_head all_lock_classes
;
35 extern struct lock_chain lock_chains
[];
38 get_usage_chars(struct lock_class
*class, char *c1
, char *c2
, char *c3
, char *c4
);
40 extern const char * __get_key_name(struct lockdep_subclass_key
*key
, char *str
);
42 struct lock_class
*lock_chain_get_class(struct lock_chain
*chain
, int i
);
44 extern unsigned long nr_lock_classes
;
45 extern unsigned long nr_list_entries
;
46 extern unsigned long nr_lock_chains
;
47 extern int nr_chain_hlocks
;
48 extern unsigned long nr_stack_trace_entries
;
50 extern unsigned int nr_hardirq_chains
;
51 extern unsigned int nr_softirq_chains
;
52 extern unsigned int nr_process_chains
;
53 extern unsigned int max_lockdep_depth
;
54 extern unsigned int max_recursion_depth
;
56 #ifdef CONFIG_DEBUG_LOCKDEP
58 * Various lockdep statistics:
60 extern atomic_t chain_lookup_hits
;
61 extern atomic_t chain_lookup_misses
;
62 extern atomic_t hardirqs_on_events
;
63 extern atomic_t hardirqs_off_events
;
64 extern atomic_t redundant_hardirqs_on
;
65 extern atomic_t redundant_hardirqs_off
;
66 extern atomic_t softirqs_on_events
;
67 extern atomic_t softirqs_off_events
;
68 extern atomic_t redundant_softirqs_on
;
69 extern atomic_t redundant_softirqs_off
;
70 extern atomic_t nr_unused_locks
;
71 extern atomic_t nr_cyclic_checks
;
72 extern atomic_t nr_cyclic_check_recursions
;
73 extern atomic_t nr_find_usage_forwards_checks
;
74 extern atomic_t nr_find_usage_forwards_recursions
;
75 extern atomic_t nr_find_usage_backwards_checks
;
76 extern atomic_t nr_find_usage_backwards_recursions
;
77 # define debug_atomic_inc(ptr) atomic_inc(ptr)
78 # define debug_atomic_dec(ptr) atomic_dec(ptr)
79 # define debug_atomic_read(ptr) atomic_read(ptr)
81 # define debug_atomic_inc(ptr) do { } while (0)
82 # define debug_atomic_dec(ptr) do { } while (0)
83 # define debug_atomic_read(ptr) 0