Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
lockdep.c File Reference
#include <linux/mutex.h>
#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/spinlock.h>
#include <linux/kallsyms.h>
#include <linux/interrupt.h>
#include <linux/stacktrace.h>
#include <linux/debug_locks.h>
#include <linux/irqflags.h>
#include <linux/utsname.h>
#include <linux/hash.h>
#include <linux/ftrace.h>
#include <linux/stringify.h>
#include <linux/bitops.h>
#include <linux/gfp.h>
#include <linux/kmemcheck.h>
#include <asm/sections.h>
#include "lockdep_internals.h"
#include <trace/events/lock.h>
#include "lockdep_states.h"

Go to the source code of this file.

Macros

#define DISABLE_BRANCH_PROFILING
 
#define CREATE_TRACE_POINTS
 
#define prove_locking   0
 
#define lock_stat   0
 
#define CLASSHASH_BITS   (MAX_LOCKDEP_KEYS_BITS - 1)
 
#define CLASSHASH_SIZE   (1UL << CLASSHASH_BITS)
 
#define __classhashfn(key)   hash_long((unsigned long)key, CLASSHASH_BITS)
 
#define classhashentry(key)   (classhash_table + __classhashfn((key)))
 
#define CHAINHASH_BITS   (MAX_LOCKDEP_CHAINS_BITS-1)
 
#define CHAINHASH_SIZE   (1UL << CHAINHASH_BITS)
 
#define __chainhashfn(chain)   hash_long(chain, CHAINHASH_BITS)
 
#define chainhashentry(chain)   (chainhash_table + __chainhashfn((chain)))
 
#define iterate_chain_key(key1, key2)
 
#define VERBOSE   0
 
#define VERY_VERBOSE   0
 
#define HARDIRQ_VERBOSE   0
 
#define SOFTIRQ_VERBOSE   0
 
#define RECLAIM_VERBOSE   0
 
#define __USAGE(__STATE)
 
#define LOCKDEP_STATE(__STATE)   __USAGE(__STATE)
 
#define LOCKDEP_STATE(__STATE)
 
#define LOCKDEP_STATE(__STATE)
 

Functions

 LIST_HEAD (all_lock_classes)
 
void lockdep_off (void)
 
 EXPORT_SYMBOL (lockdep_off)
 
void lockdep_on (void)
 
 EXPORT_SYMBOL (lockdep_on)
 
const char__get_key_name (struct lockdep_subclass_key *key, char *str)
 
void get_usage_chars (struct lock_class *class, char usage[LOCK_USAGE_CHARS])
 
void lockdep_trace_alloc (gfp_t gfp_mask)
 
void lockdep_init_map (struct lockdep_map *lock, const char *name, struct lock_class_key *key, int subclass)
 
 EXPORT_SYMBOL_GPL (lockdep_init_map)
 
void lock_set_class (struct lockdep_map *lock, const char *name, struct lock_class_key *key, unsigned int subclass, unsigned long ip)
 
 EXPORT_SYMBOL_GPL (lock_set_class)
 
void lock_acquire (struct lockdep_map *lock, unsigned int subclass, int trylock, int read, int check, struct lockdep_map *nest_lock, unsigned long ip)
 
 EXPORT_SYMBOL_GPL (lock_acquire)
 
void lock_release (struct lockdep_map *lock, int nested, unsigned long ip)
 
 EXPORT_SYMBOL_GPL (lock_release)
 
int lock_is_held (struct lockdep_map *lock)
 
 EXPORT_SYMBOL_GPL (lock_is_held)
 
void lockdep_set_current_reclaim_state (gfp_t gfp_mask)
 
void lockdep_clear_current_reclaim_state (void)
 
void lockdep_reset (void)
 
void lockdep_free_key_range (void *start, unsigned long size)
 
void lockdep_reset_lock (struct lockdep_map *lock)
 
void lockdep_init (void)
 
void __init lockdep_info (void)
 
void debug_check_no_locks_freed (const void *mem_from, unsigned long mem_len)
 
 EXPORT_SYMBOL_GPL (debug_check_no_locks_freed)
 
void debug_check_no_locks_held (struct task_struct *task)
 
void debug_show_all_locks (void)
 
 EXPORT_SYMBOL_GPL (debug_show_all_locks)
 
void debug_show_held_locks (struct task_struct *task)
 
 EXPORT_SYMBOL_GPL (debug_show_held_locks)
 
void lockdep_sys_exit (void)
 
void lockdep_rcu_suspicious (const char *file, const int line, const char *s)
 
 EXPORT_SYMBOL_GPL (lockdep_rcu_suspicious)
 

Variables

unsigned long nr_list_entries
 
unsigned long nr_lock_classes
 
unsigned long nr_stack_trace_entries
 
unsigned int nr_hardirq_chains
 
unsigned int nr_softirq_chains
 
unsigned int nr_process_chains
 
unsigned int max_lockdep_depth
 
struct lock_class_key __lockdep_no_validate__
 

Macro Definition Documentation

#define __chainhashfn (   chain)    hash_long(chain, CHAINHASH_BITS)

Definition at line 303 of file lockdep.c.

#define __classhashfn (   key)    hash_long((unsigned long)key, CLASSHASH_BITS)

Definition at line 292 of file lockdep.c.

#define __USAGE (   __STATE)
Value:
[LOCK_USED_IN_##__STATE] = "IN-"__stringify(__STATE)"-W", \
[LOCK_ENABLED_##__STATE] = __stringify(__STATE)"-ON-W", \
[LOCK_USED_IN_##__STATE##_READ] = "IN-"__stringify(__STATE)"-R",\
[LOCK_ENABLED_##__STATE##_READ] = __stringify(__STATE)"-ON-R",

Definition at line 451 of file lockdep.c.

#define CHAINHASH_BITS   (MAX_LOCKDEP_CHAINS_BITS-1)

Definition at line 301 of file lockdep.c.

#define CHAINHASH_SIZE   (1UL << CHAINHASH_BITS)

Definition at line 302 of file lockdep.c.

#define chainhashentry (   chain)    (chainhash_table + __chainhashfn((chain)))

Definition at line 304 of file lockdep.c.

#define CLASSHASH_BITS   (MAX_LOCKDEP_KEYS_BITS - 1)

Definition at line 290 of file lockdep.c.

#define CLASSHASH_SIZE   (1UL << CLASSHASH_BITS)

Definition at line 291 of file lockdep.c.

#define classhashentry (   key)    (classhash_table + __classhashfn((key)))

Definition at line 293 of file lockdep.c.

#define CREATE_TRACE_POINTS

Definition at line 53 of file lockdep.c.

#define DISABLE_BRANCH_PROFILING

Definition at line 28 of file lockdep.c.

#define HARDIRQ_VERBOSE   0

Definition at line 343 of file lockdep.c.

#define iterate_chain_key (   key1,
  key2 
)
Value:
(((key1) << MAX_LOCKDEP_KEYS_BITS) ^ \
((key1) >> (64-MAX_LOCKDEP_KEYS_BITS)) ^ \
(key2))

Definition at line 314 of file lockdep.c.

#define lock_stat   0

Definition at line 67 of file lockdep.c.

#define LOCKDEP_STATE (   __STATE)    __USAGE(__STATE)
#define LOCKDEP_STATE (   __STATE)
Value:
usage[i++] = get_usage_char(class, LOCK_USED_IN_##__STATE); \
usage[i++] = get_usage_char(class, LOCK_USED_IN_##__STATE##_READ);
#define LOCKDEP_STATE (   __STATE)
Value:
case LOCK_USED_IN_##__STATE: \
case LOCK_USED_IN_##__STATE##_READ: \
case LOCK_ENABLED_##__STATE: \
case LOCK_ENABLED_##__STATE##_READ:
#define prove_locking   0

Definition at line 60 of file lockdep.c.

#define RECLAIM_VERBOSE   0

Definition at line 345 of file lockdep.c.

#define SOFTIRQ_VERBOSE   0

Definition at line 344 of file lockdep.c.

#define VERBOSE   0

Definition at line 335 of file lockdep.c.

#define VERY_VERBOSE   0

Definition at line 336 of file lockdep.c.

Function Documentation

const char* __get_key_name ( struct lockdep_subclass_key *  key,
char str 
)

Definition at line 465 of file lockdep.c.

void debug_check_no_locks_freed ( const void mem_from,
unsigned long  mem_len 
)

Definition at line 4061 of file lockdep.c.

void debug_check_no_locks_held ( struct task_struct task)

Definition at line 4106 of file lockdep.c.

void debug_show_all_locks ( void  )

Definition at line 4112 of file lockdep.c.

void debug_show_held_locks ( struct task_struct task)

Definition at line 4174 of file lockdep.c.

EXPORT_SYMBOL ( lockdep_off  )
EXPORT_SYMBOL ( lockdep_on  )
EXPORT_SYMBOL_GPL ( lockdep_init_map  )
EXPORT_SYMBOL_GPL ( lock_set_class  )
EXPORT_SYMBOL_GPL ( lock_acquire  )
EXPORT_SYMBOL_GPL ( lock_release  )
EXPORT_SYMBOL_GPL ( lock_is_held  )
EXPORT_SYMBOL_GPL ( debug_check_no_locks_freed  )
EXPORT_SYMBOL_GPL ( debug_show_all_locks  )
EXPORT_SYMBOL_GPL ( debug_show_held_locks  )
EXPORT_SYMBOL_GPL ( lockdep_rcu_suspicious  )
void get_usage_chars ( struct lock_class *  class,
char  usage[LOCK_USAGE_CHARS] 
)

Definition at line 490 of file lockdep.c.

LIST_HEAD ( all_lock_classes  )
void lock_acquire ( struct lockdep_map *  lock,
unsigned int  subclass,
int  trylock,
int  read,
int  check,
struct lockdep_map *  nest_lock,
unsigned long  ip 
)

Definition at line 3580 of file lockdep.c.

int lock_is_held ( struct lockdep_map *  lock)

Definition at line 3619 of file lockdep.c.

void lock_release ( struct lockdep_map *  lock,
int  nested,
unsigned long  ip 
)

Definition at line 3601 of file lockdep.c.

void lock_set_class ( struct lockdep_map *  lock,
const char name,
struct lock_class_key key,
unsigned int  subclass,
unsigned long  ip 
)

Definition at line 3557 of file lockdep.c.

void lockdep_clear_current_reclaim_state ( void  )

Definition at line 3644 of file lockdep.c.

void lockdep_free_key_range ( void start,
unsigned long  size 
)

Definition at line 3882 of file lockdep.c.

void __init lockdep_info ( void  )

Definition at line 3989 of file lockdep.c.

void lockdep_init ( void  )

Definition at line 3967 of file lockdep.c.

void lockdep_init_map ( struct lockdep_map *  lock,
const char name,
struct lock_class_key key,
int  subclass 
)

Definition at line 2949 of file lockdep.c.

void lockdep_off ( void  )

Definition at line 319 of file lockdep.c.

void lockdep_on ( void  )

Definition at line 325 of file lockdep.c.

void lockdep_rcu_suspicious ( const char file,
const int  line,
const char s 
)

Definition at line 4202 of file lockdep.c.

void lockdep_reset ( void  )

Definition at line 3837 of file lockdep.c.

void lockdep_reset_lock ( struct lockdep_map *  lock)

Definition at line 3913 of file lockdep.c.

void lockdep_set_current_reclaim_state ( gfp_t  gfp_mask)

Definition at line 3639 of file lockdep.c.

void lockdep_sys_exit ( void  )

Definition at line 4184 of file lockdep.c.

void lockdep_trace_alloc ( gfp_t  gfp_mask)

Definition at line 2873 of file lockdep.c.

Variable Documentation

struct lock_class_key __lockdep_no_validate__

Definition at line 2999 of file lockdep.c.

unsigned int max_lockdep_depth

Definition at line 425 of file lockdep.c.

unsigned int nr_hardirq_chains

Definition at line 422 of file lockdep.c.

unsigned long nr_list_entries

Definition at line 128 of file lockdep.c.

unsigned long nr_lock_classes

Definition at line 137 of file lockdep.c.

unsigned int nr_process_chains

Definition at line 424 of file lockdep.c.

unsigned int nr_softirq_chains

Definition at line 423 of file lockdep.c.

unsigned long nr_stack_trace_entries

Definition at line 380 of file lockdep.c.