-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 95290 b: refs/heads/master c: 3ac7fe5 h: refs/heads/master v: v3
- Loading branch information
Thomas Gleixner
authored and
Linus Torvalds
committed
Apr 30, 2008
1 parent
82aaffe
commit e2e73e1
Showing
11 changed files
with
1,031 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 30327acf7846c5eb97c8e31c78317a2918d3e515 | ||
refs/heads/master: 3ac7fe5a4aab409bd5674d0b070bce97f9d20872 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
#ifndef _LINUX_DEBUGOBJECTS_H | ||
#define _LINUX_DEBUGOBJECTS_H | ||
|
||
#include <linux/list.h> | ||
#include <linux/spinlock.h> | ||
|
||
enum debug_obj_state { | ||
ODEBUG_STATE_NONE, | ||
ODEBUG_STATE_INIT, | ||
ODEBUG_STATE_INACTIVE, | ||
ODEBUG_STATE_ACTIVE, | ||
ODEBUG_STATE_DESTROYED, | ||
ODEBUG_STATE_NOTAVAILABLE, | ||
ODEBUG_STATE_MAX, | ||
}; | ||
|
||
struct debug_obj_descr; | ||
|
||
/** | ||
* struct debug_obj - representaion of an tracked object | ||
* @node: hlist node to link the object into the tracker list | ||
* @state: tracked object state | ||
* @object: pointer to the real object | ||
* @descr: pointer to an object type specific debug description structure | ||
*/ | ||
struct debug_obj { | ||
struct hlist_node node; | ||
enum debug_obj_state state; | ||
void *object; | ||
struct debug_obj_descr *descr; | ||
}; | ||
|
||
/** | ||
* struct debug_obj_descr - object type specific debug description structure | ||
* @name: name of the object typee | ||
* @fixup_init: fixup function, which is called when the init check | ||
* fails | ||
* @fixup_activate: fixup function, which is called when the activate check | ||
* fails | ||
* @fixup_destroy: fixup function, which is called when the destroy check | ||
* fails | ||
* @fixup_free: fixup function, which is called when the free check | ||
* fails | ||
*/ | ||
struct debug_obj_descr { | ||
const char *name; | ||
|
||
int (*fixup_init) (void *addr, enum debug_obj_state state); | ||
int (*fixup_activate) (void *addr, enum debug_obj_state state); | ||
int (*fixup_destroy) (void *addr, enum debug_obj_state state); | ||
int (*fixup_free) (void *addr, enum debug_obj_state state); | ||
}; | ||
|
||
#ifdef CONFIG_DEBUG_OBJECTS | ||
extern void debug_object_init (void *addr, struct debug_obj_descr *descr); | ||
extern void | ||
debug_object_init_on_stack(void *addr, struct debug_obj_descr *descr); | ||
extern void debug_object_activate (void *addr, struct debug_obj_descr *descr); | ||
extern void debug_object_deactivate(void *addr, struct debug_obj_descr *descr); | ||
extern void debug_object_destroy (void *addr, struct debug_obj_descr *descr); | ||
extern void debug_object_free (void *addr, struct debug_obj_descr *descr); | ||
|
||
extern void debug_objects_early_init(void); | ||
extern void debug_objects_mem_init(void); | ||
#else | ||
static inline void | ||
debug_object_init (void *addr, struct debug_obj_descr *descr) { } | ||
static inline void | ||
debug_object_init_on_stack(void *addr, struct debug_obj_descr *descr) { } | ||
static inline void | ||
debug_object_activate (void *addr, struct debug_obj_descr *descr) { } | ||
static inline void | ||
debug_object_deactivate(void *addr, struct debug_obj_descr *descr) { } | ||
static inline void | ||
debug_object_destroy (void *addr, struct debug_obj_descr *descr) { } | ||
static inline void | ||
debug_object_free (void *addr, struct debug_obj_descr *descr) { } | ||
|
||
static inline void debug_objects_early_init(void) { } | ||
static inline void debug_objects_mem_init(void) { } | ||
#endif | ||
|
||
#ifdef CONFIG_DEBUG_OBJECTS_FREE | ||
extern void debug_check_no_obj_freed(const void *address, unsigned long size); | ||
#else | ||
static inline void | ||
debug_check_no_obj_freed(const void *address, unsigned long size) { } | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.