€•»¬Œ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/trace/ftrace-uses”Œ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/trace/ftrace-uses”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/it_IT/trace/ftrace-uses”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/ja_JP/trace/ftrace-uses”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/ko_KR/trace/ftrace-uses”Œ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/trace/ftrace-uses”Œ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/trace/ftrace-uses”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒ!Using ftrace to hook to functions”h]”hŒ!Using ftrace to hook to functions”…”�”}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³Œ?/var/lib/git/docbuild/linux/Documentation/trace/ftrace-uses.rst”h´KubhŒcomment”“”)�”}”(hŒCopyright 2017 VMware Inc.”h]”hŒCopyright 2017 VMware Inc.”…”�”}”hhÍsbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hËhh·h²hh³hÊh´KubhÌ)�”}”(hŒ/Author: Steven Rostedt ”h]”hŒ/Author: Steven Rostedt ”…”�”}”hhÝsbah}”(h]”h ]”h"]”h$]”h&]”hÛhÜuh1hËhh·h²hh³hÊh´KubhÌ)�”}”(hŒ:License: The GNU Free Documentation License, Version 1.2”h]”hŒ:License: The GNU Free Documentation License, Version 1.2”…”�”}”hhësbah}”(h]”h ]”h"]”h$]”h&]”hÛhÜuh1hËhh·h²hh³hÊh´KubhÌ)�”}”(hŒ (dual licensed under the GPL v2)”h]”hŒ (dual licensed under the GPL v2)”…”�”}”hhùsbah}”(h]”h ]”h"]”h$]”h&]”hÛhÜuh1hËhh·h²hh³hÊh´K ubhŒ paragraph”“”)�”}”(hŒWritten for: 4.14”h]”hŒWritten for: 4.14”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K hh·h²hubh¶)�”}”(hhh]”(h»)�”}”(hŒ Introduction”h]”hŒ Introduction”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjh²hh³hÊh´K ubj)�”}”(hXkThe ftrace infrastructure was originally created to attach callbacks to the beginning of functions in order to record and trace the flow of the kernel. But callbacks to the start of a function can have other use cases. Either for live kernel patching, or for security monitoring. This document describes how to use ftrace to implement your own function callbacks.”h]”hXkThe ftrace infrastructure was originally created to attach callbacks to the beginning of functions in order to record and trace the flow of the kernel. But callbacks to the start of a function can have other use cases. Either for live kernel patching, or for security monitoring. This document describes how to use ftrace to implement your own function callbacks.”…”�”}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Khjh²hubeh}”(h]”Œ introduction”ah ]”h"]”Œ introduction”ah$]”h&]”uh1hµhh·h²hh³hÊh´K ubh¶)�”}”(hhh]”(h»)�”}”(hŒThe ftrace context”h]”hŒThe ftrace context”…”�”}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj>h²hh³hÊh´KubhŒwarning”“”)�”}”(hX“The ability to add a callback to almost any function within the kernel comes with risks. A callback can be called from any context (normal, softirq, irq, and NMI). Callbacks can also be called just before going to idle, during CPU bring up and takedown, or going to user space. This requires extra care to what can be done inside a callback. A callback can be called outside the protective scope of RCU.”h]”j)�”}”(hX“The ability to add a callback to almost any function within the kernel comes with risks. A callback can be called from any context (normal, softirq, irq, and NMI). Callbacks can also be called just before going to idle, during CPU bring up and takedown, or going to user space. This requires extra care to what can be done inside a callback. A callback can be called outside the protective scope of RCU.”h]”hX“The ability to add a callback to almost any function within the kernel comes with risks. A callback can be called from any context (normal, softirq, irq, and NMI). Callbacks can also be called just before going to idle, during CPU bring up and takedown, or going to user space. This requires extra care to what can be done inside a callback. A callback can be called outside the protective scope of RCU.”…”�”}”(hjUh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KhjQubah}”(h]”h ]”h"]”h$]”h&]”uh1jOhj>h²hh³hÊh´Nubj)�”}”(hŒqThere are helper functions to help against recursion, and making sure RCU is watching. These are explained below.”h]”hŒqThere are helper functions to help against recursion, and making sure RCU is watching. These are explained below.”…”�”}”(hjih²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K!hj>h²hubeh}”(h]”Œthe-ftrace-context”ah ]”h"]”Œthe ftrace context”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)�”}”(hhh]”(h»)�”}”(hŒThe ftrace_ops structure”h]”hŒThe ftrace_ops structure”…”�”}”(hj‚h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjh²hh³hÊh´K&ubj)�”}”(hŒçTo register a function callback, a ftrace_ops is required. This structure is used to tell ftrace what function should be called as the callback as well as what protections the callback will perform and not require ftrace to handle.”h]”hŒçTo register a function callback, a ftrace_ops is required. This structure is used to tell ftrace what function should be called as the callback as well as what protections the callback will perform and not require ftrace to handle.”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K(hjh²hubj)�”}”(hŒ\There is only one field that is needed to be set when registering an ftrace_ops with ftrace:”h]”hŒ\There is only one field that is needed to be set when registering an ftrace_ops with ftrace:”…”�”}”(hjžh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K-hjh²hubhŒ literal_block”“”)�”}”(hŒ½struct ftrace_ops ops = { .func = my_callback_func, .flags = MY_FTRACE_FLAGS .private = any_private_data_structure, };”h]”hŒ½struct ftrace_ops ops = { .func = my_callback_func, .flags = MY_FTRACE_FLAGS .private = any_private_data_structure, };”…”�”}”hj®sbah}”(h]”h ]”h"]”h$]”h&]”hÛhÜŒforce”‰Œlanguage”Œc”Œhighlight_args”}”uh1j¬h³hÊh´K0hjh²hubj)�”}”(hŒ>Both .flags and .private are optional. Only .func is required.”h]”hŒ>Both .flags and .private are optional. Only .func is required.”…”�”}”(hjÁh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K8hjh²hubj)�”}”(hŒTo enable tracing call::”h]”hŒTo enable tracing call:”…”�”}”(hjÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K:hjh²hubj­)�”}”(hŒregister_ftrace_function(&ops);”h]”hŒregister_ftrace_function(&ops);”…”�”}”hjÝsbah}”(h]”h ]”h"]”h$]”h&]”hÛhÜuh1j¬h³hÊh´Khjh²hubj­)�”}”(hŒ!unregister_ftrace_function(&ops);”h]”hŒ!unregister_ftrace_function(&ops);”…”�”}”hjùsbah}”(h]”h ]”h"]”h$]”h&]”hÛhÜuh1j¬h³hÊh´K@hjh²hubj)�”}”(hŒ.The above is defined by including the header::”h]”hŒ-The above is defined by including the header:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KBhjh²hubj­)�”}”(hŒ#include ”h]”hŒ#include ”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÛhÜuh1j¬h³hÊh´KDhjh²hubj)�”}”(hXLThe registered callback will start being called some time after the register_ftrace_function() is called and before it returns. The exact time that callbacks start being called is dependent upon architecture and scheduling of services. The callback itself will have to handle any synchronization if it must begin at an exact moment.”h]”hXLThe registered callback will start being called some time after the register_ftrace_function() is called and before it returns. The exact time that callbacks start being called is dependent upon architecture and scheduling of services. The callback itself will have to handle any synchronization if it must begin at an exact moment.”…”�”}”(hj#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KFhjh²hubj)�”}”(hŒüThe unregister_ftrace_function() will guarantee that the callback is no longer being called by functions after the unregister_ftrace_function() returns. Note that to perform this guarantee, the unregister_ftrace_function() may take some time to finish.”h]”hŒüThe unregister_ftrace_function() will guarantee that the callback is no longer being called by functions after the unregister_ftrace_function() returns. Note that to perform this guarantee, the unregister_ftrace_function() may take some time to finish.”…”�”}”(hj1h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KLhjh²hubeh}”(h]”Œthe-ftrace-ops-structure”ah ]”h"]”Œthe ftrace_ops structure”ah$]”h&]”uh1hµhh·h²hh³hÊh´K&ubh¶)�”}”(hhh]”(h»)�”}”(hŒThe callback function”h]”hŒThe callback function”…”�”}”(hjJh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjGh²hh³hÊh´KSubj)�”}”(hŒCThe prototype of the callback function is as follows (as of v4.14):”h]”hŒCThe prototype of the callback function is as follows (as of v4.14):”…”�”}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KUhjGh²hubj­)�”}”(hŒ~void callback_func(unsigned long ip, unsigned long parent_ip, struct ftrace_ops *op, struct pt_regs *regs);”h]”hŒ~void callback_func(unsigned long ip, unsigned long parent_ip, struct ftrace_ops *op, struct pt_regs *regs);”…”�”}”hjfsbah}”(h]”h ]”h"]”h$]”h&]”hÛhÜj¼‰j½j¾j¿}”uh1j¬h³hÊh´KWhjGh²hubhŒdefinition_list”“”)�”}”(hhh]”(hŒdefinition_list_item”“”)�”}”(hŒ~@ip This is the instruction pointer of the function that is being traced. (where the fentry or mcount is within the function) ”h]”(hŒterm”“”)�”}”(hŒ@ip”h]”hŒ@ip”…”�”}”(hj‚h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j€h³hÊh´K^hj|ubhŒ definition”“”)�”}”(hhh]”j)�”}”(hŒyThis is the instruction pointer of the function that is being traced. (where the fentry or mcount is within the function)”h]”hŒyThis is the instruction pointer of the function that is being traced. (where the fentry or mcount is within the function)”…”�”}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K]hj’ubah}”(h]”h ]”h"]”h$]”h&]”uh1j�hj|ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jzh³hÊh´K^hjwubj{)�”}”(hŒ�@parent_ip This is the instruction pointer of the function that called the the function being traced (where the call of the function occurred). ”h]”(j�)�”}”(hŒ @parent_ip”h]”hŒ @parent_ip”…”�”}”(hj³h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j€h³hÊh´Kbhj¯ubj‘)�”}”(hhh]”j)�”}”(hŒ„This is the instruction pointer of the function that called the the function being traced (where the call of the function occurred).”h]”hŒ„This is the instruction pointer of the function that called the the function being traced (where the call of the function occurred).”…”�”}”(hjÄh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KahjÁubah}”(h]”h ]”h"]”h$]”h&]”uh1j�hj¯ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jzh³hÊh´Kbhjwh²hubj{)�”}”(hŒ“@op This is a pointer to ftrace_ops that was used to register the callback. This can be used to pass data to the callback via the private pointer. ”h]”(j�)�”}”(hŒ@op”h]”hŒ@op”…”�”}”(hjâh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j€h³hÊh´KfhjÞubj‘)�”}”(hhh]”j)�”}”(hŒŽThis is a pointer to ftrace_ops that was used to register the callback. This can be used to pass data to the callback via the private pointer.”h]”hŒŽThis is a pointer to ftrace_ops that was used to register the callback. This can be used to pass data to the callback via the private pointer.”…”�”}”(hjóh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kehjðubah}”(h]”h ]”h"]”h$]”h&]”uh1j�hjÞubeh}”(h]”h ]”h"]”h$]”h&]”uh1jzh³hÊh´Kfhjwh²hubj{)�”}”(hX?@regs If the FTRACE_OPS_FL_SAVE_REGS or FTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED flags are set in the ftrace_ops structure, then this will be pointing to the pt_regs structure like it would be if an breakpoint was placed at the start of the function where ftrace was tracing. Otherwise it either contains garbage, or NULL. ”h]”(j�)�”}”(hŒ@regs”h]”hŒ@regs”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j€h³hÊh´Kmhj ubj‘)�”}”(hhh]”j)�”}”(hX8If the FTRACE_OPS_FL_SAVE_REGS or FTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED flags are set in the ftrace_ops structure, then this will be pointing to the pt_regs structure like it would be if an breakpoint was placed at the start of the function where ftrace was tracing. Otherwise it either contains garbage, or NULL.”h]”hX8If the FTRACE_OPS_FL_SAVE_REGS or FTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED flags are set in the ftrace_ops structure, then this will be pointing to the pt_regs structure like it would be if an breakpoint was placed at the start of the function where ftrace was tracing. Otherwise it either contains garbage, or NULL.”…”�”}”(hj"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kihjubah}”(h]”h ]”h"]”h$]”h&]”uh1j�hj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jzh³hÊh´Kmhjwh²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1juhjGh²hh³hÊh´Nubeh}”(h]”Œthe-callback-function”ah ]”h"]”Œthe callback function”ah$]”h&]”uh1hµhh·h²hh³hÊh´KSubh¶)�”}”(hhh]”(h»)�”}”(hŒProtect your callback”h]”hŒProtect your callback”…”�”}”(hjMh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjJh²hh³hÊh´Kpubj)�”}”(hXAs functions can be called from anywhere, and it is possible that a function called by a callback may also be traced, and call that same callback, recursion protection must be used. There are two helper functions that can help in this regard. If you start your code with:”h]”hXAs functions can be called from anywhere, and it is possible that a function called by a callback may also be traced, and call that same callback, recursion protection must be used. There are two helper functions that can help in this regard. If you start your code with:”…”�”}”(hj[h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KrhjJh²hubj­)�”}”(hŒZint bit; bit = ftrace_test_recursion_trylock(ip, parent_ip); if (bit < 0) return;”h]”hŒZint bit; bit = ftrace_test_recursion_trylock(ip, parent_ip); if (bit < 0) return;”…”�”}”hjisbah}”(h]”h ]”h"]”h$]”h&]”hÛhÜj¼‰j½j¾j¿}”uh1j¬h³hÊh´KwhjJh²hubj)�”}”(hŒand end it with:”h]”hŒand end it with:”…”�”}”(hjxh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KhjJh²hubj­)�”}”(hŒ"ftrace_test_recursion_unlock(bit);”h]”hŒ"ftrace_test_recursion_unlock(bit);”…”�”}”hj†sbah}”(h]”h ]”h"]”h$]”h&]”hÛhÜj¼‰j½j¾j¿}”uh1j¬h³hÊh´K�hjJh²hubj)�”}”(hXËThe code in between will be safe to use, even if it ends up calling a function that the callback is tracing. Note, on success, ftrace_test_recursion_trylock() will disable preemption, and the ftrace_test_recursion_unlock() will enable it again (if it was previously enabled). The instruction pointer (ip) and its parent (parent_ip) is passed to ftrace_test_recursion_trylock() to record where the recursion happened (if CONFIG_FTRACE_RECORD_RECURSION is set).”h]”hXËThe code in between will be safe to use, even if it ends up calling a function that the callback is tracing. Note, on success, ftrace_test_recursion_trylock() will disable preemption, and the ftrace_test_recursion_unlock() will enable it again (if it was previously enabled). The instruction pointer (ip) and its parent (parent_ip) is passed to ftrace_test_recursion_trylock() to record where the recursion happened (if CONFIG_FTRACE_RECORD_RECURSION is set).”…”�”}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K…hjJh²hubj)�”}”(hX*Alternatively, if the FTRACE_OPS_FL_RECURSION flag is set on the ftrace_ops (as explained below), then a helper trampoline will be used to test for recursion for the callback and no recursion test needs to be done. But this is at the expense of a slightly more overhead from an extra function call.”h]”hX*Alternatively, if the FTRACE_OPS_FL_RECURSION flag is set on the ftrace_ops (as explained below), then a helper trampoline will be used to test for recursion for the callback and no recursion test needs to be done. But this is at the expense of a slightly more overhead from an extra function call.”…”�”}”(hj£h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K�hjJh²hubj)�”}”(hŒáIf your callback accesses any data or critical section that requires RCU protection, it is best to make sure that RCU is "watching", otherwise that data or critical section will not be protected as expected. In this case add:”h]”hŒåIf your callback accesses any data or critical section that requires RCU protection, it is best to make sure that RCU is “watchingâ€�, otherwise that data or critical section will not be protected as expected. In this case add:”…”�”}”(hj±h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K“hjJh²hubj­)�”}”(hŒ'if (!rcu_is_watching()) return;”h]”hŒ'if (!rcu_is_watching()) return;”…”�”}”hj¿sbah}”(h]”h ]”h"]”h$]”h&]”hÛhÜj¼‰j½j¾j¿}”uh1j¬h³hÊh´K˜hjJh²hubj)�”}”(hX&Alternatively, if the FTRACE_OPS_FL_RCU flag is set on the ftrace_ops (as explained below), then a helper trampoline will be used to test for rcu_is_watching for the callback and no other test needs to be done. But this is at the expense of a slightly more overhead from an extra function call.”h]”hX&Alternatively, if the FTRACE_OPS_FL_RCU flag is set on the ftrace_ops (as explained below), then a helper trampoline will be used to test for rcu_is_watching for the callback and no other test needs to be done. But this is at the expense of a slightly more overhead from an extra function call.”…”�”}”(hjÎh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K�hjJh²hubeh}”(h]”Œprotect-your-callback”ah ]”h"]”Œprotect your callback”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kpubh¶)�”}”(hhh]”(h»)�”}”(hŒThe ftrace FLAGS”h]”hŒThe ftrace FLAGS”…”�”}”(hjçh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjäh²hh³hÊh´K¥ubj)�”}”(hŒÎThe ftrace_ops flags are all defined and documented in include/linux/ftrace.h. Some of the flags are used for internal infrastructure of ftrace, but the ones that users should be aware of are the following:”h]”hŒÎThe ftrace_ops flags are all defined and documented in include/linux/ftrace.h. Some of the flags are used for internal infrastructure of ftrace, but the ones that users should be aware of are the following:”…”�”}”(hjõh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K§hjäh²hubjv)�”}”(hhh]”(j{)�”}”(hX FTRACE_OPS_FL_SAVE_REGS If the callback requires reading or modifying the pt_regs passed to the callback, then it must set this flag. Registering a ftrace_ops with this flag set on an architecture that does not support passing of pt_regs to the callback will fail. ”h]”(j�)�”}”(hŒFTRACE_OPS_FL_SAVE_REGS”h]”hŒFTRACE_OPS_FL_SAVE_REGS”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j€h³hÊh´K¯hjubj‘)�”}”(hhh]”j)�”}”(hŒðIf the callback requires reading or modifying the pt_regs passed to the callback, then it must set this flag. Registering a ftrace_ops with this flag set on an architecture that does not support passing of pt_regs to the callback will fail.”h]”hŒðIf the callback requires reading or modifying the pt_regs passed to the callback, then it must set this flag. Registering a ftrace_ops with this flag set on an architecture that does not support passing of pt_regs to the callback will fail.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K¬hjubah}”(h]”h ]”h"]”h$]”h&]”uh1j�hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jzh³hÊh´K¯hjubj{)�”}”(hXFTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED Similar to SAVE_REGS but the registering of a ftrace_ops on an architecture that does not support passing of regs will not fail with this flag set. But the callback must check if regs is NULL or not to determine if the architecture supports it. ”h]”(j�)�”}”(hŒ$FTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED”h]”hŒ$FTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED”…”�”}”(hj9h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j€h³hÊh´Kµhj5ubj‘)�”}”(hhh]”j)�”}”(hŒôSimilar to SAVE_REGS but the registering of a ftrace_ops on an architecture that does not support passing of regs will not fail with this flag set. But the callback must check if regs is NULL or not to determine if the architecture supports it.”h]”hŒôSimilar to SAVE_REGS but the registering of a ftrace_ops on an architecture that does not support passing of regs will not fail with this flag set. But the callback must check if regs is NULL or not to determine if the architecture supports it.”…”�”}”(hjJh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K²hjGubah}”(h]”h ]”h"]”h$]”h&]”uh1j�hj5ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jzh³hÊh´Kµhjh²hubj{)�”}”(hX¬FTRACE_OPS_FL_RECURSION By default, it is expected that the callback can handle recursion. But if the callback is not that worried about overhead, then setting this bit will add the recursion protection around the callback by calling a helper function that will do the recursion protection and only call the callback if it did not recurse. Note, if this flag is not set, and recursion does occur, it could cause the system to crash, and possibly reboot via a triple fault. Note, if this flag is set, then the callback will always be called with preemption disabled. If it is not set, then it is possible (but not guaranteed) that the callback will be called in preemptible context. ”h]”(j�)�”}”(hŒFTRACE_OPS_FL_RECURSION”h]”hŒFTRACE_OPS_FL_RECURSION”…”�”}”(hjhh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j€h³hÊh´KÄhjdubj‘)�”}”(hhh]”(j)�”}”(hX;By default, it is expected that the callback can handle recursion. But if the callback is not that worried about overhead, then setting this bit will add the recursion protection around the callback by calling a helper function that will do the recursion protection and only call the callback if it did not recurse.”h]”hX;By default, it is expected that the callback can handle recursion. But if the callback is not that worried about overhead, then setting this bit will add the recursion protection around the callback by calling a helper function that will do the recursion protection and only call the callback if it did not recurse.”…”�”}”(hjyh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K¸hjvubj)�”}”(hŒ„Note, if this flag is not set, and recursion does occur, it could cause the system to crash, and possibly reboot via a triple fault.”h]”hŒ„Note, if this flag is not set, and recursion does occur, it could cause the system to crash, and possibly reboot via a triple fault.”…”�”}”(hj‡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K¾hjvubj)�”}”(hŒÐNote, if this flag is set, then the callback will always be called with preemption disabled. If it is not set, then it is possible (but not guaranteed) that the callback will be called in preemptible context.”h]”hŒÐNote, if this flag is set, then the callback will always be called with preemption disabled. If it is not set, then it is possible (but not guaranteed) that the callback will be called in preemptible context.”…”�”}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KÁhjvubeh}”(h]”h ]”h"]”h$]”h&]”uh1j�hjdubeh}”(h]”h ]”h"]”h$]”h&]”uh1jzh³hÊh´KÄhjh²hubj{)�”}”(hXšFTRACE_OPS_FL_IPMODIFY Requires FTRACE_OPS_FL_SAVE_REGS set. If the callback is to "hijack" the traced function (have another function called instead of the traced function), it requires setting this flag. This is what live kernel patches uses. Without this flag the pt_regs->ip can not be modified. Note, only one ftrace_ops with FTRACE_OPS_FL_IPMODIFY set may be registered to any given function at a time. ”h]”(j�)�”}”(hŒFTRACE_OPS_FL_IPMODIFY”h]”hŒFTRACE_OPS_FL_IPMODIFY”…”�”}”(hj³h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j€h³hÊh´KÎhj¯ubj‘)�”}”(hhh]”(j)�”}”(hXRequires FTRACE_OPS_FL_SAVE_REGS set. If the callback is to "hijack" the traced function (have another function called instead of the traced function), it requires setting this flag. This is what live kernel patches uses. Without this flag the pt_regs->ip can not be modified.”h]”hXRequires FTRACE_OPS_FL_SAVE_REGS set. If the callback is to “hijackâ€� the traced function (have another function called instead of the traced function), it requires setting this flag. This is what live kernel patches uses. Without this flag the pt_regs->ip can not be modified.”…”�”}”(hjÄh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KÇhjÁubj)�”}”(hŒlNote, only one ftrace_ops with FTRACE_OPS_FL_IPMODIFY set may be registered to any given function at a time.”h]”hŒlNote, only one ftrace_ops with FTRACE_OPS_FL_IPMODIFY set may be registered to any given function at a time.”…”�”}”(hjÒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KÍhjÁubeh}”(h]”h ]”h"]”h$]”h&]”uh1j�hj¯ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jzh³hÊh´KÎhjh²hubj{)�”}”(hXÐFTRACE_OPS_FL_RCU If this is set, then the callback will only be called by functions where RCU is "watching". This is required if the callback function performs any rcu_read_lock() operation. RCU stops watching when the system goes idle, the time when a CPU is taken down and comes back online, and when entering from kernel to user space and back to kernel space. During these transitions, a callback may be executed and RCU synchronization will not protect it. ”h]”(j�)�”}”(hŒFTRACE_OPS_FL_RCU”h]”hŒFTRACE_OPS_FL_RCU”…”�”}”(hjðh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j€h³hÊh´KÙhjìubj‘)�”}”(hhh]”(j)�”}”(hŒ­If this is set, then the callback will only be called by functions where RCU is "watching". This is required if the callback function performs any rcu_read_lock() operation.”h]”hŒ±If this is set, then the callback will only be called by functions where RCU is “watchingâ€�. This is required if the callback function performs any rcu_read_lock() operation.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KÑhjþubj)�”}”(hXRCU stops watching when the system goes idle, the time when a CPU is taken down and comes back online, and when entering from kernel to user space and back to kernel space. During these transitions, a callback may be executed and RCU synchronization will not protect it.”h]”hXRCU stops watching when the system goes idle, the time when a CPU is taken down and comes back online, and when entering from kernel to user space and back to kernel space. During these transitions, a callback may be executed and RCU synchronization will not protect it.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KÕhjþubeh}”(h]”h ]”h"]”h$]”h&]”uh1j�hjìubeh}”(h]”h ]”h"]”h$]”h&]”uh1jzh³hÊh´KÙhjh²hubj{)�”}”(hX7FTRACE_OPS_FL_PERMANENT If this is set on any ftrace ops, then the tracing cannot disabled by writing 0 to the proc sysctl ftrace_enabled. Equally, a callback with the flag set cannot be registered if ftrace_enabled is 0. Livepatch uses it not to lose the function redirection, so the system stays protected. ”h]”(j�)�”}”(hŒFTRACE_OPS_FL_PERMANENT”h]”hŒFTRACE_OPS_FL_PERMANENT”…”�”}”(hj-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j€h³hÊh´Kâhj)ubj‘)�”}”(hhh]”(j)�”}”(hŒÅIf this is set on any ftrace ops, then the tracing cannot disabled by writing 0 to the proc sysctl ftrace_enabled. Equally, a callback with the flag set cannot be registered if ftrace_enabled is 0.”h]”hŒÅIf this is set on any ftrace ops, then the tracing cannot disabled by writing 0 to the proc sysctl ftrace_enabled. Equally, a callback with the flag set cannot be registered if ftrace_enabled is 0.”…”�”}”(hj>h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KÜhj;ubj)�”}”(hŒVLivepatch uses it not to lose the function redirection, so the system stays protected.”h]”hŒVLivepatch uses it not to lose the function redirection, so the system stays protected.”…”�”}”(hjLh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kàhj;ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j�hj)ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jzh³hÊh´Kâhjh²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1juhjäh²hh³hÊh´Nubeh}”(h]”Œthe-ftrace-flags”ah ]”h"]”Œthe ftrace flags”ah$]”h&]”uh1hµhh·h²hh³hÊh´K¥ubh¶)�”}”(hhh]”(h»)�”}”(hŒ"Filtering which functions to trace”h]”hŒ"Filtering which functions to trace”…”�”}”(hjwh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjth²hh³hÊh´Kåubj)�”}”(hŒ‰If a callback is only to be called from specific functions, a filter must be set up. The filters are added by name, or ip if it is known.”h]”hŒ‰If a callback is only to be called from specific functions, a filter must be set up. The filters are added by name, or ip if it is known.”…”�”}”(hj…h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kçhjth²hubj­)�”}”(hŒlint ftrace_set_filter(struct ftrace_ops *ops, unsigned char *buf, int len, int reset);”h]”hŒlint ftrace_set_filter(struct ftrace_ops *ops, unsigned char *buf, int len, int reset);”…”�”}”hj“sbah}”(h]”h ]”h"]”h$]”h&]”hÛhÜj¼‰j½j¾j¿}”uh1j¬h³hÊh´Kêhjth²hubjv)�”}”(hhh]”(j{)�”}”(hŒ$@ops The ops to set the filter with ”h]”(j�)�”}”(hŒ@ops”h]”hŒ@ops”…”�”}”(hj©h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j€h³hÊh´Kðhj¥ubj‘)�”}”(hhh]”j)�”}”(hŒThe ops to set the filter with”h]”hŒThe ops to set the filter with”…”�”}”(hjºh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kðhj·ubah}”(h]”h ]”h"]”h$]”h&]”uh1j�hj¥ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jzh³hÊh´Kðhj¢ubj{)�”}”(hŒ4@buf The string that holds the function filter text.”h]”(j�)�”}”(hŒ@buf”h]”hŒ@buf”…”�”}”(hjØh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j€h³hÊh´KòhjÔubj‘)�”}”(hhh]”j)�”}”(hŒ/The string that holds the function filter text.”h]”hŒ/The string that holds the function filter text.”…”�”}”(hjéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kóhjæubah}”(h]”h ]”h"]”h$]”h&]”uh1j�hjÔubeh}”(h]”h ]”h"]”h$]”h&]”uh1jzh³hÊh´Kòhj¢h²hubj{)�”}”(hŒ@len The length of the string. ”h]”(j�)�”}”(hŒ@len”h]”hŒ@len”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j€h³hÊh´Kõhjubj‘)�”}”(hhh]”j)�”}”(hŒThe length of the string.”h]”hŒThe length of the string.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kõhjubah}”(h]”h ]”h"]”h$]”h&]”uh1j�hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jzh³hÊh´Kõhj¢h²hubj{)�”}”(hŒB@reset Non-zero to reset all filters before applying this filter. ”h]”(j�)�”}”(hŒ@reset”h]”hŒ@reset”…”�”}”(hj6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j€h³hÊh´Køhj2ubj‘)�”}”(hhh]”j)�”}”(hŒ:Non-zero to reset all filters before applying this filter.”h]”hŒ:Non-zero to reset all filters before applying this filter.”…”�”}”(hjGh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KøhjDubah}”(h]”h ]”h"]”h$]”h&]”uh1j�hj2ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jzh³hÊh´Køhj¢h²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1juhjth²hh³hÊh´Nubj)�”}”(hŒ–Filters denote which functions should be enabled when tracing is enabled. If @buf is NULL and reset is set, all functions will be enabled for tracing.”h]”hŒ–Filters denote which functions should be enabled when tracing is enabled. If @buf is NULL and reset is set, all functions will be enabled for tracing.”…”�”}”(hjgh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kúhjth²hubj)�”}”(hŒ]The @buf can also be a glob expression to enable all functions that match a specific pattern.”h]”hŒ]The @buf can also be a glob expression to enable all functions that match a specific pattern.”…”�”}”(hjuh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Kýhjth²hubj)�”}”(hŒ6See Filter Commands in Documentation/trace/ftrace.rst.”h]”hŒ6See Filter Commands in Documentation/trace/ftrace.rst.”…”�”}”(hjƒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Mhjth²hubj)�”}”(hŒ$To just trace the schedule function:”h]”hŒ$To just trace the schedule function:”…”�”}”(hj‘h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Mhjth²hubj­)�”}”(hŒAret = ftrace_set_filter(&ops, "schedule", strlen("schedule"), 0);”h]”hŒAret = ftrace_set_filter(&ops, "schedule", strlen("schedule"), 0);”…”�”}”hjŸsbah}”(h]”h ]”h"]”h$]”h&]”hÛhÜj¼‰j½j¾j¿}”uh1j¬h³hÊh´Mhjth²hubj)�”}”(hŒÖTo add more functions, call the ftrace_set_filter() more than once with the @reset parameter set to zero. To remove the current filter set and replace it with new functions defined by @buf, have @reset be non-zero.”h]”hŒÖTo add more functions, call the ftrace_set_filter() more than once with the @reset parameter set to zero. To remove the current filter set and replace it with new functions defined by @buf, have @reset be non-zero.”…”�”}”(hj®h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Mhjth²hubj)�”}”(hŒ=To remove all the filtered functions and trace all functions:”h]”hŒ=To remove all the filtered functions and trace all functions:”…”�”}”(hj¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´M hjth²hubj­)�”}”(hŒ*ret = ftrace_set_filter(&ops, NULL, 0, 1);”h]”hŒ*ret = ftrace_set_filter(&ops, NULL, 0, 1);”…”�”}”hjÊsbah}”(h]”h ]”h"]”h$]”h&]”hÛhÜj¼‰j½j¾j¿}”uh1j¬h³hÊh´Mhjth²hubj)�”}”(hŒ‡Sometimes more than one function has the same name. To trace just a specific function in this case, ftrace_set_filter_ip() can be used.”h]”hŒ‡Sometimes more than one function has the same name. To trace just a specific function in this case, ftrace_set_filter_ip() can be used.”…”�”}”(hjÙh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Mhjth²hubj­)�”}”(hŒ+ret = ftrace_set_filter_ip(&ops, ip, 0, 0);”h]”hŒ+ret = ftrace_set_filter_ip(&ops, ip, 0, 0);”…”�”}”hjçsbah}”(h]”h ]”h"]”h$]”h&]”hÛhÜj¼‰j½j¾j¿}”uh1j¬h³hÊh´Mhjth²hubj)�”}”(hŒßAlthough the ip must be the address where the call to fentry or mcount is located in the function. This function is used by perf and kprobes that gets the ip address from the user (usually using debug info from the kernel).”h]”hŒßAlthough the ip must be the address where the call to fentry or mcount is located in the function. This function is used by perf and kprobes that gets the ip address from the user (usually using debug info from the kernel).”…”�”}”(hjöh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Mhjth²hubj)�”}”(hX8If a glob is used to set the filter, functions can be added to a "notrace" list that will prevent those functions from calling the callback. The "notrace" list takes precedence over the "filter" list. If the two lists are non-empty and contain the same functions, the callback will not be called by any function.”h]”hXDIf a glob is used to set the filter, functions can be added to a “notraceâ€� list that will prevent those functions from calling the callback. The “notraceâ€� list takes precedence over the “filterâ€� list. If the two lists are non-empty and contain the same functions, the callback will not be called by any function.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´Mhjth²hubj)�”}”(hŒXAn empty "notrace" list means to allow all functions defined by the filter to be traced.”h]”hŒ\An empty “notraceâ€� list means to allow all functions defined by the filter to be traced.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´M$hjth²hubj­)�”}”(hŒnint ftrace_set_notrace(struct ftrace_ops *ops, unsigned char *buf, int len, int reset);”h]”hŒnint ftrace_set_notrace(struct ftrace_ops *ops, unsigned char *buf, int len, int reset);”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”hÛhÜj¼‰j½j¾j¿}”uh1j¬h³hÊh´M'hjth²hubj)�”}”(hŒÌThis takes the same parameters as ftrace_set_filter() but will add the functions it finds to not be traced. This is a separate list from the filter list, and this function does not modify the filter list.”h]”hŒÌThis takes the same parameters as ftrace_set_filter() but will add the functions it finds to not be traced. This is a separate list from the filter list, and this function does not modify the filter list.”…”�”}”(hj/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´M,hjth²hubj)�”}”(hŒ^A non-zero @reset will clear the "notrace" list before adding functions that match @buf to it.”h]”hŒbA non-zero @reset will clear the “notraceâ€� list before adding functions that match @buf to it.”…”�”}”(hj=h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´M0hjth²hubj)�”}”(hŒCClearing the "notrace" list is the same as clearing the filter list”h]”hŒGClearing the “notraceâ€� list is the same as clearing the filter list”…”�”}”(hjKh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´M3hjth²hubj­)�”}”(hŒ+ret = ftrace_set_notrace(&ops, NULL, 0, 1);”h]”hŒ+ret = ftrace_set_notrace(&ops, NULL, 0, 1);”…”�”}”hjYsbah}”(h]”h ]”h"]”h$]”h&]”hÛhÜj¼‰j½j¾j¿}”uh1j¬h³hÊh´M5hjth²hubj)�”}”(hŒôThe filter and notrace lists may be changed at any time. If only a set of functions should call the callback, it is best to set the filters before registering the callback. But the changes may also happen after the callback has been registered.”h]”hŒôThe filter and notrace lists may be changed at any time. If only a set of functions should call the callback, it is best to set the filters before registering the callback. But the changes may also happen after the callback has been registered.”…”�”}”(hjhh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´M9hjth²hubj)�”}”(hŒÝIf a filter is in place, and the @reset is non-zero, and @buf contains a matching glob to functions, the switch will happen during the time of the ftrace_set_filter() call. At no time will all functions call the callback.”h]”hŒÝIf a filter is in place, and the @reset is non-zero, and @buf contains a matching glob to functions, the switch will happen during the time of the ftrace_set_filter() call. At no time will all functions call the callback.”…”�”}”(hjvh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´M>hjth²hubj­)�”}”(hŒ²ftrace_set_filter(&ops, "schedule", strlen("schedule"), 1); register_ftrace_function(&ops); msleep(10); ftrace_set_filter(&ops, "try_to_wake_up", strlen("try_to_wake_up"), 1);”h]”hŒ²ftrace_set_filter(&ops, "schedule", strlen("schedule"), 1); register_ftrace_function(&ops); msleep(10); ftrace_set_filter(&ops, "try_to_wake_up", strlen("try_to_wake_up"), 1);”…”�”}”hj„sbah}”(h]”h ]”h"]”h$]”h&]”hÛhÜj¼‰j½j¾j¿}”uh1j¬h³hÊh´MBhjth²hubj)�”}”(hŒis not the same as:”h]”hŒis not the same as:”…”�”}”(hj“h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´MLhjth²hubj­)�”}”(hŒØftrace_set_filter(&ops, "schedule", strlen("schedule"), 1); register_ftrace_function(&ops); msleep(10); ftrace_set_filter(&ops, NULL, 0, 1); ftrace_set_filter(&ops, "try_to_wake_up", strlen("try_to_wake_up"), 0);”h]”hŒØftrace_set_filter(&ops, "schedule", strlen("schedule"), 1); register_ftrace_function(&ops); msleep(10); ftrace_set_filter(&ops, NULL, 0, 1); ftrace_set_filter(&ops, "try_to_wake_up", strlen("try_to_wake_up"), 0);”…”�”}”hj¡sbah}”(h]”h ]”h"]”h$]”h&]”hÛhÜj¼‰j½j¾j¿}”uh1j¬h³hÊh´MNhjth²hubj)�”}”(hŒžAs the latter will have a short time where all functions will call the callback, between the time of the reset, and the time of the new setting of the filter.”h]”hŒžAs the latter will have a short time where all functions will call the callback, between the time of the reset, and the time of the new setting of the filter.”…”�”}”(hj°h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´MZhjth²hubeh}”(h]”Œ"filtering-which-functions-to-trace”ah ]”h"]”Œ"filtering which functions to trace”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kåubeh}”(h]”Œ!using-ftrace-to-hook-to-functions”ah ]”h"]”Œ!using ftrace to hook to functions”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;j8j|jyjDjAjGjDjájÞjqjnjÃjÀuŒ nametypes”}”(jˉj;‰j|‰jD‰jG‰já‰jq‰jÉuh}”(jÈh·j8jjyj>jAjjDjGjÞjJjnjäjÀjtuŒ 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.