€•Õ¡Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ;/translations/zh_CN/dev-tools/kunit/api/functionredirection”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ;/translations/zh_TW/dev-tools/kunit/api/functionredirection”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ;/translations/it_IT/dev-tools/kunit/api/functionredirection”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ;/translations/ja_JP/dev-tools/kunit/api/functionredirection”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ;/translations/ko_KR/dev-tools/kunit/api/functionredirection”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ;/translations/pt_BR/dev-tools/kunit/api/functionredirection”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ;/translations/sp_SP/dev-tools/kunit/api/functionredirection”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³ŒU/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection.rst”h´KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒFunction Redirection API”h]”hŒFunction Redirection API”…””}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒOverview”h]”hŒOverview”…””}”(hhàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÝh²hh³hÇh´KubhŒ paragraph”“”)”}”(hX´When writing unit tests, it's important to be able to isolate the code being tested from other parts of the kernel. This ensures the reliability of the test (it won't be affected by external factors), reduces dependencies on specific hardware or config options (making the test easier to run), and protects the stability of the rest of the system (making it less likely for test-specific state to interfere with the rest of the system).”h]”hX¸When writing unit tests, it’s important to be able to isolate the code being tested from other parts of the kernel. This ensures the reliability of the test (it won’t be affected by external factors), reduces dependencies on specific hardware or config options (making the test easier to run), and protects the stability of the rest of the system (making it less likely for test-specific state to interfere with the rest of the system).”…””}”(hhðh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K hhÝh²hubhï)”}”(hŒèWhile for some code (typically generic data structures, helpers, and other "pure functions") this is trivial, for others (like device drivers, filesystems, core subsystems) the code is heavily coupled with other parts of the kernel.”h]”hŒìWhile for some code (typically generic data structures, helpers, and other “pure functionsâ€) this is trivial, for others (like device drivers, filesystems, core subsystems) the code is heavily coupled with other parts of the kernel.”…””}”(hhþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KhhÝh²hubhï)”}”(hX5This coupling is often due to global state in some way: be it a global list of devices, the filesystem, or some hardware state. Tests need to either carefully manage, isolate, and restore state, or they can avoid it altogether by replacing access to and mutation of this state with a "fake" or "mock" variant.”h]”hX=This coupling is often due to global state in some way: be it a global list of devices, the filesystem, or some hardware state. Tests need to either carefully manage, isolate, and restore state, or they can avoid it altogether by replacing access to and mutation of this state with a “fake†or “mock†variant.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KhhÝh²hubhï)”}”(hXBy refactoring access to such state, such as by introducing a layer of indirection which can use or emulate a separate set of test state. However, such refactoring comes with its own costs (and undertaking significant refactoring before being able to write tests is suboptimal).”h]”hXBy refactoring access to such state, such as by introducing a layer of indirection which can use or emulate a separate set of test state. However, such refactoring comes with its own costs (and undertaking significant refactoring before being able to write tests is suboptimal).”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KhhÝh²hubhï)”}”(hŒrA simpler way to intercept and replace some of the function calls is to use function redirection via static stubs.”h]”hŒrA simpler way to intercept and replace some of the function calls is to use function redirection via static stubs.”…””}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K hhÝh²hubeh}”(h]”Œoverview”ah ]”h"]”Œoverview”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒ Static Stubs”h]”hŒ Static Stubs”…””}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj>h²hh³hÇh´K%ubhï)”}”(hŒƒStatic stubs are a way of redirecting calls to one function (the "real" function) to another function (the "replacement" function).”h]”hŒ‹Static stubs are a way of redirecting calls to one function (the “real†function) to another function (the “replacement†function).”…””}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K'hj>h²hubhï)”}”(hŒÀIt works by adding a macro to the "real" function which checks to see if a test is running, and if a replacement function is available. If so, that function is called in place of the original.”h]”hŒÄIt works by adding a macro to the “real†function which checks to see if a test is running, and if a replacement function is available. If so, that function is called in place of the original.”…””}”(hj]h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K*hj>h²hubhï)”}”(hŒ-Using static stubs is pretty straightforward:”h]”hŒ-Using static stubs is pretty straightforward:”…””}”(hjkh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K.hj>h²hubhŒenumerated_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hXîAdd the KUNIT_STATIC_STUB_REDIRECT() macro to the start of the "real" function. This should be the first statement in the function, after any variable declarations. KUNIT_STATIC_STUB_REDIRECT() takes the name of the function, followed by all of the arguments passed to the real function. For example: .. code-block:: c void send_data_to_hardware(const char *str) { KUNIT_STATIC_STUB_REDIRECT(send_data_to_hardware, str); /* real implementation */ } ”h]”(hï)”}”(hŒOAdd the KUNIT_STATIC_STUB_REDIRECT() macro to the start of the "real" function.”h]”hŒSAdd the KUNIT_STATIC_STUB_REDIRECT() macro to the start of the “real†function.”…””}”(hj„h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K0hj€ubhï)”}”(hŒÏThis should be the first statement in the function, after any variable declarations. KUNIT_STATIC_STUB_REDIRECT() takes the name of the function, followed by all of the arguments passed to the real function.”h]”hŒÏThis should be the first statement in the function, after any variable declarations. KUNIT_STATIC_STUB_REDIRECT() takes the name of the function, followed by all of the arguments passed to the real function.”…””}”(hj’h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K3hj€ubhï)”}”(hŒ For example:”h]”hŒ For example:”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K7hj€ubhŒ literal_block”“”)”}”(hŒ‘void send_data_to_hardware(const char *str) { KUNIT_STATIC_STUB_REDIRECT(send_data_to_hardware, str); /* real implementation */ }”h]”hŒ‘void send_data_to_hardware(const char *str) { KUNIT_STATIC_STUB_REDIRECT(send_data_to_hardware, str); /* real implementation */ }”…””}”hj°sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆŒforce”‰Œlanguage”Œc”Œhighlight_args”}”uh1j®h³hÇh´K9hj€ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j~hj{h²hh³Nh´Nubj)”}”(hX<Write one or more replacement functions. These functions should have the same function signature as the real function. In the event they need to access or modify test-specific state, they can use kunit_get_current_test() to get a struct kunit pointer. This can then be passed to the expectation/assertion macros, or used to look up KUnit resources. For example: .. code-block:: c void fake_send_data_to_hardware(const char *str) { struct kunit *test = kunit_get_current_test(); KUNIT_EXPECT_STREQ(test, str, "Hello World!"); } ”h]”(hï)”}”(hŒ(Write one or more replacement functions.”h]”hŒ(Write one or more replacement functions.”…””}”(hjÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KAhjÉubhï)”}”(hX3These functions should have the same function signature as the real function. In the event they need to access or modify test-specific state, they can use kunit_get_current_test() to get a struct kunit pointer. This can then be passed to the expectation/assertion macros, or used to look up KUnit resources.”h]”hX3These functions should have the same function signature as the real function. In the event they need to access or modify test-specific state, they can use kunit_get_current_test() to get a struct kunit pointer. This can then be passed to the expectation/assertion macros, or used to look up KUnit resources.”…””}”(hjÛh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KChjÉubhï)”}”(hŒ For example:”h]”hŒ For example:”…””}”(hjéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KIhjÉubj¯)”}”(hŒ¢void fake_send_data_to_hardware(const char *str) { struct kunit *test = kunit_get_current_test(); KUNIT_EXPECT_STREQ(test, str, "Hello World!"); }”h]”hŒ¢void fake_send_data_to_hardware(const char *str) { struct kunit *test = kunit_get_current_test(); KUNIT_EXPECT_STREQ(test, str, "Hello World!"); }”…””}”hj÷sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆj¾‰j¿jÀjÁ}”uh1j®h³hÇh´KKhjÉubeh}”(h]”h ]”h"]”h$]”h&]”uh1j~hj{h²hh³Nh´Nubj)”}”(hXActivate the static stub from your test. From within a test, the redirection can be enabled with kunit_activate_static_stub(), which accepts a struct kunit pointer, the real function, and the replacement function. You can call this several times with different replacement functions to swap out implementations of the function. In our example, this would be .. code-block:: c kunit_activate_static_stub(test, send_data_to_hardware, fake_send_data_to_hardware); ”h]”(hï)”}”(hŒ(Activate the static stub from your test.”h]”hŒ(Activate the static stub from your test.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KShj ubhï)”}”(hXFrom within a test, the redirection can be enabled with kunit_activate_static_stub(), which accepts a struct kunit pointer, the real function, and the replacement function. You can call this several times with different replacement functions to swap out implementations of the function.”h]”hXFrom within a test, the redirection can be enabled with kunit_activate_static_stub(), which accepts a struct kunit pointer, the real function, and the replacement function. You can call this several times with different replacement functions to swap out implementations of the function.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KUhj ubhï)”}”(hŒIn our example, this would be”h]”hŒIn our example, this would be”…””}”(hj,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K[hj ubj¯)”}”(hŒŠkunit_activate_static_stub(test, send_data_to_hardware, fake_send_data_to_hardware);”h]”hŒŠkunit_activate_static_stub(test, send_data_to_hardware, fake_send_data_to_hardware);”…””}”hj:sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆj¾‰j¿jÀjÁ}”uh1j®h³hÇh´K]hj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j~hj{h²hh³Nh´Nubj)”}”(hX­Call (perhaps indirectly) the real function. Once the redirection is activated, any call to the real function will call the replacement function instead. Such calls may be buried deep in the implementation of another function, but must occur from the test's kthread. For example: .. code-block:: c send_data_to_hardware("Hello World!"); /* Succeeds */ send_data_to_hardware("Something else"); /* Fails the test. */ ”h]”(hï)”}”(hŒ,Call (perhaps indirectly) the real function.”h]”hŒ,Call (perhaps indirectly) the real function.”…””}”(hjSh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KchjOubhï)”}”(hŒÝOnce the redirection is activated, any call to the real function will call the replacement function instead. Such calls may be buried deep in the implementation of another function, but must occur from the test's kthread.”h]”hŒßOnce the redirection is activated, any call to the real function will call the replacement function instead. Such calls may be buried deep in the implementation of another function, but must occur from the test’s kthread.”…””}”(hjah²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KehjOubhï)”}”(hŒ For example:”h]”hŒ For example:”…””}”(hjoh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KihjOubj¯)”}”(hŒtsend_data_to_hardware("Hello World!"); /* Succeeds */ send_data_to_hardware("Something else"); /* Fails the test. */”h]”hŒtsend_data_to_hardware("Hello World!"); /* Succeeds */ send_data_to_hardware("Something else"); /* Fails the test. */”…””}”hj}sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆj¾‰j¿jÀjÁ}”uh1j®h³hÇh´KkhjOubeh}”(h]”h ]”h"]”h$]”h&]”uh1j~hj{h²hh³Nh´Nubj)”}”(hX`(Optionally) disable the stub. When you no longer need it, disable the redirection (and hence resume the original behaviour of the 'real' function) using kunit_deactivate_static_stub(). Otherwise, it will be automatically disabled when the test exits. For example: .. code-block:: c kunit_deactivate_static_stub(test, send_data_to_hardware); ”h]”(hï)”}”(hŒ(Optionally) disable the stub.”h]”hŒ(Optionally) disable the stub.”…””}”(hj–h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kphj’ubhï)”}”(hŒÜWhen you no longer need it, disable the redirection (and hence resume the original behaviour of the 'real' function) using kunit_deactivate_static_stub(). Otherwise, it will be automatically disabled when the test exits.”h]”hŒàWhen you no longer need it, disable the redirection (and hence resume the original behaviour of the ‘real’ function) using kunit_deactivate_static_stub(). Otherwise, it will be automatically disabled when the test exits.”…””}”(hj¤h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Krhj’ubhï)”}”(hŒ For example:”h]”hŒ For example:”…””}”(hj²h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kwhj’ubj¯)”}”(hŒ:kunit_deactivate_static_stub(test, send_data_to_hardware);”h]”hŒ:kunit_deactivate_static_stub(test, send_data_to_hardware);”…””}”hjÀsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆj¾‰j¿jÀjÁ}”uh1j®h³hÇh´Kyhj’ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j~hj{h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”hŒsuffix”Œ.”uh1jyhj>h²hh³hÇh´K0ubhï)”}”(hŒqIt's also possible to use these replacement functions to test to see if a function is called at all, for example:”h]”hŒsIt’s also possible to use these replacement functions to test to see if a function is called at all, for example:”…””}”(hjàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K~hj>h²hubj¯)”}”(hX­void send_data_to_hardware(const char *str) { KUNIT_STATIC_STUB_REDIRECT(send_data_to_hardware, str); /* real implementation */ } /* In test file */ int times_called = 0; void fake_send_data_to_hardware(const char *str) { times_called++; } ... /* In the test case, redirect calls for the duration of the test */ kunit_activate_static_stub(test, send_data_to_hardware, fake_send_data_to_hardware); send_data_to_hardware("hello"); KUNIT_EXPECT_EQ(test, times_called, 1); /* Can also deactivate the stub early, if wanted */ kunit_deactivate_static_stub(test, send_data_to_hardware); send_data_to_hardware("hello again"); KUNIT_EXPECT_EQ(test, times_called, 1);”h]”hX­void send_data_to_hardware(const char *str) { KUNIT_STATIC_STUB_REDIRECT(send_data_to_hardware, str); /* real implementation */ } /* In test file */ int times_called = 0; void fake_send_data_to_hardware(const char *str) { times_called++; } ... /* In the test case, redirect calls for the duration of the test */ kunit_activate_static_stub(test, send_data_to_hardware, fake_send_data_to_hardware); send_data_to_hardware("hello"); KUNIT_EXPECT_EQ(test, times_called, 1); /* Can also deactivate the stub early, if wanted */ kunit_deactivate_static_stub(test, send_data_to_hardware); send_data_to_hardware("hello again"); KUNIT_EXPECT_EQ(test, times_called, 1);”…””}”hjîsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆj¾‰j¿jÀjÁ}”uh1j®h³hÇh´Khj>h²hubeh}”(h]”Œ static-stubs”ah ]”h"]”Œ static stubs”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K%ubhÉ)”}”(hhh]”(hÎ)”}”(hŒ API Reference”h]”hŒ API Reference”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´KŸubhŒindex”“”)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œentries”]”(Œsingle”Œ$KUNIT_STATIC_STUB_REDIRECT (C macro)”Œc.KUNIT_STATIC_STUB_REDIRECT”hNt”auh1jhjh²hh³Nh´NubhŒdesc”“”)”}”(hhh]”(hŒdesc_signature”“”)”}”(hŒKUNIT_STATIC_STUB_REDIRECT”h]”hŒdesc_signature_line”“”)”}”(hŒKUNIT_STATIC_STUB_REDIRECT”h]”hŒ desc_name”“”)”}”(hŒKUNIT_STATIC_STUB_REDIRECT”h]”hŒ desc_sig_name”“”)”}”(hj0h]”hŒKUNIT_STATIC_STUB_REDIRECT”…””}”(hj@h²hh³Nh´Nubah}”(h]”h ]”Œn”ah"]”h$]”h&]”uh1j>hj:ubah}”(h]”h ]”(Œsig-name”Œdescname”eh"]”h$]”h&]”hÅhÆuh1j8hj4h²hh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´Kubah}”(h]”h ]”h"]”h$]”h&]”hÅhÆŒ add_permalink”ˆuh1j2Œsphinx_line_type”Œ declarator”hj.h²hh³jVh´Kubah}”(h]”j%ah ]”(Œsig”Œ sig-object”eh"]”h$]”h&]”Œ is_multiline”ˆŒ _toc_parts”)Œ _toc_name”huh1j,h³jVh´Khj)h²hubhŒ desc_content”“”)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”uh1jkhj)h²hh³jVh´Kubeh}”(h]”h ]”(jÀŒmacro”eh"]”h$]”h&]”Œdomain”jÀŒobjtype”jyŒdesctype”jyŒnoindex”‰Œ noindexentry”‰Œnocontentsentry”‰uh1j'h²hhjh³Nh´Nubhï)”}”(hŒ6``KUNIT_STATIC_STUB_REDIRECT (real_fn_name, args...)``”h]”hŒliteral”“”)”}”(hj…h]”hŒ2KUNIT_STATIC_STUB_REDIRECT (real_fn_name, args...)”…””}”(hj‰h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡hjƒubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´Khjh²hubhŒ block_quote”“”)”}”(hŒ/call a replacement 'static stub' if one exists ”h]”hï)”}”(hŒ.call a replacement 'static stub' if one exists”h]”hŒ2call a replacement ‘static stub’ if one exists”…””}”(hj£h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´KhjŸubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³j±h´Khjh²hubhŒ container”“”)”}”(hXÚ**Parameters** ``real_fn_name`` The name of this function (as an identifier, not a string) ``args...`` All of the arguments passed to this function **Description** This is a function prologue which is used to allow calls to the current function to be redirected by a KUnit test. KUnit tests can call kunit_activate_static_stub() to pass a replacement function in. The replacement function will be called by KUNIT_STATIC_STUB_REDIRECT(), which will then return from the function. If the caller is not in a KUnit context, the function will continue execution as normal. **Example** .. code-block:: c int real_func(int n) { KUNIT_STATIC_STUB_REDIRECT(real_func, n); return 0; } int replacement_func(int n) { return 42; } void example_test(struct kunit *test) { kunit_activate_static_stub(test, real_func, replacement_func); KUNIT_EXPECT_EQ(test, real_func(1), 42); }”h]”(hï)”}”(hŒ**Parameters**”h]”hŒstrong”“”)”}”(hjÀh]”hŒ Parameters”…””}”(hjÄh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÂhj¾ubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´KhjºubhŒdefinition_list”“”)”}”(hhh]”(hŒdefinition_list_item”“”)”}”(hŒL``real_fn_name`` The name of this function (as an identifier, not a string) ”h]”(hŒterm”“”)”}”(hŒ``real_fn_name``”h]”jˆ)”}”(hjçh]”hŒ real_fn_name”…””}”(hjéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡hjåubah}”(h]”h ]”h"]”h$]”h&]”uh1jãh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´KhjßubhŒ definition”“”)”}”(hhh]”hï)”}”(hŒ:The name of this function (as an identifier, not a string)”h]”hŒ:The name of this function (as an identifier, not a string)”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³jüh´Khjÿubah}”(h]”h ]”h"]”h$]”h&]”uh1jýhjßubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÝh³jüh´KhjÚubjÞ)”}”(hŒ9``args...`` All of the arguments passed to this function ”h]”(jä)”}”(hŒ ``args...``”h]”jˆ)”}”(hj"h]”hŒargs...”…””}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jãh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´Khjubjþ)”}”(hhh]”hï)”}”(hŒ,All of the arguments passed to this function”h]”hŒ,All of the arguments passed to this function”…””}”(hj;h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³j7h´Khj8ubah}”(h]”h ]”h"]”h$]”h&]”uh1jýhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÝh³j7h´KhjÚubeh}”(h]”h ]”h"]”h$]”h&]”uh1jØhjºubhï)”}”(hŒ**Description**”h]”jÃ)”}”(hj]h]”hŒ Description”…””}”(hj_h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÂhj[ubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´Khjºubhï)”}”(hX“This is a function prologue which is used to allow calls to the current function to be redirected by a KUnit test. KUnit tests can call kunit_activate_static_stub() to pass a replacement function in. The replacement function will be called by KUNIT_STATIC_STUB_REDIRECT(), which will then return from the function. If the caller is not in a KUnit context, the function will continue execution as normal.”h]”hX“This is a function prologue which is used to allow calls to the current function to be redirected by a KUnit test. KUnit tests can call kunit_activate_static_stub() to pass a replacement function in. The replacement function will be called by KUNIT_STATIC_STUB_REDIRECT(), which will then return from the function. If the caller is not in a KUnit context, the function will continue execution as normal.”…””}”(hjsh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´Khjºubhï)”}”(hŒ **Example**”h]”jÃ)”}”(hj„h]”hŒExample”…””}”(hj†h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÂhj‚ubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´K$hjºubj¯)”}”(hX3int real_func(int n) { KUNIT_STATIC_STUB_REDIRECT(real_func, n); return 0; } int replacement_func(int n) { return 42; } void example_test(struct kunit *test) { kunit_activate_static_stub(test, real_func, replacement_func); KUNIT_EXPECT_EQ(test, real_func(1), 42); }”h]”hX3int real_func(int n) { KUNIT_STATIC_STUB_REDIRECT(real_func, n); return 0; } int replacement_func(int n) { return 42; } void example_test(struct kunit *test) { kunit_activate_static_stub(test, real_func, replacement_func); KUNIT_EXPECT_EQ(test, real_func(1), 42); }”…””}”hjšsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆj¾‰j¿jÀjÁ}”uh1j®h³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´K%hjºubeh}”(h]”h ]”Œ kernelindent”ah"]”h$]”h&]”uh1j¸hjh²hh³Nh´Nubj)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œentries”]”(j#Œ$kunit_activate_static_stub (C macro)”Œc.kunit_activate_static_stub”hNt”auh1jhjh²hh³Nh´Nubj()”}”(hhh]”(j-)”}”(hŒkunit_activate_static_stub”h]”j3)”}”(hŒkunit_activate_static_stub”h]”j9)”}”(hŒkunit_activate_static_stub”h]”j?)”}”(hjÄh]”hŒkunit_activate_static_stub”…””}”(hjÎh²hh³Nh´Nubah}”(h]”h ]”jJah"]”h$]”h&]”uh1j>hjÊubah}”(h]”h ]”(jQjReh"]”h$]”h&]”hÅhÆuh1j8hjÆh²hh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´KRubah}”(h]”h ]”h"]”h$]”h&]”hÅhÆj]ˆuh1j2j^j_hjÂh²hh³jáh´KRubah}”(h]”j½ah ]”(jcjdeh"]”h$]”h&]”jhˆji)jjhuh1j,h³jáh´KRhj¿h²hubjl)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”uh1jkhj¿h²hh³jáh´KRubeh}”(h]”h ]”(jÀŒmacro”eh"]”h$]”h&]”j}jÀj~jújjúj€‰j‰j‚‰uh1j'h²hhjh³Nh´Nubhï)”}”(hŒE``kunit_activate_static_stub (test, real_fn_addr, replacement_addr)``”h]”jˆ)”}”(hjh]”hŒAkunit_activate_static_stub (test, real_fn_addr, replacement_addr)”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡hjþubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´KThjh²hubjž)”}”(hŒ'replace a function using static stubs. ”h]”hï)”}”(hŒ&replace a function using static stubs.”h]”hŒ&replace a function using static stubs.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´KRhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³j(h´KRhjh²hubj¹)”}”(hXy**Parameters** ``test`` A pointer to the 'struct kunit' test context for the current test. ``real_fn_addr`` The address of the function to replace. ``replacement_addr`` The address of the function to replace it with. **Description** When activated, calls to real_fn_addr from within this test (even if called indirectly) will instead call replacement_addr. The function pointed to by real_fn_addr must begin with the static stub prologue in KUNIT_STATIC_STUB_REDIRECT() for this to work. real_fn_addr and replacement_addr must have the same type. The redirection can be disabled again with kunit_deactivate_static_stub().”h]”(hï)”}”(hŒ**Parameters**”h]”jÃ)”}”(hj5h]”hŒ Parameters”…””}”(hj7h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÂhj3ubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´KVhj/ubjÙ)”}”(hhh]”(jÞ)”}”(hŒL``test`` A pointer to the 'struct kunit' test context for the current test. ”h]”(jä)”}”(hŒ``test``”h]”jˆ)”}”(hjTh]”hŒtest”…””}”(hjVh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡hjRubah}”(h]”h ]”h"]”h$]”h&]”uh1jãh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´KShjNubjþ)”}”(hhh]”hï)”}”(hŒBA pointer to the 'struct kunit' test context for the current test.”h]”hŒFA pointer to the ‘struct kunit’ test context for the current test.”…””}”(hjmh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³jih´KShjjubah}”(h]”h ]”h"]”h$]”h&]”uh1jýhjNubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÝh³jih´KShjKubjÞ)”}”(hŒ9``real_fn_addr`` The address of the function to replace. ”h]”(jä)”}”(hŒ``real_fn_addr``”h]”jˆ)”}”(hjh]”hŒ real_fn_addr”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡hj‹ubah}”(h]”h ]”h"]”h$]”h&]”uh1jãh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´KThj‡ubjþ)”}”(hhh]”hï)”}”(hŒ'The address of the function to replace.”h]”hŒ'The address of the function to replace.”…””}”(hj¦h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³j¢h´KThj£ubah}”(h]”h ]”h"]”h$]”h&]”uh1jýhj‡ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÝh³j¢h´KThjKubjÞ)”}”(hŒE``replacement_addr`` The address of the function to replace it with. ”h]”(jä)”}”(hŒ``replacement_addr``”h]”jˆ)”}”(hjÆh]”hŒreplacement_addr”…””}”(hjÈh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡hjÄubah}”(h]”h ]”h"]”h$]”h&]”uh1jãh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´KUhjÀubjþ)”}”(hhh]”hï)”}”(hŒ/The address of the function to replace it with.”h]”hŒ/The address of the function to replace it with.”…””}”(hjßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³jÛh´KUhjÜubah}”(h]”h ]”h"]”h$]”h&]”uh1jýhjÀubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÝh³jÛh´KUhjKubeh}”(h]”h ]”h"]”h$]”h&]”uh1jØhj/ubhï)”}”(hŒ**Description**”h]”jÃ)”}”(hjh]”hŒ Description”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÂhjÿubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´KWhj/ubhï)”}”(hX9When activated, calls to real_fn_addr from within this test (even if called indirectly) will instead call replacement_addr. The function pointed to by real_fn_addr must begin with the static stub prologue in KUNIT_STATIC_STUB_REDIRECT() for this to work. real_fn_addr and replacement_addr must have the same type.”h]”hX9When activated, calls to real_fn_addr from within this test (even if called indirectly) will instead call replacement_addr. The function pointed to by real_fn_addr must begin with the static stub prologue in KUNIT_STATIC_STUB_REDIRECT() for this to work. real_fn_addr and replacement_addr must have the same type.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´KVhj/ubhï)”}”(hŒJThe redirection can be disabled again with kunit_deactivate_static_stub().”h]”hŒJThe redirection can be disabled again with kunit_deactivate_static_stub().”…””}”(hj&h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´K\hj/ubeh}”(h]”h ]”Œ kernelindent”ah"]”h$]”h&]”uh1j¸hjh²hh³Nh´Nubj)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œentries”]”(j#Œ)kunit_deactivate_static_stub (C function)”Œc.kunit_deactivate_static_stub”hNt”auh1jhjh²hh³Nh´Nubj()”}”(hhh]”(j-)”}”(hŒJvoid kunit_deactivate_static_stub (struct kunit *test, void *real_fn_addr)”h]”j3)”}”(hŒIvoid kunit_deactivate_static_stub(struct kunit *test, void *real_fn_addr)”h]”(hŒdesc_sig_keyword_type”“”)”}”(hŒvoid”h]”hŒvoid”…””}”(hjWh²hh³Nh´Nubah}”(h]”h ]”Œkt”ah"]”h$]”h&]”uh1jUhjQh²hh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´KfubhŒdesc_sig_space”“”)”}”(hŒ ”h]”hŒ ”…””}”(hjih²hh³Nh´Nubah}”(h]”h ]”Œw”ah"]”h$]”h&]”uh1jghjQh²hh³jfh´Kfubj9)”}”(hŒkunit_deactivate_static_stub”h]”j?)”}”(hŒkunit_deactivate_static_stub”h]”hŒkunit_deactivate_static_stub”…””}”(hj|h²hh³Nh´Nubah}”(h]”h ]”jJah"]”h$]”h&]”uh1j>hjxubah}”(h]”h ]”(jQjReh"]”h$]”h&]”hÅhÆuh1j8hjQh²hh³jfh´KfubhŒdesc_parameterlist”“”)”}”(hŒ((struct kunit *test, void *real_fn_addr)”h]”(hŒdesc_parameter”“”)”}”(hŒstruct kunit *test”h]”(hŒdesc_sig_keyword”“”)”}”(hŒstruct”h]”hŒstruct”…””}”(hjžh²hh³Nh´Nubah}”(h]”h ]”Œk”ah"]”h$]”h&]”uh1jœhj˜ubjh)”}”(hŒ ”h]”hŒ ”…””}”(hj­h²hh³Nh´Nubah}”(h]”h ]”jtah"]”h$]”h&]”uh1jghj˜ubh)”}”(hhh]”j?)”}”(hŒkunit”h]”hŒkunit”…””}”(hj¾h²hh³Nh´Nubah}”(h]”h ]”jJah"]”h$]”h&]”uh1j>hj»ubah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”jÀŒreftype”Œ identifier”Œ reftarget”jÀŒmodname”NŒ classname”NŒ c:parent_key”Œsphinx.domains.c”Œ LookupKey”“”)”}”Œdata”]”jÙŒ ASTIdentifier”“”)”}”jÔj~sbŒc.kunit_deactivate_static_stub”†”asbuh1hhj˜ubjh)”}”(hŒ ”h]”hŒ ”…””}”(hjæh²hh³Nh´Nubah}”(h]”h ]”jtah"]”h$]”h&]”uh1jghj˜ubhŒdesc_sig_punctuation”“”)”}”(hŒ*”h]”hŒ*”…””}”(hjöh²hh³Nh´Nubah}”(h]”h ]”Œp”ah"]”h$]”h&]”uh1jôhj˜ubj?)”}”(hŒtest”h]”hŒtest”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”jJah"]”h$]”h&]”uh1j>hj˜ubeh}”(h]”h ]”h"]”h$]”h&]”Œnoemph”ˆhÅhÆuh1j–hj’ubj—)”}”(hŒvoid *real_fn_addr”h]”(jV)”}”(hŒvoid”h]”hŒvoid”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”jbah"]”h$]”h&]”uh1jUhjubjh)”}”(hŒ ”h]”hŒ ”…””}”(hj,h²hh³Nh´Nubah}”(h]”h ]”jtah"]”h$]”h&]”uh1jghjubjõ)”}”(hjøh]”hŒ*”…””}”(hj:h²hh³Nh´Nubah}”(h]”h ]”jah"]”h$]”h&]”uh1jôhjubj?)”}”(hŒ real_fn_addr”h]”hŒ real_fn_addr”…””}”(hjGh²hh³Nh´Nubah}”(h]”h ]”jJah"]”h$]”h&]”uh1j>hjubeh}”(h]”h ]”h"]”h$]”h&]”Œnoemph”ˆhÅhÆuh1j–hj’ubeh}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jhjQh²hh³jfh´Kfubeh}”(h]”h ]”h"]”h$]”h&]”hÅhÆj]ˆuh1j2j^j_hjMh²hh³jfh´Kfubah}”(h]”jHah ]”(jcjdeh"]”h$]”h&]”jhˆji)jjhuh1j,h³jfh´KfhjJh²hubjl)”}”(hhh]”hï)”}”(hŒdisable a function redirection”h]”hŒdisable a function redirection”…””}”(hjqh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´Kfhjnh²hubah}”(h]”h ]”h"]”h$]”h&]”uh1jkhjJh²hh³jfh´Kfubeh}”(h]”h ]”(jÀŒfunction”eh"]”h$]”h&]”j}jÀj~j‰jj‰j€‰j‰j‚‰uh1j'h²hhjh³Nh´Nubj¹)”}”(hX”**Parameters** ``struct kunit *test`` A pointer to the 'struct kunit' test context for the current test. ``void *real_fn_addr`` The address of the function to no-longer redirect **Description** Deactivates a redirection configured with kunit_activate_static_stub(). After this function returns, calls to real_fn_addr() will execute the original real_fn, not any previously-configured replacement.”h]”(hï)”}”(hŒ**Parameters**”h]”jÃ)”}”(hj“h]”hŒ Parameters”…””}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÂhj‘ubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´KjhjubjÙ)”}”(hhh]”(jÞ)”}”(hŒZ``struct kunit *test`` A pointer to the 'struct kunit' test context for the current test. ”h]”(jä)”}”(hŒ``struct kunit *test``”h]”jˆ)”}”(hj²h]”hŒstruct kunit *test”…””}”(hj´h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡hj°ubah}”(h]”h ]”h"]”h$]”h&]”uh1jãh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´Kghj¬ubjþ)”}”(hhh]”hï)”}”(hŒBA pointer to the 'struct kunit' test context for the current test.”h]”hŒFA pointer to the ‘struct kunit’ test context for the current test.”…””}”(hjËh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³jÇh´KghjÈubah}”(h]”h ]”h"]”h$]”h&]”uh1jýhj¬ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÝh³jÇh´Kghj©ubjÞ)”}”(hŒI``void *real_fn_addr`` The address of the function to no-longer redirect ”h]”(jä)”}”(hŒ``void *real_fn_addr``”h]”jˆ)”}”(hjëh]”hŒvoid *real_fn_addr”…””}”(hjíh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡hjéubah}”(h]”h ]”h"]”h$]”h&]”uh1jãh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´Khhjåubjþ)”}”(hhh]”hï)”}”(hŒ1The address of the function to no-longer redirect”h]”hŒ1The address of the function to no-longer redirect”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³jh´Khhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jýhjåubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÝh³jh´Khhj©ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jØhjubhï)”}”(hŒ**Description**”h]”jÃ)”}”(hj&h]”hŒ Description”…””}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÂhj$ubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´Kjhjubhï)”}”(hŒÊDeactivates a redirection configured with kunit_activate_static_stub(). After this function returns, calls to real_fn_addr() will execute the original real_fn, not any previously-configured replacement.”h]”hŒÊDeactivates a redirection configured with kunit_activate_static_stub(). After this function returns, calls to real_fn_addr() will execute the original real_fn, not any previously-configured replacement.”…””}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³Œt/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/api/functionredirection:161: ./include/kunit/static_stub.h”h´Kihjubeh}”(h]”h ]”Œ kernelindent”ah"]”h$]”h&]”uh1j¸hjh²hh³Nh´Nubeh}”(h]”Œ api-reference”ah ]”h"]”Œ api reference”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KŸubeh}”(h]”Œfunction-redirection-api”ah ]”h"]”Œfunction redirection api”ah$]”h&]”uh1hÈhhh²hh³hÇh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hÍNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j…Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(j_j\j;j8jjÿjWjTuŒ nametypes”}”(j_‰j;‰j‰jW‰uh}”(j\hÊj8hÝjÿj>jTjj%j.j½jÂjHjMuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.