sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget*/translations/zh_CN/core-api/debug-objectsmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/zh_TW/core-api/debug-objectsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/it_IT/core-api/debug-objectsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/ja_JP/core-api/debug-objectsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/ko_KR/core-api/debug-objectsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget*/translations/sp_SP/core-api/debug-objectsmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(h,The object-lifetime debugging infrastructureh]h,The object-lifetime debugging infrastructure}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhD/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects.rsthKubh field_list)}(hhh]hfield)}(hhh](h field_name)}(hAuthorh]hAuthor}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhKubh field_body)}(hThomas Gleixner h]h paragraph)}(hThomas Gleixnerh]hThomas Gleixner}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhubah}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Introductionh]h Introduction}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hwdebugobjects is a generic infrastructure to track the life time of kernel objects and validate the operations on those.h]hwdebugobjects is a generic infrastructure to track the life time of kernel objects and validate the operations on those.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hAdebugobjects is useful to check for the following error patterns:h]hAdebugobjects is useful to check for the following error patterns:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh bullet_list)}(hhh](h list_item)}(h$Activation of uninitialized objects h]h)}(h#Activation of uninitialized objectsh]h#Activation of uninitialized objects}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj-ubah}(h]h ]h"]h$]h&]uh1j+hj(hhhhhNubj,)}(h!Initialization of active objects h]h)}(h Initialization of active objectsh]h Initialization of active objects}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjEubah}(h]h ]h"]h$]h&]uh1j+hj(hhhhhNubj,)}(h!Usage of freed/destroyed objects h]h)}(h Usage of freed/destroyed objectsh]h Usage of freed/destroyed objects}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj]ubah}(h]h ]h"]h$]h&]uh1j+hj(hhhhhNubeh}(h]h ]h"]h$]h&]bullet-uh1j&hhhKhhhhubh)}(hdebugobjects is not changing the data structure of the real object so it can be compiled in with a minimal runtime impact and enabled on demand with a kernel command line option.h]hdebugobjects is not changing the data structure of the real object so it can be compiled in with a minimal runtime impact and enabled on demand with a kernel command line option.}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubeh}(h] introductionah ]h"] introductionah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hHowto use debugobjectsh]hHowto use debugobjects}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hXA kernel subsystem needs to provide a data structure which describes the object type and add calls into the debug code at appropriate places. The data structure to describe the object type needs at minimum the name of the object type. Optional functions can and should be provided to fixup detected problems so the kernel can continue to work and the debug information can be retrieved from a live system instead of hard core debugging with serial consoles and stack trace transcripts from the monitor.h]hXA kernel subsystem needs to provide a data structure which describes the object type and add calls into the debug code at appropriate places. The data structure to describe the object type needs at minimum the name of the object type. Optional functions can and should be provided to fixup detected problems so the kernel can continue to work and the debug information can be retrieved from a live system instead of hard core debugging with serial consoles and stack trace transcripts from the monitor.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h-The debug calls provided by debugobjects are:h]h-The debug calls provided by debugobjects are:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK%hjhhubj')}(hhh](j,)}(hdebug_object_init h]h)}(hdebug_object_inith]hdebug_object_init}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK'hjubah}(h]h ]h"]h$]h&]uh1j+hjhhhhhNubj,)}(hdebug_object_init_on_stack h]h)}(hdebug_object_init_on_stackh]hdebug_object_init_on_stack}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK)hjubah}(h]h ]h"]h$]h&]uh1j+hjhhhhhNubj,)}(hdebug_object_activate h]h)}(hdebug_object_activateh]hdebug_object_activate}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK+hjubah}(h]h ]h"]h$]h&]uh1j+hjhhhhhNubj,)}(hdebug_object_deactivate h]h)}(hdebug_object_deactivateh]hdebug_object_deactivate}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK-hj ubah}(h]h ]h"]h$]h&]uh1j+hjhhhhhNubj,)}(hdebug_object_destroy h]h)}(hdebug_object_destroyh]hdebug_object_destroy}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK/hj#ubah}(h]h ]h"]h$]h&]uh1j+hjhhhhhNubj,)}(hdebug_object_free h]h)}(hdebug_object_freeh]hdebug_object_free}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK1hj;ubah}(h]h ]h"]h$]h&]uh1j+hjhhhhhNubj,)}(hdebug_object_assert_init h]h)}(hdebug_object_assert_inith]hdebug_object_assert_init}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK3hjSubah}(h]h ]h"]h$]h&]uh1j+hjhhhhhNubeh}(h]h ]h"]h$]h&]j{j|uh1j&hhhK'hjhhubh)}(hEach of these functions takes the address of the real object and a pointer to the object type specific debug description structure.h]hEach of these functions takes the address of the real object and a pointer to the object type specific debug description structure.}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK5hjhhubh)}(h|Each detected error is reported in the statistics and a limited number of errors are printk'ed including a full stack trace.h]h~Each detected error is reported in the statistics and a limited number of errors are printk’ed including a full stack trace.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hjhhubh)}(hXThe statistics are available via /sys/kernel/debug/debug_objects/stats. They provide information about the number of warnings and the number of successful fixups along with information about the usage of the internal tracking objects and the state of the internal tracking objects pool.h]hXThe statistics are available via /sys/kernel/debug/debug_objects/stats. They provide information about the number of warnings and the number of successful fixups along with information about the usage of the internal tracking objects and the state of the internal tracking objects pool.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK;hjhhubeh}(h]howto-use-debugobjectsah ]h"]howto use debugobjectsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hDebug functionsh]hDebug functions}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKAubhindex)}(hhh]h}(h]h ]h"]h$]h&]entries](singledebug_object_init (C function)c.debug_object_inithNtauh1jhjhhhNhNubhdesc)}(hhh](hdesc_signature)}(hHvoid debug_object_init (void *addr, const struct debug_obj_descr *descr)h]hdesc_signature_line)}(hGvoid debug_object_init(void *addr, const struct debug_obj_descr *descr)h](hdesc_sig_keyword_type)}(hvoidh]hvoid}(hjhhhNhNubah}(h]h ]ktah"]h$]h&]uh1jhjhhhY/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:67: ./lib/debugobjects.chMubhdesc_sig_space)}(h h]h }(hjhhhNhNubah}(h]h ]wah"]h$]h&]uh1jhjhhhjhMubh desc_name)}(hdebug_object_inith]h desc_sig_name)}(hdebug_object_inith]hdebug_object_init}(hjhhhNhNubah}(h]h ]nah"]h$]h&]uh1jhjubah}(h]h ](sig-namedescnameeh"]h$]h&] xml:spacepreserveuh1jhjhhhjhMubhdesc_parameterlist)}(h1(void *addr, const struct debug_obj_descr *descr)h](hdesc_parameter)}(h void *addrh](j)}(hvoidh]hvoid}(hj&hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj"ubj)}(h h]h }(hj4hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj"ubhdesc_sig_punctuation)}(h*h]h*}(hjDhhhNhNubah}(h]h ]pah"]h$]h&]uh1jBhj"ubj)}(haddrh]haddr}(hjShhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj"ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hjubj!)}(h#const struct debug_obj_descr *descrh](hdesc_sig_keyword)}(hconsth]hconst}(hjnhhhNhNubah}(h]h ]kah"]h$]h&]uh1jlhjhubj)}(h h]h }(hj}hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhubjm)}(hstructh]hstruct}(hjhhhNhNubah}(h]h ]jyah"]h$]h&]uh1jlhjhubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhubh)}(hhh]j)}(hdebug_obj_descrh]hdebug_obj_descr}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomaincreftype identifier reftargetjmodnameN classnameN c:parent_keysphinx.domains.c LookupKey)}data]j ASTIdentifier)}jjsbc.debug_object_initasbuh1hhjhubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhubjC)}(hjFh]h*}(hjhhhNhNubah}(h]h ]jOah"]h$]h&]uh1jBhjhubj)}(hdescrh]hdescr}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjhubeh}(h]h ]h"]h$]h&]noemphjjuh1j hjubeh}(h]h ]h"]h$]h&]jjuh1jhjhhhjhMubeh}(h]h ]h"]h$]h&]jj add_permalinkuh1jsphinx_line_type declaratorhjhhhjhMubah}(h]jah ](sig sig-objecteh"]h$]h&] is_multiline _toc_parts) _toc_namehuh1jhjhMhjhhubh desc_content)}(hhh]h)}(h*debug checks when an object is initializedh]h*debug checks when an object is initialized}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhY/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:67: ./lib/debugobjects.chMhjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhMubeh}(h]h ](jfunctioneh"]h$]h&]domainjobjtypej:desctypej:noindex noindexentrynocontentsentryuh1jhhhjhNhNubh container)}(h**Parameters** ``void *addr`` address of the object ``const struct debug_obj_descr *descr`` pointer to an object specific debug description structureh](h)}(h**Parameters**h]hstrong)}(hjLh]h Parameters}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1jNhjJubah}(h]h ]h"]h$]h&]uh1hhY/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:67: ./lib/debugobjects.chMhjFubhdefinition_list)}(hhh](hdefinition_list_item)}(h%``void *addr`` address of the object h](hterm)}(h``void *addr``h]hliteral)}(hjsh]h void *addr}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1juhjqubah}(h]h ]h"]h$]h&]uh1johY/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:67: ./lib/debugobjects.chMhjkubh definition)}(hhh]h)}(haddress of the objecth]haddress of the object}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjkubeh}(h]h ]h"]h$]h&]uh1jihjhMhjfubjj)}(ha``const struct debug_obj_descr *descr`` pointer to an object specific debug description structureh](jp)}(h'``const struct debug_obj_descr *descr``h]jv)}(hjh]h#const struct debug_obj_descr *descr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1juhjubah}(h]h ]h"]h$]h&]uh1johY/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:67: ./lib/debugobjects.chMhjubj)}(hhh]h)}(h9pointer to an object specific debug description structureh]h9pointer to an object specific debug description structure}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhY/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:67: ./lib/debugobjects.chMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jihjhMhjfubeh}(h]h ]h"]h$]h&]uh1jdhjFubeh}(h]h ] kernelindentah"]h$]h&]uh1jDhjhhhNhNubh)}(hXThis function is called whenever the initialization function of a real object is called.h]hXThis function is called whenever the initialization function of a real object is called.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKFhjhhubh)}(hXWhen the real object is already tracked by debugobjects it is checked, whether the object can be initialized. Initializing is not allowed for active and destroyed objects. When debugobjects detects an error, then it calls the fixup_init function of the object type description structure if provided by the caller. The fixup function can correct the problem before the real initialization of the object happens. E.g. it can deactivate an active object in order to prevent damage to the subsystem.h]hXWhen the real object is already tracked by debugobjects it is checked, whether the object can be initialized. Initializing is not allowed for active and destroyed objects. When debugobjects detects an error, then it calls the fixup_init function of the object type description structure if provided by the caller. The fixup function can correct the problem before the real initialization of the object happens. E.g. it can deactivate an active object in order to prevent damage to the subsystem.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKIhjhhubh)}(hXWhen the real object is not yet tracked by debugobjects, debugobjects allocates a tracker object for the real object and sets the tracker object state to ODEBUG_STATE_INIT. It verifies that the object is not on the callers stack. If it is on the callers stack then a limited number of warnings including a full stack trace is printk'ed. The calling code must use debug_object_init_on_stack() and remove the object before leaving the function which allocated it. See next section.h]hXWhen the real object is not yet tracked by debugobjects, debugobjects allocates a tracker object for the real object and sets the tracker object state to ODEBUG_STATE_INIT. It verifies that the object is not on the callers stack. If it is on the callers stack then a limited number of warnings including a full stack trace is printk’ed. The calling code must use debug_object_init_on_stack() and remove the object before leaving the function which allocated it. See next section.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKRhjhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j'debug_object_init_on_stack (C function)c.debug_object_init_on_stackhNtauh1jhjhhhNhNubj)}(hhh](j)}(hQvoid debug_object_init_on_stack (void *addr, const struct debug_obj_descr *descr)h]j)}(hPvoid debug_object_init_on_stack(void *addr, const struct debug_obj_descr *descr)h](j)}(hvoidh]hvoid}(hj4hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj0hhhY/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:90: ./lib/debugobjects.chMubj)}(h h]h }(hjChhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj0hhhjBhMubj)}(hdebug_object_init_on_stackh]j)}(hdebug_object_init_on_stackh]hdebug_object_init_on_stack}(hjUhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjQubah}(h]h ](jjeh"]h$]h&]jjuh1jhj0hhhjBhMubj)}(h1(void *addr, const struct debug_obj_descr *descr)h](j!)}(h void *addrh](j)}(hvoidh]hvoid}(hjqhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjmubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjmubjC)}(hjFh]h*}(hjhhhNhNubah}(h]h ]jOah"]h$]h&]uh1jBhjmubj)}(haddrh]haddr}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjmubeh}(h]h ]h"]h$]h&]noemphjjuh1j hjiubj!)}(h#const struct debug_obj_descr *descrh](jm)}(hjph]hconst}(hjhhhNhNubah}(h]h ]jyah"]h$]h&]uh1jlhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjm)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jyah"]h$]h&]uh1jlhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j)}(hdebug_obj_descrh]hdebug_obj_descr}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNjj)}j]j)}jjWsbc.debug_object_init_on_stackasbuh1hhjubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjC)}(hjFh]h*}(hjhhhNhNubah}(h]h ]jOah"]h$]h&]uh1jBhjubj)}(hdescrh]hdescr}(hj'hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1j hjiubeh}(h]h ]h"]h$]h&]jjuh1jhj0hhhjBhMubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj,hhhjBhMubah}(h]j'ah ](jjeh"]h$]h&]jj)jhuh1jhjBhMhj)hhubj)}(hhh]h)}(h3debug checks when an object on stack is initializedh]h3debug checks when an object on stack is initialized}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhY/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:90: ./lib/debugobjects.chMhjNhhubah}(h]h ]h"]h$]h&]uh1jhj)hhhjBhMubeh}(h]h ](jfunctioneh"]h$]h&]j>jj?jij@jijAjBjCuh1jhhhjhNhNubjE)}(h**Parameters** ``void *addr`` address of the object ``const struct debug_obj_descr *descr`` pointer to an object specific debug description structureh](h)}(h**Parameters**h]jO)}(hjsh]h Parameters}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1jNhjqubah}(h]h ]h"]h$]h&]uh1hhY/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:90: ./lib/debugobjects.chMhjmubje)}(hhh](jj)}(h%``void *addr`` address of the object h](jp)}(h``void *addr``h]jv)}(hjh]h void *addr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1juhjubah}(h]h ]h"]h$]h&]uh1johY/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:90: ./lib/debugobjects.chMhjubj)}(hhh]h)}(haddress of the objecth]haddress of the object}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jihjhMhjubjj)}(ha``const struct debug_obj_descr *descr`` pointer to an object specific debug description structureh](jp)}(h'``const struct debug_obj_descr *descr``h]jv)}(hjh]h#const struct debug_obj_descr *descr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1juhjubah}(h]h ]h"]h$]h&]uh1johY/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:90: ./lib/debugobjects.chMhjubj)}(hhh]h)}(h9pointer to an object specific debug description structureh]h9pointer to an object specific debug description structure}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhY/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:90: ./lib/debugobjects.chMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jihjhMhjubeh}(h]h ]h"]h$]h&]uh1jdhjmubeh}(h]h ] kernelindentah"]h$]h&]uh1jDhjhhhNhNubh)}(hsThis function is called whenever the initialization function of a real object which resides on the stack is called.h]hsThis function is called whenever the initialization function of a real object which resides on the stack is called.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK]hjhhubh)}(hXWhen the real object is already tracked by debugobjects it is checked, whether the object can be initialized. Initializing is not allowed for active and destroyed objects. When debugobjects detects an error, then it calls the fixup_init function of the object type description structure if provided by the caller. The fixup function can correct the problem before the real initialization of the object happens. E.g. it can deactivate an active object in order to prevent damage to the subsystem.h]hXWhen the real object is already tracked by debugobjects it is checked, whether the object can be initialized. Initializing is not allowed for active and destroyed objects. When debugobjects detects an error, then it calls the fixup_init function of the object type description structure if provided by the caller. The fixup function can correct the problem before the real initialization of the object happens. E.g. it can deactivate an active object in order to prevent damage to the subsystem.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK`hjhhubh)}(hWhen the real object is not yet tracked by debugobjects debugobjects allocates a tracker object for the real object and sets the tracker object state to ODEBUG_STATE_INIT. It verifies that the object is on the callers stack.h]hWhen the real object is not yet tracked by debugobjects debugobjects allocates a tracker object for the real object and sets the tracker object state to ODEBUG_STATE_INIT. It verifies that the object is on the callers stack.}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKihjhhubh)}(hAn object which is on the stack must be removed from the tracker by calling debug_object_free() before the function which allocates the object returns. Otherwise we keep track of stale objects.h]hAn object which is on the stack must be removed from the tracker by calling debug_object_free() before the function which allocates the object returns. Otherwise we keep track of stale objects.}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKnhjhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j"debug_object_activate (C function)c.debug_object_activatehNtauh1jhjhhhNhNubj)}(hhh](j)}(hKint debug_object_activate (void *addr, const struct debug_obj_descr *descr)h]j)}(hJint debug_object_activate(void *addr, const struct debug_obj_descr *descr)h](j)}(hinth]hint}(hj]hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjYhhhZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:114: ./lib/debugobjects.chM$ubj)}(h h]h }(hjlhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjYhhhjkhM$ubj)}(hdebug_object_activateh]j)}(hdebug_object_activateh]hdebug_object_activate}(hj~hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjzubah}(h]h ](jjeh"]h$]h&]jjuh1jhjYhhhjkhM$ubj)}(h1(void *addr, const struct debug_obj_descr *descr)h](j!)}(h void *addrh](j)}(hvoidh]hvoid}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjC)}(hjFh]h*}(hjhhhNhNubah}(h]h ]jOah"]h$]h&]uh1jBhjubj)}(haddrh]haddr}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1j hjubj!)}(h#const struct debug_obj_descr *descrh](jm)}(hjph]hconst}(hjhhhNhNubah}(h]h ]jyah"]h$]h&]uh1jlhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjm)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jyah"]h$]h&]uh1jlhjubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubh)}(hhh]j)}(hdebug_obj_descrh]hdebug_obj_descr}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNjj)}j]j)}jjsbc.debug_object_activateasbuh1hhjubj)}(h h]h }(hj5hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjC)}(hjFh]h*}(hjChhhNhNubah}(h]h ]jOah"]h$]h&]uh1jBhjubj)}(hdescrh]hdescr}(hjPhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1j hjubeh}(h]h ]h"]h$]h&]jjuh1jhjYhhhjkhM$ubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjUhhhjkhM$ubah}(h]jPah ](jjeh"]h$]h&]jj)jhuh1jhjkhM$hjRhhubj)}(hhh]h)}(h(debug checks when an object is activatedh]h(debug checks when an object is activated}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:114: ./lib/debugobjects.chMhjwhhubah}(h]h ]h"]h$]h&]uh1jhjRhhhjkhM$ubeh}(h]h ](jfunctioneh"]h$]h&]j>jj?jj@jjAjBjCuh1jhhhjhNhNubjE)}(h**Parameters** ``void *addr`` address of the object ``const struct debug_obj_descr *descr`` pointer to an object specific debug description structure Returns 0 for success, -EINVAL for check failed.h](h)}(h**Parameters**h]jO)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jNhjubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:114: ./lib/debugobjects.chM#hjubje)}(hhh](jj)}(h%``void *addr`` address of the object h](jp)}(h``void *addr``h]jv)}(hjh]h void *addr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1juhjubah}(h]h ]h"]h$]h&]uh1johZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:114: ./lib/debugobjects.chM hjubj)}(hhh]h)}(haddress of the objecth]haddress of the object}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jihjhM hjubjj)}(h``const struct debug_obj_descr *descr`` pointer to an object specific debug description structure Returns 0 for success, -EINVAL for check failed.h](jp)}(h'``const struct debug_obj_descr *descr``h]jv)}(hjh]h#const struct debug_obj_descr *descr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1juhjubah}(h]h ]h"]h$]h&]uh1johZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:114: ./lib/debugobjects.chM!hjubj)}(hhh]h)}(hjpointer to an object specific debug description structure Returns 0 for success, -EINVAL for check failed.h]hjpointer to an object specific debug description structure Returns 0 for success, -EINVAL for check failed.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hM!hj ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jihj hM!hjubeh}(h]h ]h"]h$]h&]uh1jdhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jDhjhhhNhNubh)}(hTThis function is called whenever the activation function of a real object is called.h]hTThis function is called whenever the activation function of a real object is called.}(hj4 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKuhjhhubh)}(hXWhen the real object is already tracked by debugobjects it is checked, whether the object can be activated. Activating is not allowed for active and destroyed objects. When debugobjects detects an error, then it calls the fixup_activate function of the object type description structure if provided by the caller. The fixup function can correct the problem before the real activation of the object happens. E.g. it can deactivate an active object in order to prevent damage to the subsystem.h]hXWhen the real object is already tracked by debugobjects it is checked, whether the object can be activated. Activating is not allowed for active and destroyed objects. When debugobjects detects an error, then it calls the fixup_activate function of the object type description structure if provided by the caller. The fixup function can correct the problem before the real activation of the object happens. E.g. it can deactivate an active object in order to prevent damage to the subsystem.}(hjB hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKxhjhhubh)}(hXcWhen the real object is not yet tracked by debugobjects then the fixup_activate function is called if available. This is necessary to allow the legitimate activation of statically allocated and initialized objects. The fixup function checks whether the object is valid and calls the debug_objects_init() function to initialize the tracking of this object.h]hXcWhen the real object is not yet tracked by debugobjects then the fixup_activate function is called if available. This is necessary to allow the legitimate activation of statically allocated and initialized objects. The fixup function checks whether the object is valid and calls the debug_objects_init() function to initialize the tracking of this object.}(hjP hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hqWhen the activation is legitimate, then the state of the associated tracker object is set to ODEBUG_STATE_ACTIVE.h]hqWhen the activation is legitimate, then the state of the associated tracker object is set to ODEBUG_STATE_ACTIVE.}(hj^ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j$debug_object_deactivate (C function)c.debug_object_deactivatehNtauh1jhjhhhNhNubj)}(hhh](j)}(hNvoid debug_object_deactivate (void *addr, const struct debug_obj_descr *descr)h]j)}(hMvoid debug_object_deactivate(void *addr, const struct debug_obj_descr *descr)h](j)}(hvoidh]hvoid}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj hhhZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:139: ./lib/debugobjects.chM]ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj hhhj hM]ubj)}(hdebug_object_deactivateh]j)}(hdebug_object_deactivateh]hdebug_object_deactivate}(hj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj ubah}(h]h ](jjeh"]h$]h&]jjuh1jhj hhhj hM]ubj)}(h1(void *addr, const struct debug_obj_descr *descr)h](j!)}(h void *addrh](j)}(hvoidh]hvoid}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubjC)}(hjFh]h*}(hj hhhNhNubah}(h]h ]jOah"]h$]h&]uh1jBhj ubj)}(haddrh]haddr}(hj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj ubj!)}(h#const struct debug_obj_descr *descrh](jm)}(hjph]hconst}(hj hhhNhNubah}(h]h ]jyah"]h$]h&]uh1jlhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubjm)}(hjh]hstruct}(hj hhhNhNubah}(h]h ]jyah"]h$]h&]uh1jlhj ubj)}(h h]h }(hj, hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubh)}(hhh]j)}(hdebug_obj_descrh]hdebug_obj_descr}(hj= hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj: ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj? modnameN classnameNjj)}j]j)}jj sbc.debug_object_deactivateasbuh1hhj ubj)}(h h]h }(hj] hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubjC)}(hjFh]h*}(hjk hhhNhNubah}(h]h ]jOah"]h$]h&]uh1jBhj ubj)}(hdescrh]hdescr}(hjx hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj ubeh}(h]h ]h"]h$]h&]jjuh1jhj hhhj hM]ubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj} hhhj hM]ubah}(h]jx ah ](jjeh"]h$]h&]jj)jhuh1jhj hM]hjz hhubj)}(hhh]h)}(h*debug checks when an object is deactivatedh]h*debug checks when an object is deactivated}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:139: ./lib/debugobjects.chMYhj hhubah}(h]h ]h"]h$]h&]uh1jhjz hhhj hM]ubeh}(h]h ](jfunctioneh"]h$]h&]j>jj?j j@j jAjBjCuh1jhhhjhNhNubjE)}(h**Parameters** ``void *addr`` address of the object ``const struct debug_obj_descr *descr`` pointer to an object specific debug description structureh](h)}(h**Parameters**h]jO)}(hj h]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jNhj ubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:139: ./lib/debugobjects.chM]hj ubje)}(hhh](jj)}(h%``void *addr`` address of the object h](jp)}(h``void *addr``h]jv)}(hj h]h void *addr}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1juhj ubah}(h]h ]h"]h$]h&]uh1johZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:139: ./lib/debugobjects.chMZhj ubj)}(hhh]h)}(haddress of the objecth]haddress of the object}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMZhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jihj hMZhj ubjj)}(ha``const struct debug_obj_descr *descr`` pointer to an object specific debug description structureh](jp)}(h'``const struct debug_obj_descr *descr``h]jv)}(hj h]h#const struct debug_obj_descr *descr}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1juhj ubah}(h]h ]h"]h$]h&]uh1johZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:139: ./lib/debugobjects.chM\hj ubj)}(hhh]h)}(h9pointer to an object specific debug description structureh]h9pointer to an object specific debug description structure}(hj5 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:139: ./lib/debugobjects.chM[hj2 ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jihj1 hM\hj ubeh}(h]h ]h"]h$]h&]uh1jdhj ubeh}(h]h ] kernelindentah"]h$]h&]uh1jDhjhhhNhNubh)}(hVThis function is called whenever the deactivation function of a real object is called.h]hVThis function is called whenever the deactivation function of a real object is called.}(hj] hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hWhen the real object is tracked by debugobjects it is checked, whether the object can be deactivated. Deactivating is not allowed for untracked or destroyed objects.h]hWhen the real object is tracked by debugobjects it is checked, whether the object can be deactivated. Deactivating is not allowed for untracked or destroyed objects.}(hjk hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(huWhen the deactivation is legitimate, then the state of the associated tracker object is set to ODEBUG_STATE_INACTIVE.h]huWhen the deactivation is legitimate, then the state of the associated tracker object is set to ODEBUG_STATE_INACTIVE.}(hjy hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j!debug_object_destroy (C function)c.debug_object_destroyhNtauh1jhjhhhNhNubj)}(hhh](j)}(hKvoid debug_object_destroy (void *addr, const struct debug_obj_descr *descr)h]j)}(hJvoid debug_object_destroy(void *addr, const struct debug_obj_descr *descr)h](j)}(hvoidh]hvoid}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj hhhZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:152: ./lib/debugobjects.chMubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj hhhj hMubj)}(hdebug_object_destroyh]j)}(hdebug_object_destroyh]hdebug_object_destroy}(hj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj ubah}(h]h ](jjeh"]h$]h&]jjuh1jhj hhhj hMubj)}(h1(void *addr, const struct debug_obj_descr *descr)h](j!)}(h void *addrh](j)}(hvoidh]hvoid}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubjC)}(hjFh]h*}(hj hhhNhNubah}(h]h ]jOah"]h$]h&]uh1jBhj ubj)}(haddrh]haddr}(hj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj ubj!)}(h#const struct debug_obj_descr *descrh](jm)}(hjph]hconst}(hj hhhNhNubah}(h]h ]jyah"]h$]h&]uh1jlhj ubj)}(h h]h }(hj, hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubjm)}(hjh]hstruct}(hj: hhhNhNubah}(h]h ]jyah"]h$]h&]uh1jlhj ubj)}(h h]h }(hjG hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubh)}(hhh]j)}(hdebug_obj_descrh]hdebug_obj_descr}(hjX hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjU ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjZ modnameN classnameNjj)}j]j)}jj sbc.debug_object_destroyasbuh1hhj ubj)}(h h]h }(hjx hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubjC)}(hjFh]h*}(hj hhhNhNubah}(h]h ]jOah"]h$]h&]uh1jBhj ubj)}(hdescrh]hdescr}(hj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj ubeh}(h]h ]h"]h$]h&]jjuh1jhj hhhj hMubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj hhhj hMubah}(h]j ah ](jjeh"]h$]h&]jj)jhuh1jhj hMhj hhubj)}(hhh]h)}(h(debug checks when an object is destroyedh]h(debug checks when an object is destroyed}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:152: ./lib/debugobjects.chMhj hhubah}(h]h ]h"]h$]h&]uh1jhj hhhj hMubeh}(h]h ](jfunctioneh"]h$]h&]j>jj?j j@j jAjBjCuh1jhhhjhNhNubjE)}(h**Parameters** ``void *addr`` address of the object ``const struct debug_obj_descr *descr`` pointer to an object specific debug description structureh](h)}(h**Parameters**h]jO)}(hj h]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jNhj ubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:152: ./lib/debugobjects.chMhj ubje)}(hhh](jj)}(h%``void *addr`` address of the object h](jp)}(h``void *addr``h]jv)}(hj h]h void *addr}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1juhj ubah}(h]h ]h"]h$]h&]uh1johZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:152: ./lib/debugobjects.chMhj ubj)}(hhh]h)}(haddress of the objecth]haddress of the object}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jihj hMhj ubjj)}(ha``const struct debug_obj_descr *descr`` pointer to an object specific debug description structureh](jp)}(h'``const struct debug_obj_descr *descr``h]jv)}(hj7 h]h#const struct debug_obj_descr *descr}(hj9 hhhNhNubah}(h]h ]h"]h$]h&]uh1juhj5 ubah}(h]h ]h"]h$]h&]uh1johZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:152: ./lib/debugobjects.chMhj1 ubj)}(hhh]h)}(h9pointer to an object specific debug description structureh]h9pointer to an object specific debug description structure}(hjP hhhNhNubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:152: ./lib/debugobjects.chMhjM ubah}(h]h ]h"]h$]h&]uh1jhj1 ubeh}(h]h ]h"]h$]h&]uh1jihjL hMhj ubeh}(h]h ]h"]h$]h&]uh1jdhj ubeh}(h]h ] kernelindentah"]h$]h&]uh1jDhjhhhNhNubh)}(hThis function is called to mark an object destroyed. This is useful to prevent the usage of invalid objects, which are still available in memory: either statically allocated objects or objects which are freed later.h]hThis function is called to mark an object destroyed. This is useful to prevent the usage of invalid objects, which are still available in memory: either statically allocated objects or objects which are freed later.}(hjx hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXWhen the real object is tracked by debugobjects it is checked, whether the object can be destroyed. Destruction is not allowed for active and destroyed objects. When debugobjects detects an error, then it calls the fixup_destroy function of the object type description structure if provided by the caller. The fixup function can correct the problem before the real destruction of the object happens. E.g. it can deactivate an active object in order to prevent damage to the subsystem.h]hXWhen the real object is tracked by debugobjects it is checked, whether the object can be destroyed. Destruction is not allowed for active and destroyed objects. When debugobjects detects an error, then it calls the fixup_destroy function of the object type description structure if provided by the caller. The fixup function can correct the problem before the real destruction of the object happens. E.g. it can deactivate an active object in order to prevent damage to the subsystem.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(huWhen the destruction is legitimate, then the state of the associated tracker object is set to ODEBUG_STATE_DESTROYED.h]huWhen the destruction is legitimate, then the state of the associated tracker object is set to ODEBUG_STATE_DESTROYED.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jdebug_object_free (C function)c.debug_object_freehNtauh1jhjhhhNhNubj)}(hhh](j)}(hHvoid debug_object_free (void *addr, const struct debug_obj_descr *descr)h]j)}(hGvoid debug_object_free(void *addr, const struct debug_obj_descr *descr)h](j)}(hvoidh]hvoid}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj hhhZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:171: ./lib/debugobjects.chMubj)}(h h]h }(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj hhhj hMubj)}(hdebug_object_freeh]j)}(hdebug_object_freeh]hdebug_object_free}(hj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj ubah}(h]h ](jjeh"]h$]h&]jjuh1jhj hhhj hMubj)}(h1(void *addr, const struct debug_obj_descr *descr)h](j!)}(h void *addrh](j)}(hvoidh]hvoid}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj ubjC)}(hjFh]h*}(hjhhhNhNubah}(h]h ]jOah"]h$]h&]uh1jBhj ubj)}(haddrh]haddr}(hj!hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj ubj!)}(h#const struct debug_obj_descr *descrh](jm)}(hjph]hconst}(hj:hhhNhNubah}(h]h ]jyah"]h$]h&]uh1jlhj6ubj)}(h h]h }(hjGhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj6ubjm)}(hjh]hstruct}(hjUhhhNhNubah}(h]h ]jyah"]h$]h&]uh1jlhj6ubj)}(h h]h }(hjbhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj6ubh)}(hhh]j)}(hdebug_obj_descrh]hdebug_obj_descr}(hjshhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjpubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjumodnameN classnameNjj)}j]j)}jj sbc.debug_object_freeasbuh1hhj6ubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhj6ubjC)}(hjFh]h*}(hjhhhNhNubah}(h]h ]jOah"]h$]h&]uh1jBhj6ubj)}(hdescrh]hdescr}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj6ubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj ubeh}(h]h ]h"]h$]h&]jjuh1jhj hhhj hMubeh}(h]h ]h"]h$]h&]jjjuh1jjjhj hhhj hMubah}(h]j ah ](jjeh"]h$]h&]jj)jhuh1jhj hMhj hhubj)}(hhh]h)}(h$debug checks when an object is freedh]h$debug checks when an object is freed}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:171: ./lib/debugobjects.chMhjhhubah}(h]h ]h"]h$]h&]uh1jhj hhhj hMubeh}(h]h ](jfunctioneh"]h$]h&]j>jj?jj@jjAjBjCuh1jhhhjhNhNubjE)}(h**Parameters** ``void *addr`` address of the object ``const struct debug_obj_descr *descr`` pointer to an object specific debug description structureh](h)}(h**Parameters**h]jO)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jNhjubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:171: ./lib/debugobjects.chMhjubje)}(hhh](jj)}(h%``void *addr`` address of the object h](jp)}(h``void *addr``h]jv)}(hjh]h void *addr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1juhjubah}(h]h ]h"]h$]h&]uh1johZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:171: ./lib/debugobjects.chMhjubj)}(hhh]h)}(haddress of the objecth]haddress of the object}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj.hMhj/ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jihj.hMhjubjj)}(ha``const struct debug_obj_descr *descr`` pointer to an object specific debug description structureh](jp)}(h'``const struct debug_obj_descr *descr``h]jv)}(hjRh]h#const struct debug_obj_descr *descr}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1juhjPubah}(h]h ]h"]h$]h&]uh1johZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:171: ./lib/debugobjects.chMhjLubj)}(hhh]h)}(h9pointer to an object specific debug description structureh]h9pointer to an object specific debug description structure}(hjkhhhNhNubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:171: ./lib/debugobjects.chMhjhubah}(h]h ]h"]h$]h&]uh1jhjLubeh}(h]h ]h"]h$]h&]uh1jihjghMhjubeh}(h]h ]h"]h$]h&]uh1jdhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jDhjhhhNhNubh)}(h2This function is called before an object is freed.h]h2This function is called before an object is freed.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXWhen the real object is tracked by debugobjects it is checked, whether the object can be freed. Free is not allowed for active objects. When debugobjects detects an error, then it calls the fixup_free function of the object type description structure if provided by the caller. The fixup function can correct the problem before the real free of the object happens. E.g. it can deactivate an active object in order to prevent damage to the subsystem.h]hXWhen the real object is tracked by debugobjects it is checked, whether the object can be freed. Free is not allowed for active objects. When debugobjects detects an error, then it calls the fixup_free function of the object type description structure if provided by the caller. The fixup function can correct the problem before the real free of the object happens. E.g. it can deactivate an active object in order to prevent damage to the subsystem.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hNote that debug_object_free removes the object from the tracker. Later usage of the object is detected by the other debug checks.h]hNote that debug_object_free removes the object from the tracker. Later usage of the object is detected by the other debug checks.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j%debug_object_assert_init (C function)c.debug_object_assert_inithNtauh1jhjhhhNhNubj)}(hhh](j)}(hOvoid debug_object_assert_init (void *addr, const struct debug_obj_descr *descr)h]j)}(hNvoid debug_object_assert_init(void *addr, const struct debug_obj_descr *descr)h](j)}(hvoidh]hvoid}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:188: ./lib/debugobjects.chMubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhjhMubj)}(hdebug_object_assert_inith]j)}(hdebug_object_assert_inith]hdebug_object_assert_init}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]jjuh1jhjhhhjhMubj)}(h1(void *addr, const struct debug_obj_descr *descr)h](j!)}(h void *addrh](j)}(hvoidh]hvoid}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj)}(h h]h }(hj!hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubjC)}(hjFh]h*}(hj/hhhNhNubah}(h]h ]jOah"]h$]h&]uh1jBhjubj)}(haddrh]haddr}(hj<hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj ubj!)}(h#const struct debug_obj_descr *descrh](jm)}(hjph]hconst}(hjUhhhNhNubah}(h]h ]jyah"]h$]h&]uh1jlhjQubj)}(h h]h }(hjbhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjQubjm)}(hjh]hstruct}(hjphhhNhNubah}(h]h ]jyah"]h$]h&]uh1jlhjQubj)}(h h]h }(hj}hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjQubh)}(hhh]j)}(hdebug_obj_descrh]hdebug_obj_descr}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNjj)}j]j)}jjsbc.debug_object_assert_initasbuh1hhjQubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjQubjC)}(hjFh]h*}(hjhhhNhNubah}(h]h ]jOah"]h$]h&]uh1jBhjQubj)}(hdescrh]hdescr}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjQubeh}(h]h ]h"]h$]h&]noemphjjuh1j hj ubeh}(h]h ]h"]h$]h&]jjuh1jhjhhhjhMubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjhhhjhMubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jhjhMhjhhubj)}(hhh]h)}(h*debug checks when object should be init-edh]h*debug checks when object should be init-ed}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:188: ./lib/debugobjects.chMhjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhMubeh}(h]h ](jfunctioneh"]h$]h&]j>jj?j j@j jAjBjCuh1jhhhjhNhNubjE)}(h**Parameters** ``void *addr`` address of the object ``const struct debug_obj_descr *descr`` pointer to an object specific debug description structureh](h)}(h**Parameters**h]jO)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jNhjubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:188: ./lib/debugobjects.chMhjubje)}(hhh](jj)}(h%``void *addr`` address of the object h](jp)}(h``void *addr``h]jv)}(hj4h]h void *addr}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1juhj2ubah}(h]h ]h"]h$]h&]uh1johZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:188: ./lib/debugobjects.chMhj.ubj)}(hhh]h)}(haddress of the objecth]haddress of the object}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjIhMhjJubah}(h]h ]h"]h$]h&]uh1jhj.ubeh}(h]h ]h"]h$]h&]uh1jihjIhMhj+ubjj)}(ha``const struct debug_obj_descr *descr`` pointer to an object specific debug description structureh](jp)}(h'``const struct debug_obj_descr *descr``h]jv)}(hjmh]h#const struct debug_obj_descr *descr}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1juhjkubah}(h]h ]h"]h$]h&]uh1johZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:188: ./lib/debugobjects.chMhjgubj)}(hhh]h)}(h9pointer to an object specific debug description structureh]h9pointer to an object specific debug description structure}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhZ/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:188: ./lib/debugobjects.chMhjubah}(h]h ]h"]h$]h&]uh1jhjgubeh}(h]h ]h"]h$]h&]uh1jihjhMhj+ubeh}(h]h ]h"]h$]h&]uh1jdhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jDhjhhhNhNubh)}(hFThis function is called to assert that an object has been initialized.h]hFThis function is called to assert that an object has been initialized.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hX9When the real object is not tracked by debugobjects, it calls fixup_assert_init of the object type description structure provided by the caller, with the hardcoded object state ODEBUG_NOT_AVAILABLE. The fixup function can correct the problem by calling debug_object_init and other specific initializing functions.h]hX9When the real object is not tracked by debugobjects, it calls fixup_assert_init of the object type description structure provided by the caller, with the hardcoded object state ODEBUG_NOT_AVAILABLE. The fixup function can correct the problem by calling debug_object_init and other specific initializing functions.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hFWhen the real object is already tracked by debugobjects it is ignored.h]hFWhen the real object is already tracked by debugobjects it is ignored.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]debug-functionsah ]h"]debug functionsah$]h&]uh1hhhhhhhhKAubh)}(hhh](h)}(hFixup functionsh]hFixup functions}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(h'Debug object type description structureh]h'Debug object type description structure}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jdebug_obj (C struct) c.debug_objhNtauh1jhjhhhNhNubj)}(hhh](j)}(h debug_objh]j)}(hstruct debug_objh](jm)}(hjh]hstruct}(hjhhhNhNubah}(h]h ]jyah"]h$]h&]uh1jlhjhhhd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhKubj)}(h h]h }(hj)hhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjhhhj(hKubj)}(h debug_objh]j)}(hjh]h debug_obj}(hj;hhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhj7ubah}(h]h ](jjeh"]h$]h&]jjuh1jhjhhhj(hKubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjhhhj(hKubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1jhj(hKhjhhubj)}(hhh]h)}(h#representation of an tracked objecth]h#representation of an tracked object}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhKhjZhhubah}(h]h ]h"]h$]h&]uh1jhjhhhj(hKubeh}(h]h ](jstructeh"]h$]h&]j>jj?juj@jujAjBjCuh1jhhhjhNhNubjE)}(hX**Definition**:: struct debug_obj { struct hlist_node node; enum debug_obj_state state; unsigned int astate; union { void *object; struct hlist_node *batch_last; }; const struct debug_obj_descr *descr; }; **Members** ``node`` hlist node to link the object into the tracker list ``state`` tracked object state ``astate`` current active state ``{unnamed_union}`` anonymous ``object`` pointer to the real object ``batch_last`` pointer to the last hlist node in a batch ``descr`` pointer to an object type specific debug description structureh](h)}(h**Definition**::h](jO)}(h**Definition**h]h Definition}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jNhj}ubh:}(hj}hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhKhjyubh literal_block)}(hXstruct debug_obj { struct hlist_node node; enum debug_obj_state state; unsigned int astate; union { void *object; struct hlist_node *batch_last; }; const struct debug_obj_descr *descr; };h]hXstruct debug_obj { struct hlist_node node; enum debug_obj_state state; unsigned int astate; union { void *object; struct hlist_node *batch_last; }; const struct debug_obj_descr *descr; };}hjsbah}(h]h ]h"]h$]h&]jjuh1jhd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhKhjyubh)}(h **Members**h]jO)}(hjh]hMembers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jNhjubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hKthK&hjyubje)}(hhh](jj)}(h=``node`` hlist node to link the object into the tracker list h](jp)}(h``node``h]jv)}(hjh]hnode}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1juhjubah}(h]h ]h"]h$]h&]uh1johd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhKhjubj)}(hhh]h)}(h3hlist node to link the object into the tracker listh]h3hlist node to link the object into the tracker list}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jihjhKhjubjj)}(h``state`` tracked object state h](jp)}(h ``state``h]jv)}(hjh]hstate}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1juhjubah}(h]h ]h"]h$]h&]uh1johd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhKhjubj)}(hhh]h)}(htracked object stateh]htracked object state}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jihjhKhjubjj)}(h ``astate`` current active state h](jp)}(h ``astate``h]jv)}(hj>h]hastate}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1juhj<ubah}(h]h ]h"]h$]h&]uh1johd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhKhj8ubj)}(hhh]h)}(hcurrent active stateh]hcurrent active state}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjShKhjTubah}(h]h ]h"]h$]h&]uh1jhj8ubeh}(h]h ]h"]h$]h&]uh1jihjShKhjubjj)}(h``{unnamed_union}`` anonymous h](jp)}(h``{unnamed_union}``h]jv)}(hjwh]h{unnamed_union}}(hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1juhjuubah}(h]h ]h"]h$]h&]uh1johd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhKhjqubj)}(hhh]h)}(h anonymoush]h anonymous}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjqubeh}(h]h ]h"]h$]h&]uh1jihjhKhjubjj)}(h&``object`` pointer to the real object h](jp)}(h ``object``h]jv)}(hjh]hobject}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1juhjubah}(h]h ]h"]h$]h&]uh1johd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhKhjubj)}(hhh]h)}(hpointer to the real objecth]hpointer to the real object}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jihjhKhjubjj)}(h9``batch_last`` pointer to the last hlist node in a batch h](jp)}(h``batch_last``h]jv)}(hjh]h batch_last}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1juhjubah}(h]h ]h"]h$]h&]uh1johd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhKhjubj)}(hhh]h)}(h)pointer to the last hlist node in a batchh]h)pointer to the last hlist node in a batch}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jihjhKhjubjj)}(hH``descr`` pointer to an object type specific debug description structureh](jp)}(h ``descr``h]jv)}(hj"h]hdescr}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1juhj ubah}(h]h ]h"]h$]h&]uh1johd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhKhjubj)}(hhh]h)}(h>pointer to an object type specific debug description structureh]h>pointer to an object type specific debug description structure}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhKhj8ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jihj7hKhjubeh}(h]h ]h"]h$]h&]uh1jdhjyubeh}(h]h ] kernelindentah"]h$]h&]uh1jDhjhhhNhNubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jdebug_obj_descr (C struct)c.debug_obj_descrhNtauh1jhjhhhNhNubj)}(hhh](j)}(hdebug_obj_descrh]j)}(hstruct debug_obj_descrh](jm)}(hjh]hstruct}(hj|hhhNhNubah}(h]h ]jyah"]h$]h&]uh1jlhjxhhhd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhK"ubj)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjxhhhjhK"ubj)}(hdebug_obj_descrh]j)}(hjvh]hdebug_obj_descr}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1jhjubah}(h]h ](jjeh"]h$]h&]jjuh1jhjxhhhjhK"ubeh}(h]h ]h"]h$]h&]jjjuh1jjjhjthhhjhK"ubah}(h]joah ](jjeh"]h$]h&]jj)jhuh1jhjhK"hjqhhubj)}(hhh]h)}(h0object type specific debug description structureh]h0object type specific debug description structure}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhK)hjhhubah}(h]h ]h"]h$]h&]uh1jhjqhhhjhK"ubeh}(h]h ](jstructeh"]h$]h&]j>jj?jj@jjAjBjCuh1jhhhjhNhNubjE)}(hX**Definition**:: 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); }; **Members** ``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 failsh](h)}(h**Definition**::h](jO)}(h**Definition**h]h Definition}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jNhjubh:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhK-hjubj)}(hXstruct 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); };h]hXstruct 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); };}hjsbah}(h]h ]h"]h$]h&]jjuh1jhd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhK/hjubh)}(h **Members**h]jO)}(hj h]hMembers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jNhj ubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhK:hjubje)}(hhh](jj)}(h"``name`` name of the object typee h](jp)}(h``name``h]jv)}(hj+h]hname}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1juhj)ubah}(h]h ]h"]h$]h&]uh1johd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhK,hj%ubj)}(hhh]h)}(hname of the object typeeh]hname of the object typee}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj@hK,hjAubah}(h]h ]h"]h$]h&]uh1jhj%ubeh}(h]h ]h"]h$]h&]uh1jihj@hK,hj"ubjj)}(hm``debug_hint`` function returning address, which have associated kernel symbol, to allow identify the object h](jp)}(h``debug_hint``h]jv)}(hjdh]h debug_hint}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1juhjbubah}(h]h ]h"]h$]h&]uh1johd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhK.hj^ubj)}(hhh]h)}(h]function returning address, which have associated kernel symbol, to allow identify the objecth]h]function returning address, which have associated kernel symbol, to allow identify the object}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhK-hjzubah}(h]h ]h"]h$]h&]uh1jhj^ubeh}(h]h ]h"]h$]h&]uh1jihjyhK.hj"ubjj)}(hN``is_static_object`` return true if the obj is static, otherwise return false h](jp)}(h``is_static_object``h]jv)}(hjh]his_static_object}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1juhjubah}(h]h ]h"]h$]h&]uh1johd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhK/hjubj)}(hhh]h)}(h8return true if the obj is static, otherwise return falseh]h8return true if the obj is static, otherwise return false}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK/hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jihjhK/hj"ubjj)}(h``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 h](jp)}(h``fixup_init``h]jv)}(hjh]h fixup_init}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1juhjubah}(h]h ]h"]h$]h&]uh1johd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhK2hjubj)}(hhh]h)}(hfixup function, which is called when the init check fails. All fixup functions must return true if fixup was successful, otherwise return falseh]hfixup function, which is called when the init check fails. All fixup functions must return true if fixup was successful, otherwise return false}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhK0hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jihjhK2hj"ubjj)}(hQ``fixup_activate`` fixup function, which is called when the activate check fails h](jp)}(h``fixup_activate``h]jv)}(hjh]hfixup_activate}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1juhjubah}(h]h ]h"]h$]h&]uh1johd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhK4hj ubj)}(hhh]h)}(h=fixup function, which is called when the activate check failsh]h=fixup function, which is called when the activate check fails}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhK3hj'ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jihj&hK4hj"ubjj)}(hO``fixup_destroy`` fixup function, which is called when the destroy check fails h](jp)}(h``fixup_destroy``h]jv)}(hjKh]h fixup_destroy}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1juhjIubah}(h]h ]h"]h$]h&]uh1johd/var/lib/git/docbuild/linux/Documentation/core-api/debug-objects:207: ./include/linux/debugobjects.hhK6hjEubj)}(hhh]h)}(hhhhhhNubah}(h]h ]h"]h$]h&]j{j|uh1j&hhhMhjhhubh)}(h|The function returns true when the fixup was successful, otherwise false. The return value is used to update the statistics.h]h|The function returns true when the fixup was successful, otherwise false. The return value is used to update the statistics.}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjhhubeh}(h] fixup-destroyah ]h"] fixup_destroyah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(h fixup_freeh]h fixup_free}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjuhhhhhMubh)}(hThis function is called from the debug code whenever a problem in debug_object_free is detected. Further it can be called from the debug checks in kfree/vfree, when an active object is detected from the debug_check_no_obj_freed() sanity checks.h]hThis function is called from the debug code whenever a problem in debug_object_free is detected. Further it can be called from the debug checks in kfree/vfree, when an active object is detected from the debug_check_no_obj_freed() sanity checks.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjuhhubh)}(hWCalled from debug_object_free() or debug_check_no_obj_freed() when the object state is:h]hWCalled from debug_object_free() or debug_check_no_obj_freed() when the object state is:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjuhhubj')}(hhh]j,)}(hODEBUG_STATE_ACTIVE h]h)}(hODEBUG_STATE_ACTIVEh]hODEBUG_STATE_ACTIVE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j+hjhhhhhNubah}(h]h ]h"]h$]h&]j{j|uh1j&hhhMhjuhhubh)}(h|The function returns true when the fixup was successful, otherwise false. The return value is used to update the statistics.h]h|The function returns true when the fixup was successful, otherwise false. The return value is used to update the statistics.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjuhhubeh}(h] fixup-freeah ]h"] fixup_freeah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hfixup_assert_inith]hfixup_assert_init}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hgThis function is called from the debug code whenever a problem in debug_object_assert_init is detected.h]hgThis function is called from the debug code whenever a problem in debug_object_assert_init is detected.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjhhubh)}(hCalled from debug_object_assert_init() with a hardcoded state ODEBUG_STATE_NOTAVAILABLE when the object is not found in the debug bucket.h]hCalled from debug_object_assert_init() with a hardcoded state ODEBUG_STATE_NOTAVAILABLE when the object is not found in the debug bucket.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM#hjhhubh)}(h|The function returns true when the fixup was successful, otherwise false. The return value is used to update the statistics.h]h|The function returns true when the fixup was successful, otherwise false. The return value is used to update the statistics.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM'hjhhubh)}(hTNote, this function should make sure debug_object_init() is called before returning.h]hTNote, this function should make sure debug_object_init() is called before returning.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM*hjhhubh)}(hXQThe handling of statically initialized objects is a special case. The fixup function should check if this is a legitimate case of a statically initialized object or not. In this case only debug_object_init() should be called to make the object known to the tracker. Then the function should return false because this is not a real fixup.h]hXQThe handling of statically initialized objects is a special case. The fixup function should check if this is a legitimate case of a statically initialized object or not. In this case only debug_object_init() should be called to make the object known to the tracker. Then the function should return false because this is not a real fixup.}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM-hjhhubeh}(h]fixup-assert-initah ]h"]fixup_assert_initah$]h&]uh1hhjhhhhhMubeh}(h]fixup-functionsah ]h"]fixup functionsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hKnown Bugs And Assumptionsh]hKnown Bugs And Assumptions}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhj@hhhhhM4ubh)}(hNone (knock on wood).h]hNone (knock on wood).}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM6hj@hhubeh}(h]known-bugs-and-assumptionsah ]h"]known bugs and assumptionsah$]h&]uh1hhhhhhhhM4ubeh}(h],the-object-lifetime-debugging-infrastructureah ]h"],the object-lifetime debugging infrastructureah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jljijjjjjjj=j:jjjvjsjj jrjojjj5j2jdjau nametypes}(jljjjj=jjvjjrjj5jduh}(jihjhjjjjjjj'j,jPjUjx j} j j j j jjj:jjjjjjojtjsjj jyjojjjuj2jjaj@u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.