lockdep: simplify mark_lock()
[deliverable/linux.git] / kernel / lockdep_internals.h
CommitLineData
fbb9ce95
IM
1/*
2 * kernel/lockdep_internals.h
3 *
4 * Runtime locking correctness validator
5 *
6 * lockdep subsystem internal functions and variables.
7 */
8
9/*
10 * MAX_LOCKDEP_ENTRIES is the maximum number of lock dependencies
11 * we track.
12 *
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.
17 */
18#define MAX_LOCKDEP_ENTRIES 8192UL
19
50cc670a 20#define MAX_LOCKDEP_CHAINS_BITS 14
fbb9ce95
IM
21#define MAX_LOCKDEP_CHAINS (1UL << MAX_LOCKDEP_CHAINS_BITS)
22
443cd507
HY
23#define MAX_LOCKDEP_CHAIN_HLOCKS (MAX_LOCKDEP_CHAINS*5)
24
fbb9ce95
IM
25/*
26 * Stack-trace: tightly packed array of stack backtrace
27 * addresses. Protected by the hash_lock.
28 */
9bb25bf3 29#define MAX_STACK_TRACE_ENTRIES 262144UL
fbb9ce95
IM
30
31extern struct list_head all_lock_classes;
443cd507 32extern struct lock_chain lock_chains[];
fbb9ce95
IM
33
34extern void
cf40bd16
NP
35get_usage_chars(struct lock_class *class, char *c1, char *c2, char *c3,
36 char *c4, char *c5, char *c6);
fbb9ce95
IM
37
38extern const char * __get_key_name(struct lockdep_subclass_key *key, char *str);
39
443cd507
HY
40struct lock_class *lock_chain_get_class(struct lock_chain *chain, int i);
41
fbb9ce95
IM
42extern unsigned long nr_lock_classes;
43extern unsigned long nr_list_entries;
44extern unsigned long nr_lock_chains;
cd1a28e8 45extern int nr_chain_hlocks;
fbb9ce95
IM
46extern unsigned long nr_stack_trace_entries;
47
48extern unsigned int nr_hardirq_chains;
49extern unsigned int nr_softirq_chains;
50extern unsigned int nr_process_chains;
51extern unsigned int max_lockdep_depth;
52extern unsigned int max_recursion_depth;
53
d6672c50 54#ifdef CONFIG_PROVE_LOCKING
419ca3f1
DM
55extern unsigned long lockdep_count_forward_deps(struct lock_class *);
56extern unsigned long lockdep_count_backward_deps(struct lock_class *);
d6672c50
IM
57#else
58static inline unsigned long
59lockdep_count_forward_deps(struct lock_class *class)
60{
61 return 0;
62}
63static inline unsigned long
64lockdep_count_backward_deps(struct lock_class *class)
65{
66 return 0;
67}
68#endif
419ca3f1 69
fbb9ce95
IM
70#ifdef CONFIG_DEBUG_LOCKDEP
71/*
72 * Various lockdep statistics:
73 */
74extern atomic_t chain_lookup_hits;
75extern atomic_t chain_lookup_misses;
76extern atomic_t hardirqs_on_events;
77extern atomic_t hardirqs_off_events;
78extern atomic_t redundant_hardirqs_on;
79extern atomic_t redundant_hardirqs_off;
80extern atomic_t softirqs_on_events;
81extern atomic_t softirqs_off_events;
82extern atomic_t redundant_softirqs_on;
83extern atomic_t redundant_softirqs_off;
84extern atomic_t nr_unused_locks;
85extern atomic_t nr_cyclic_checks;
86extern atomic_t nr_cyclic_check_recursions;
87extern atomic_t nr_find_usage_forwards_checks;
88extern atomic_t nr_find_usage_forwards_recursions;
89extern atomic_t nr_find_usage_backwards_checks;
90extern atomic_t nr_find_usage_backwards_recursions;
91# define debug_atomic_inc(ptr) atomic_inc(ptr)
92# define debug_atomic_dec(ptr) atomic_dec(ptr)
93# define debug_atomic_read(ptr) atomic_read(ptr)
94#else
95# define debug_atomic_inc(ptr) do { } while (0)
96# define debug_atomic_dec(ptr) do { } while (0)
97# define debug_atomic_read(ptr) 0
98#endif
This page took 0.344907 seconds and 5 git commands to generate.