Release 4.12 include/linux/debugobjects.h
#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
* @astate: current active 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;
unsigned int astate;
void *object;
struct debug_obj_descr *descr;
};
/**
* struct debug_obj_descr - object type specific debug description structure
*
* @name: name of the object typee
* @debug_hint: function returning address, which have associated
* kernel symbol, to allow identify the object
* @is_static_object: return true if the obj is static, otherwise return false
* @fixup_init: fixup function, which is called when the init check
* fails. All fixup functions must return true if fixup
* was successful, otherwise return false
* @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
* @fixup_assert_init: fixup function, which is called when the assert_init
* check fails
*/
struct debug_obj_descr {
const char *name;
void *(*debug_hint)(void *addr);
bool (*is_static_object)(void *addr);
bool (*fixup_init)(void *addr, enum debug_obj_state state);
bool (*fixup_activate)(void *addr, enum debug_obj_state state);
bool (*fixup_destroy)(void *addr, enum debug_obj_state state);
bool (*fixup_free)(void *addr, enum debug_obj_state state);
bool (*fixup_assert_init)(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 int 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_object_assert_init(void *addr, struct debug_obj_descr *descr);
/*
* Active state:
* - Set at 0 upon initialization.
* - Must return to 0 before deactivation.
*/
extern void
debug_object_active_state(void *addr, struct debug_obj_descr *descr,
unsigned int expect, unsigned int next);
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) { }
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Thomas Gleixner | 15 | 100.00% | 1 | 100.00% |
Total | 15 | 100.00% | 1 | 100.00% |
static inline void
debug_object_init_on_stack(void *addr, struct debug_obj_descr *descr) { }
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Thomas Gleixner | 15 | 100.00% | 1 | 100.00% |
Total | 15 | 100.00% | 1 | 100.00% |
static inline int
debug_object_activate (void *addr, struct debug_obj_descr *descr) { return 0; }
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Thomas Gleixner | 13 | 68.42% | 1 | 50.00% |
Paul E. McKenney | 6 | 31.58% | 1 | 50.00% |
Total | 19 | 100.00% | 2 | 100.00% |
static inline void
debug_object_deactivate(void *addr, struct debug_obj_descr *descr) { }
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Thomas Gleixner | 15 | 100.00% | 1 | 100.00% |
Total | 15 | 100.00% | 1 | 100.00% |
static inline void
debug_object_destroy (void *addr, struct debug_obj_descr *descr) { }
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Thomas Gleixner | 15 | 100.00% | 1 | 100.00% |
Total | 15 | 100.00% | 1 | 100.00% |
static inline void
debug_object_free (void *addr, struct debug_obj_descr *descr) { }
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Thomas Gleixner | 15 | 100.00% | 1 | 100.00% |
Total | 15 | 100.00% | 1 | 100.00% |
static inline void
debug_object_assert_init(void *addr, struct debug_obj_descr *descr) { }
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Christine Chan | 15 | 100.00% | 1 | 100.00% |
Total | 15 | 100.00% | 1 | 100.00% |
static inline void debug_objects_early_init(void) { }
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Thomas Gleixner | 8 | 100.00% | 1 | 100.00% |
Total | 8 | 100.00% | 1 | 100.00% |
static inline void debug_objects_mem_init(void) { }
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Thomas Gleixner | 8 | 100.00% | 1 | 100.00% |
Total | 8 | 100.00% | 1 | 100.00% |
#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) { }
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Thomas Gleixner | 15 | 100.00% | 1 | 100.00% |
Total | 15 | 100.00% | 1 | 100.00% |
#endif
#endif
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Thomas Gleixner | 367 | 77.43% | 1 | 12.50% |
Christine Chan | 43 | 9.07% | 1 | 12.50% |
Mathieu Desnoyers | 28 | 5.91% | 1 | 12.50% |
Changbin Du | 16 | 3.38% | 2 | 25.00% |
Stanislaw Gruszka | 12 | 2.53% | 1 | 12.50% |
Paul E. McKenney | 7 | 1.48% | 1 | 12.50% |
Randy Dunlap | 1 | 0.21% | 1 | 12.50% |
Total | 474 | 100.00% | 8 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.