#ifndef _LINUX_DEBUGOBJECTS_H #define _LINUX_DEBUGOBJECTS_H #include #include 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 * @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 * @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); 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); int (*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 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_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) { } 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_object_assert_init(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 >x86/retpoline: Make sure there are no unconverted return thunks due to KCSANJosh Poimboeuf1-0/+1 2023-06-25kbuild: Fix CFI failures with GCOVSami Tolvanen1-0/+1 2023-01-13kbuild: Fix CFI hash randomization with KASANSami Tolvanen1-0/+1 2022-09-29kbuild: generate include/generated/compile.h in top MakefileMasahiro Yamada1-7/+1 2022-09-29kbuild: build init/built-in.a just onceMasahiro Yamada1-13/+42 2022-03-11sched/preempt: Tell about PREEMPT_DYNAMIC on kernel headersFrederic Weisbecker1-1/+2 2022-01-08kbuild: do not quote string values in include/config/auto.confMasahiro Yamada1-1/+1 2021-11-11preempt: Restore preemption model selection configsValentin Schneider1-1/+1 2021-05-27init: use $(call cmd,) for generating include/generated/compile.hMasahiro Yamada1-6/+6 2020-07-16md: move the early init autodetect code to drivers/md/Christoph Hellwig1-1/+0 2020-05-12kbuild: use CONFIG_CC_VERSION_TEXT to construct LINUX_COMPILER macroMasahiro Yamada1-1/+1 2020-04-09kbuild: do not pass $(KBUILD_CFLAGS) to scripts/mkcompile_hMasahiro Yamada1-1/+1 2020-04-09kbuild: mkcompile_h: Include $LD version in /proc/versionKees Cook1-1/+1 2019-08-14Kbuild: Handle PREEMPT_RT for version string and magicThomas Gleixner1-2/+3 2018-01-09Construct init thread stack in the linker script rather than by unionDavid Howells1-2/+0 2017-11-02License cleanup: add SPDX GPL-2.0 license identifier to files with no licenseGreg Kroah-Hartman1-0/+1 2016-09-09kbuild: allow archs to select link dead code/data eliminationNicholas Piggin1-0/+2 2012-05-05init_task: Replace CONFIG_HAVE_GENERIC_INIT_TASKThomas Gleixner1-1/+4 2012-05-05init_task: Create generic init_task instanceThomas Gleixner1-0/+1