€•pÜŒ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/process/debugging/userspace_debugging_guide”Œ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/process/debugging/userspace_debugging_guide”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ?/translations/it_IT/process/debugging/userspace_debugging_guide”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ?/translations/ja_JP/process/debugging/userspace_debugging_guide”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ?/translations/ko_KR/process/debugging/userspace_debugging_guide”Œ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/process/debugging/userspace_debugging_guide”Œ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/process/debugging/userspace_debugging_guide”Œ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³ŒY/var/lib/git/docbuild/linux/Documentation/process/debugging/userspace_debugging_guide.rst”h´KubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒUserspace debugging advice”h]”hŒUserspace debugging advice”…”�”}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefid”Œid1”uh1hÍhhÊh²hh³hÇh´KubhŒ paragraph”“”)�”}”(hX6This document provides a brief overview of common tools to debug the Linux Kernel from userspace. For debugging advice aimed at driver developers go :doc:`here `. For general debugging advice, see :doc:`general advice document `.”h]”(hŒ•This document provides a brief overview of common tools to debug the Linux Kernel from userspace. For debugging advice aimed at driver developers go ”…”�”}”(hháh²hh³Nh´Nubh)�”}”(hŒC:doc:`here `”h]”hŒinline”“”)�”}”(hhëh]”hŒhere”…”�”}”(hhïh²hh³Nh´Nubah}”(h]”h ]”(Œxref”Œstd”Œstd-doc”eh"]”h$]”h&]”uh1híhhéubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”Œ+process/debugging/userspace_debugging_guide”Œ refdomain”húŒreftype”Œdoc”Œ refexplicit”ˆŒrefwarn”ˆŒ reftarget”Œ5/process/debugging/driver_development_debugging_guide”uh1hh³hÇh´KhháubhŒ$. For general debugging advice, see ”…”�”}”(hháh²hh³Nh´Nubh)�”}”(hŒ9:doc:`general advice document `”h]”hî)�”}”(hjh]”hŒgeneral advice document”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”(hùŒstd”Œstd-doc”eh"]”h$]”h&]”uh1híhjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”j Œreftype”Œdoc”Œ refexplicit”ˆŒrefwarn”ˆj Œ/process/debugging/index”uh1hh³hÇh´KhháubhŒ.”…”�”}”(hháh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KhhÊh²hubhŒtopic”“”)�”}”(hŒ Contents ”h]”(hÎ)�”}”(hŒContents”h]”hŒContents”…”�”}”(hjBh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj>h³hÇh´KubhŒ bullet_list”“”)�”}”(hhh]”hŒ list_item”“”)�”}”(hhh]”(hà)�”}”(hhh]”hŒ reference”“”)�”}”(hhh]”hŒUserspace debugging advice”…”�”}”(hj_h²hh³Nh´Nubah}”(h]”hÞah ]”h"]”h$]”h&]”Œrefid”Œuserspace-debugging-advice”uh1j]hjZubah}”(h]”h ]”h"]”h$]”h&]”uh1hßhjWubjQ)�”}”(hhh]”(jV)�”}”(hhh]”hà)�”}”(hhh]”j^)�”}”(hhh]”hŒ Dynamic debug”…”�”}”(hj}h²hh³Nh´Nubah}”(h]”Œid2”ah ]”h"]”h$]”h&]”Œrefid”Œ dynamic-debug”uh1j]hjzubah}”(h]”h ]”h"]”h$]”h&]”uh1hßhjwubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhjtubjV)�”}”(hhh]”(hà)�”}”(hhh]”j^)�”}”(hhh]”hŒFtrace”…”�”}”(hjŸh²hh³Nh´Nubah}”(h]”Œid3”ah ]”h"]”h$]”h&]”Œrefid”Œftrace”uh1j]hjœubah}”(h]”h ]”h"]”h$]”h&]”uh1hßhj™ubjQ)�”}”(hhh]”(jV)�”}”(hhh]”hà)�”}”(hhh]”j^)�”}”(hhh]”hŒReading the ftrace log”…”�”}”(hj¾h²hh³Nh´Nubah}”(h]”Œid4”ah ]”h"]”h$]”h&]”Œrefid”Œreading-the-ftrace-log”uh1j]hj»ubah}”(h]”h ]”h"]”h$]”h&]”uh1hßhj¸ubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhjµubjV)�”}”(hhh]”hà)�”}”(hhh]”j^)�”}”(hhh]”hŒ Kernelshark”…”�”}”(hjàh²hh³Nh´Nubah}”(h]”Œid5”ah ]”h"]”h$]”h&]”Œrefid”Œ kernelshark”uh1j]hjÝubah}”(h]”h ]”h"]”h$]”h&]”uh1hßhjÚubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhjµubeh}”(h]”h ]”h"]”h$]”h&]”uh1jPhj™ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jUhjtubjV)�”}”(hhh]”(hà)�”}”(hhh]”j^)�”}”(hhh]”hŒPerf & alternatives”…”�”}”(hjh²hh³Nh´Nubah}”(h]”Œid6”ah ]”h"]”h$]”h&]”Œrefid”Œperf-alternatives”uh1j]hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1hßhjubjQ)�”}”(hhh]”(jV)�”}”(hhh]”hà)�”}”(hhh]”j^)�”}”(hhh]”hŒ)Why should you do a performance analysis?”…”�”}”(hj-h²hh³Nh´Nubah}”(h]”Œid7”ah ]”h"]”h$]”h&]”Œrefid”Œ(why-should-you-do-a-performance-analysis”uh1j]hj*ubah}”(h]”h ]”h"]”h$]”h&]”uh1hßhj'ubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhj$ubjV)�”}”(hhh]”hà)�”}”(hhh]”j^)�”}”(hhh]”hŒ-How to do a simple analysis with linux tools?”…”�”}”(hjOh²hh³Nh´Nubah}”(h]”Œid8”ah ]”h"]”h$]”h&]”Œrefid”Œ,how-to-do-a-simple-analysis-with-linux-tools”uh1j]hjLubah}”(h]”h ]”h"]”h$]”h&]”uh1hßhjIubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhj$ubjV)�”}”(hhh]”hà)�”}”(hhh]”j^)�”}”(hhh]”hŒDiving deeper with perf”…”�”}”(hjqh²hh³Nh´Nubah}”(h]”Œid9”ah ]”h"]”h$]”h&]”Œrefid”Œdiving-deeper-with-perf”uh1j]hjnubah}”(h]”h ]”h"]”h$]”h&]”uh1hßhjkubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhj$ubjV)�”}”(hhh]”hà)�”}”(hhh]”j^)�”}”(hhh]”hŒPerfetto”…”�”}”(hj“h²hh³Nh´Nubah}”(h]”Œid10”ah ]”h"]”h$]”h&]”Œrefid”Œperfetto”uh1j]hj�ubah}”(h]”h ]”h"]”h$]”h&]”uh1hßhj�ubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhj$ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jPhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jUhjtubjV)�”}”(hhh]”hà)�”}”(hhh]”j^)�”}”(hhh]”hŒKernel panic analysis tools”…”�”}”(hjÁh²hh³Nh´Nubah}”(h]”Œid11”ah ]”h"]”h$]”h&]”Œrefid”Œkernel-panic-analysis-tools”uh1j]hj¾ubah}”(h]”h ]”h"]”h$]”h&]”uh1hßhj»ubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhjtubeh}”(h]”h ]”h"]”h$]”h&]”uh1jPhjWubeh}”(h]”h ]”h"]”h$]”h&]”uh1jUhjRubah}”(h]”h ]”h"]”h$]”h&]”uh1jPhj>h²hh³Nh´Nubeh}”(h]”Œcontents”ah ]”Œcontents”ah"]”Œcontents”ah$]”h&]”uh1j<h³hÇh´KhhÊh²hubhà)�”}”(hŒ4The following sections show you the available tools.”h]”hŒ4The following sections show you the available tools.”…”�”}”(hjøh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KhhÊh²hubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ Dynamic debug”h]”hŒ Dynamic debug”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”hÝj†uh1hÍhjh²hh³hÇh´Kubhà)�”}”(hŒRMechanism to filter what ends up in the kernel log by dis-/en-abling log messages.”h]”hŒRMechanism to filter what ends up in the kernel log by dis-/en-abling log messages.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´Khjh²hubhà)�”}”(hŒ&Prerequisite: ``CONFIG_DYNAMIC_DEBUG``”h]”(hŒPrerequisite: ”…”�”}”(hj%h²hh³Nh´NubhŒliteral”“”)�”}”(hŒ``CONFIG_DYNAMIC_DEBUG``”h]”hŒCONFIG_DYNAMIC_DEBUG”…”�”}”(hj/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hj%ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´Khjh²hubhà)�”}”(hŒ%Dynamic debug is only able to target:”h]”hŒ%Dynamic debug is only able to target:”…”�”}”(hjCh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´Khjh²hubjQ)�”}”(hhh]”(jV)�”}”(hŒ pr_debug()”h]”hà)�”}”(hjVh]”hŒ pr_debug()”…”�”}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KhjTubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhjQh²hh³hÇh´NubjV)�”}”(hŒ dev_dbg()”h]”hà)�”}”(hjmh]”hŒ dev_dbg()”…”�”}”(hjoh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´Khjkubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhjQh²hh³hÇh´NubjV)�”}”(hŒprint_hex_dump_debug()”h]”hà)�”}”(hj„h]”hŒprint_hex_dump_debug()”…”�”}”(hj†h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´Khj‚ubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhjQh²hh³hÇh´NubjV)�”}”(hŒprint_hex_dump_bytes() ”h]”hà)�”}”(hŒprint_hex_dump_bytes()”h]”hŒprint_hex_dump_bytes()”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´K hj™ubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhjQh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1jPh³hÇh´Khjh²hubhà)�”}”(hŒÃTherefore the usability of this tool is, as of now, quite limited as there is no uniform rule for adding debug prints to the codebase, resulting in a variety of ways these prints are implemented.”h]”hŒÃTherefore the usability of this tool is, as of now, quite limited as there is no uniform rule for adding debug prints to the codebase, resulting in a variety of ways these prints are implemented.”…”�”}”(hj¹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´K"hjh²hubhà)�”}”(hŒÄAlso, note that most debug statements are implemented as a variation of dprintk(), which have to be activated via a parameter in respective module, dynamic debug is unable to do that step for you.”h]”hŒÄAlso, note that most debug statements are implemented as a variation of dprintk(), which have to be activated via a parameter in respective module, dynamic debug is unable to do that step for you.”…”�”}”(hjÇh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´K&hjh²hubhà)�”}”(hŒNHere is one example, that enables all available pr_debug()'s within the file::”h]”hŒOHere is one example, that enables all available pr_debug()’s within the file:”…”�”}”(hjÕh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´K*hjh²hubhŒ literal_block”“”)�”}”(hXY$ alias ddcmd='echo $* > /proc/dynamic_debug/control' $ ddcmd '-p; file v4l2-h264.c +p' $ grep =p /proc/dynamic_debug/control drivers/media/v4l2-core/v4l2-h264.c:372 [v4l2_h264]print_ref_list_b =p "ref_pic_list_b%u (cur_poc %u%c) %s" drivers/media/v4l2-core/v4l2-h264.c:333 [v4l2_h264]print_ref_list_p =p "ref_pic_list_p (cur_poc %u%c) %s\n"”h]”hXY$ alias ddcmd='echo $* > /proc/dynamic_debug/control' $ ddcmd '-p; file v4l2-h264.c +p' $ grep =p /proc/dynamic_debug/control drivers/media/v4l2-core/v4l2-h264.c:372 [v4l2_h264]print_ref_list_b =p "ref_pic_list_b%u (cur_poc %u%c) %s" drivers/media/v4l2-core/v4l2-h264.c:333 [v4l2_h264]print_ref_list_p =p "ref_pic_list_p (cur_poc %u%c) %s\n"”…”�”}”hjåsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jãh³hÇh´K,hjh²hubhà)�”}”(hŒ***When should you use this over Ftrace ?**”h]”hŒstrong”“”)�”}”(hjõh]”hŒ&When should you use this over Ftrace ?”…”�”}”(hjùh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j÷hjóubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´K4hjh²hubjQ)�”}”(hhh]”(jV)�”}”(hŒ�When the code contains one of the valid print statements (see above) or when you have added multiple pr_debug() statements during development”h]”hà)�”}”(hŒ�When the code contains one of the valid print statements (see above) or when you have added multiple pr_debug() statements during development”h]”hŒ�When the code contains one of the valid print statements (see above) or when you have added multiple pr_debug() statements during development”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´K6hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhj h²hh³hÇh´NubjV)�”}”(hŒeWhen timing is not an issue, meaning if multiple pr_debug() statements in the code won't cause delays”h]”hà)�”}”(hŒeWhen timing is not an issue, meaning if multiple pr_debug() statements in the code won't cause delays”h]”hŒgWhen timing is not an issue, meaning if multiple pr_debug() statements in the code won’t cause delays”…”�”}”(hj+h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´K8hj'ubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhj h²hh³hÇh´NubjV)�”}”(hŒnWhen you care more about receiving specific log messages than tracing the pattern of how a function is called ”h]”hà)�”}”(hŒmWhen you care more about receiving specific log messages than tracing the pattern of how a function is called”h]”hŒmWhen you care more about receiving specific log messages than tracing the pattern of how a function is called”…”�”}”(hjCh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´K:hj?ubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhj h²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”j·j¸uh1jPh³hÇh´K6hjh²hubhà)�”}”(hŒFFor the full documentation see :doc:`/admin-guide/dynamic-debug-howto`”h]”(hŒFor the full documentation see ”…”�”}”(hj]h²hh³Nh´Nubh)�”}”(hŒ':doc:`/admin-guide/dynamic-debug-howto`”h]”hî)�”}”(hjgh]”hŒ /admin-guide/dynamic-debug-howto”…”�”}”(hjih²hh³Nh´Nubah}”(h]”h ]”(hùŒstd”Œstd-doc”eh"]”h$]”h&]”uh1híhjeubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”jsŒreftype”Œdoc”Œ refexplicit”‰Œrefwarn”ˆj Œ /admin-guide/dynamic-debug-howto”uh1hh³hÇh´K=hj]ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´K=hjh²hubeh}”(h]”jŒah ]”h"]”Œ dynamic debug”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒFtrace”h]”hŒFtrace”…”�”}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”hÝj¨uh1hÍhj’h²hh³hÇh´K@ubhà)�”}”(hŒ'Prerequisite: ``CONFIG_DYNAMIC_FTRACE``”h]”(hŒPrerequisite: ”…”�”}”(hj£h²hh³Nh´Nubj.)�”}”(hŒ``CONFIG_DYNAMIC_FTRACE``”h]”hŒCONFIG_DYNAMIC_FTRACE”…”�”}”(hj«h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hj£ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KBhj’h²hubhà)�”}”(hŒÔThis tool uses the tracefs file system for the control files and output files. That file system will be mounted as a ``tracing`` directory, which can be found in either ``/sys/kernel/`` or ``/sys/debug/kernel/``.”h]”(hŒuThis tool uses the tracefs file system for the control files and output files. That file system will be mounted as a ”…”�”}”(hj¿h²hh³Nh´Nubj.)�”}”(hŒ ``tracing``”h]”hŒtracing”…”�”}”(hjÇh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hj¿ubhŒ) directory, which can be found in either ”…”�”}”(hj¿h²hh³Nh´Nubj.)�”}”(hŒ``/sys/kernel/``”h]”hŒ /sys/kernel/”…”�”}”(hjÙh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hj¿ubhŒ or ”…”�”}”(hj¿h²hh³Nh´Nubj.)�”}”(hŒ``/sys/debug/kernel/``”h]”hŒ/sys/debug/kernel/”…”�”}”(hjëh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hj¿ubhŒ.”…”�”}”(hj¿h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KDhj’h²hubhà)�”}”(hŒ8Some of the most important operations for debugging are:”h]”hŒ8Some of the most important operations for debugging are:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KHhj’h²hubjQ)�”}”(hhh]”(jV)�”}”(hXRYou can perform a function trace by adding a function name to the ``set_ftrace_filter`` file (which accepts any function name found within the ``available_filter_functions`` file) or you can specifically disable certain functions by adding their names to the ``set_ftrace_notrace`` file (more info at: :ref:`trace/ftrace:dynamic ftrace`).”h]”hà)�”}”(hXRYou can perform a function trace by adding a function name to the ``set_ftrace_filter`` file (which accepts any function name found within the ``available_filter_functions`` file) or you can specifically disable certain functions by adding their names to the ``set_ftrace_notrace`` file (more info at: :ref:`trace/ftrace:dynamic ftrace`).”h]”(hŒBYou can perform a function trace by adding a function name to the ”…”�”}”(hjh²hh³Nh´Nubj.)�”}”(hŒ``set_ftrace_filter``”h]”hŒset_ftrace_filter”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjubhŒ8 file (which accepts any function name found within the ”…”�”}”(hjh²hh³Nh´Nubj.)�”}”(hŒ``available_filter_functions``”h]”hŒavailable_filter_functions”…”�”}”(hj2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjubhŒV file) or you can specifically disable certain functions by adding their names to the ”…”�”}”(hjh²hh³Nh´Nubj.)�”}”(hŒ``set_ftrace_notrace``”h]”hŒset_ftrace_notrace”…”�”}”(hjDh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjubhŒ file (more info at: ”…”�”}”(hjh²hh³Nh´Nubh)�”}”(hŒ":ref:`trace/ftrace:dynamic ftrace`”h]”hî)�”}”(hjXh]”hŒtrace/ftrace:dynamic ftrace”…”�”}”(hjZh²hh³Nh´Nubah}”(h]”h ]”(hùŒstd”Œstd-ref”eh"]”h$]”h&]”uh1híhjVubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”jdŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj Œtrace/ftrace:dynamic ftrace”uh1hh³hÇh´KJhjubhŒ).”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KJhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhjh²hh³hÇh´NubjV)�”}”(hŒ„In order to find out where calls originate from you can activate the ``func_stack_trace`` option under ``options/func_stack_trace``.”h]”hà)�”}”(hŒ„In order to find out where calls originate from you can activate the ``func_stack_trace`` option under ``options/func_stack_trace``.”h]”(hŒEIn order to find out where calls originate from you can activate the ”…”�”}”(hjŠh²hh³Nh´Nubj.)�”}”(hŒ``func_stack_trace``”h]”hŒfunc_stack_trace”…”�”}”(hj’h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjŠubhŒ option under ”…”�”}”(hjŠh²hh³Nh´Nubj.)�”}”(hŒ``options/func_stack_trace``”h]”hŒoptions/func_stack_trace”…”�”}”(hj¤h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjŠubhŒ.”…”�”}”(hjŠh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KOhj†ubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhjh²hh³hÇh´NubjV)�”}”(hXTracing the children of a function call and showing the return values are possible by adding the desired function in the ``set_graph_function`` file (requires config ``FUNCTION_GRAPH_RETVAL``); more info at :ref:`trace/ftrace:dynamic ftrace with the function graph tracer`. ”h]”hà)�”}”(hXTracing the children of a function call and showing the return values are possible by adding the desired function in the ``set_graph_function`` file (requires config ``FUNCTION_GRAPH_RETVAL``); more info at :ref:`trace/ftrace:dynamic ftrace with the function graph tracer`.”h]”(hŒyTracing the children of a function call and showing the return values are possible by adding the desired function in the ”…”�”}”(hjÆh²hh³Nh´Nubj.)�”}”(hŒ``set_graph_function``”h]”hŒset_graph_function”…”�”}”(hjÎh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjÆubhŒ file (requires config ”…”�”}”(hjÆh²hh³Nh´Nubj.)�”}”(hŒ``FUNCTION_GRAPH_RETVAL``”h]”hŒFUNCTION_GRAPH_RETVAL”…”�”}”(hjàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjÆubhŒ); more info at ”…”�”}”(hjÆh²hh³Nh´Nubh)�”}”(hŒA:ref:`trace/ftrace:dynamic ftrace with the function graph tracer`”h]”hî)�”}”(hjôh]”hŒ:trace/ftrace:dynamic ftrace with the function graph tracer”…”�”}”(hjöh²hh³Nh´Nubah}”(h]”h ]”(hùŒstd”Œstd-ref”eh"]”h$]”h&]”uh1híhjòubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”jŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj Œ:trace/ftrace:dynamic ftrace with the function graph tracer”uh1hh³hÇh´KQhjÆubhŒ.”…”�”}”(hjÆh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KQhjÂubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhjh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”j·j¸uh1jPh³hÇh´KJhj’h²hubhà)�”}”(hŒ:For the full Ftrace documentation see :doc:`/trace/ftrace`”h]”(hŒ&For the full Ftrace documentation see ”…”�”}”(hj(h²hh³Nh´Nubh)�”}”(hŒ:doc:`/trace/ftrace`”h]”hî)�”}”(hj2h]”hŒ /trace/ftrace”…”�”}”(hj4h²hh³Nh´Nubah}”(h]”h ]”(hùŒstd”Œstd-doc”eh"]”h$]”h&]”uh1híhj0ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”j>Œreftype”Œdoc”Œ refexplicit”‰Œrefwarn”ˆj Œ /trace/ftrace”uh1hh³hÇh´KVhj(ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KVhj’h²hubhà)�”}”(hXOr you could also trace for specific events by :ref:`using event tracing `, which can be defined as described here: :ref:`Creating a custom Ftrace tracepoint `.”h]”(hŒ/Or you could also trace for specific events by ”…”�”}”(hjVh²hh³Nh´Nubh)�”}”(hŒ@:ref:`using event tracing `”h]”hî)�”}”(hj`h]”hŒusing event tracing”…”�”}”(hjbh²hh³Nh´Nubah}”(h]”h ]”(hùŒstd”Œstd-ref”eh"]”h$]”h&]”uh1híhj^ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”jlŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj Œ#trace/events:2. using event tracing”uh1hh³hÇh´KXhjVubhŒ*, which can be defined as described here: ”…”�”}”(hjVh²hh³Nh´Nubh)�”}”(hŒh:ref:`Creating a custom Ftrace tracepoint `”h]”hî)�”}”(hj„h]”hŒ#Creating a custom Ftrace tracepoint”…”�”}”(hj†h²hh³Nh´Nubah}”(h]”h ]”(hùŒstd”Œstd-ref”eh"]”h$]”h&]”uh1híhj‚ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”j�Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj Œ;process/debugging/driver_development_debugging_guide:ftrace”uh1hh³hÇh´KXhjVubhŒ.”…”�”}”(hjVh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KXhj’h²hubhà)�”}”(hŒHFor the full Ftrace event tracing documentation see :doc:`/trace/events`”h]”(hŒ4For the full Ftrace event tracing documentation see ”…”�”}”(hj¬h²hh³Nh´Nubh)�”}”(hŒ:doc:`/trace/events`”h]”hî)�”}”(hj¶h]”hŒ /trace/events”…”�”}”(hj¸h²hh³Nh´Nubah}”(h]”h ]”(hùŒstd”Œstd-doc”eh"]”h$]”h&]”uh1híhj´ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”jÂŒreftype”Œdoc”Œ refexplicit”‰Œrefwarn”ˆj Œ /trace/events”uh1hh³hÇh´K]hj¬ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´K]hj’h²hubhŒtarget”“”)�”}”(hŒ.. _read_ftrace_log:”h]”h}”(h]”h ]”h"]”h$]”h&]”hÝŒread-ftrace-log”uh1jÚh´K_hj’h²hh³hÇubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒReading the ftrace log”h]”hŒReading the ftrace log”…”�”}”(hjêh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”hÝjÇuh1hÍhjçh²hh³hÇh´Kbubhà)�”}”(hXNThe ``trace`` file can be read just like any other file (``cat``, ``tail``, ``head``, ``vim``, etc.), the size of the file is limited by the ``buffer_size_kb`` (``echo 1000 > buffer_size_kb``). The :ref:`trace/ftrace:trace_pipe` will behave similarly to the ``trace`` file, but whenever you read from the file the content is consumed.”h]”(hŒThe ”…”�”}”(hjøh²hh³Nh´Nubj.)�”}”(hŒ ``trace``”h]”hŒtrace”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjøubhŒ, file can be read just like any other file (”…”�”}”(hjøh²hh³Nh´Nubj.)�”}”(hŒ``cat``”h]”hŒcat”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjøubhŒ, ”…”�”}”(hjøh²hh³Nh´Nubj.)�”}”(hŒ``tail``”h]”hŒtail”…”�”}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjøubhŒ, ”…”�”}”(hjøh²hh³Nh´Nubj.)�”}”(hŒ``head``”h]”hŒhead”…”�”}”(hj6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjøubhŒ, ”…”�”}”hjøsbj.)�”}”(hŒ``vim``”h]”hŒvim”…”�”}”(hjHh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjøubhŒ0, etc.), the size of the file is limited by the ”…”�”}”(hjøh²hh³Nh´Nubj.)�”}”(hŒ``buffer_size_kb``”h]”hŒbuffer_size_kb”…”�”}”(hjZh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjøubhŒ (”…”�”}”(hjøh²hh³Nh´Nubj.)�”}”(hŒ``echo 1000 > buffer_size_kb``”h]”hŒecho 1000 > buffer_size_kb”…”�”}”(hjlh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjøubhŒ). The ”…”�”}”(hjøh²hh³Nh´Nubh)�”}”(hŒ:ref:`trace/ftrace:trace_pipe`”h]”hî)�”}”(hj€h]”hŒtrace/ftrace:trace_pipe”…”�”}”(hj‚h²hh³Nh´Nubah}”(h]”h ]”(hùŒstd”Œstd-ref”eh"]”h$]”h&]”uh1híhj~ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”jŒŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj Œtrace/ftrace:trace_pipe”uh1hh³hÇh´KdhjøubhŒ will behave similarly to the ”…”�”}”(hjøh²hh³Nh´Nubj.)�”}”(hŒ ``trace``”h]”hŒtrace”…”�”}”(hj¢h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjøubhŒC file, but whenever you read from the file the content is consumed.”…”�”}”(hjøh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´Kdhjçh²hubeh}”(h]”(jÍjæeh ]”h"]”(Œreading the ftrace log”Œread_ftrace_log”eh$]”h&]”uh1hÈhj’h²hh³hÇh´KbŒexpect_referenced_by_name”}”j¿jÜsŒexpect_referenced_by_id”}”jæjÜsubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ Kernelshark”h]”hŒ Kernelshark”…”�”}”(hjÉh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”hÝjéuh1hÍhjÆh²hh³hÇh´Kkubhà)�”}”(hŒ²A GUI interface to visualize the traces as a graph and list view from the output of the `trace-cmd `__ application.”h]”(hŒXA GUI interface to visualize the traces as a graph and list view from the output of the ”…”�”}”(hj×h²hh³Nh´Nubj^)�”}”(hŒM`trace-cmd `__”h]”hŒ trace-cmd”…”�”}”(hjßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œ trace-cmd”Œrefuri”Œ=https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/”uh1j]hj×ubhŒ application.”…”�”}”(hj×h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KmhjÆh²hubhà)�”}”(hŒOFor the full documentation see ``__”h]”(hŒFor the full documentation see ”…”�”}”(hjûh²hh³Nh´Nubj^)�”}”(hŒ0``__”h]”hŒ*https://kernelshark.org/Documentation.html”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œ*https://kernelshark.org/Documentation.html”jïjuh1j]hjûubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KqhjÆh²hubeh}”(h]”jïah ]”h"]”Œ kernelshark”ah$]”h&]”uh1hÈhj’h²hh³hÇh´Kkubeh}”(h]”j®ah ]”h"]”Œftrace”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K@ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒPerf & alternatives”h]”hŒPerf & alternatives”…”�”}”(hj*h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”hÝjuh1hÍhj'h²hh³hÇh´Ktubhà)�”}”(hŒêThe tools mentioned above provide ways to inspect kernel code, results, variable values, etc. Sometimes you have to find out first where to look and for those cases, a box of performance tracking tools can help you to frame the issue.”h]”hŒêThe tools mentioned above provide ways to inspect kernel code, results, variable values, etc. Sometimes you have to find out first where to look and for those cases, a box of performance tracking tools can help you to frame the issue.”…”�”}”(hj8h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´Kvhj'h²hubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ)Why should you do a performance analysis?”h]”hŒ)Why should you do a performance analysis?”…”�”}”(hjIh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”hÝj6uh1hÍhjFh²hh³hÇh´K|ubhà)�”}”(hŒEA performance analysis is a good first step when among other reasons:”h]”hŒEA performance analysis is a good first step when among other reasons:”…”�”}”(hjWh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´K~hjFh²hubjQ)�”}”(hhh]”(jV)�”}”(hŒyou cannot define the issue”h]”hà)�”}”(hjjh]”hŒyou cannot define the issue”…”�”}”(hjlh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´K€hjhubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhjeh²hh³hÇh´NubjV)�”}”(hŒyou do not know where it occurs”h]”hà)�”}”(hj�h]”hŒyou do not know where it occurs”…”�”}”(hjƒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´K�hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhjeh²hh³hÇh´NubjV)�”}”(hŒtthe running system should not be interrupted or it is a remote system, where you cannot install a new module/kernel ”h]”hà)�”}”(hŒsthe running system should not be interrupted or it is a remote system, where you cannot install a new module/kernel”h]”hŒsthe running system should not be interrupted or it is a remote system, where you cannot install a new module/kernel”…”�”}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´K‚hj–ubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhjeh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”j·j¸uh1jPh³hÇh´K€hjFh²hubeh}”(h]”j<ah ]”h"]”Œ)why should you do a performance analysis?”ah$]”h&]”uh1hÈhj'h²hh³hÇh´K|ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ-How to do a simple analysis with linux tools?”h]”hŒ-How to do a simple analysis with linux tools?”…”�”}”(hj¾h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”hÝjXuh1hÍhj»h²hh³hÇh´K†ubhà)�”}”(hŒQFor the start of a performance analysis, you can start with the usual tools like:”h]”hŒQFor the start of a performance analysis, you can start with the usual tools like:”…”�”}”(hjÌh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´Kˆhj»h²hubjQ)�”}”(hhh]”(jV)�”}”(hŒf``top`` / ``htop`` / ``atop`` (*get an overview of the system load, see spikes on specific processes*)”h]”hà)�”}”(hŒf``top`` / ``htop`` / ``atop`` (*get an overview of the system load, see spikes on specific processes*)”h]”(j.)�”}”(hŒ``top``”h]”hŒtop”…”�”}”(hjåh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjáubhŒ / ”…”�”}”(hjáh²hh³Nh´Nubj.)�”}”(hŒ``htop``”h]”hŒhtop”…”�”}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjáubhŒ / ”…”�”}”hjásbj.)�”}”(hŒ``atop``”h]”hŒatop”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjáubhŒ (”…”�”}”(hjáh²hh³Nh´NubhŒemphasis”“”)�”}”(hŒF*get an overview of the system load, see spikes on specific processes*”h]”hŒDget an overview of the system load, see spikes on specific processes”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjáubhŒ)”…”�”}”(hjáh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´K‹hjÝubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhjÚh²hh³hÇh´NubjV)�”}”(hŒ>``mpstat -P ALL`` (*look at the load distribution among CPUs*)”h]”hà)�”}”(hj= h]”(j.)�”}”(hŒ``mpstat -P ALL``”h]”hŒ mpstat -P ALL”…”�”}”(hjB h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hj? ubhŒ (”…”�”}”(hj? h²hh³Nh´Nubj )�”}”(hŒ**look at the load distribution among CPUs*”h]”hŒ(look at the load distribution among CPUs”…”�”}”(hjT h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj? ubhŒ)”…”�”}”(hj? h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´K�hj; ubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhjÚh²hh³hÇh´NubjV)�”}”(hŒN``iostat -x`` (*observe input and output devices utilization and performance*)”h]”hà)�”}”(hjt h]”(j.)�”}”(hŒ ``iostat -x``”h]”hŒ iostat -x”…”�”}”(hjy h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjv ubhŒ (”…”�”}”(hjv h²hh³Nh´Nubj )�”}”(hŒ>*observe input and output devices utilization and performance*”h]”hŒ LLC-loads LLC-load-misses 1.281746009 seconds time elapsed 0.508796000 seconds user 0.773209000 seconds sys 52”h]”hX# perf stat -d find /usr -name 'gcc*' | wc -l Performance counter stats for 'find /usr -name gcc*': 1277.81 msec task-clock # 0.997 CPUs utilized 9 context-switches # 7.043 /sec 1 cpu-migrations # 0.783 /sec 704 page-faults # 550.943 /sec 766548897 cycles # 0.600 GHz (97.15%) 798285467 instructions # 1.04 insn per cycle (97.15%) 57582731 branches # 45.064 M/sec (2.85%) 3842573 branch-misses # 6.67% of all branches (97.15%) 281616097 L1-dcache-loads # 220.390 M/sec (97.15%) 4220975 L1-dcache-load-misses # 1.50% of all L1-dcache accesses (97.15%) LLC-loads LLC-load-misses 1.281746009 seconds time elapsed 0.508796000 seconds user 0.773209000 seconds sys 52”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jãh³hÇh´K¡hj� h²hubhà)�”}”(hŒMThe availability of events and metrics depends on the system you are running.”h]”hŒMThe availability of events and metrics depends on the system you are running.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´Kºhj� h²hubhà)�”}”(hŒUFor the full documentation see ``__”h]”(hŒFor the full documentation see ”…”�”}”(hj h²hh³Nh´Nubj^)�”}”(hŒ6``__”h]”hŒ0https://perf.wiki.kernel.org/index.php/Main_Page”…”�”}”(hj$ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œ0https://perf.wiki.kernel.org/index.php/Main_Page”jïj3 uh1j]hj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´K¼hj� h²hubeh}”(h]”j€ah ]”h"]”Œdiving deeper with perf”ah$]”h&]”uh1hÈhj'h²hh³hÇh´K˜ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒPerfetto”h]”hŒPerfetto”…”�”}”(hjD h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”hÝjœuh1hÍhjA h²hh³hÇh´KÀubhà)�”}”(hŒcA set of tools to measure and analyze how well applications and systems perform. You can use it to:”h]”hŒcA set of tools to measure and analyze how well applications and systems perform. You can use it to:”…”�”}”(hjR h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KÂhjA h²hubjQ)�”}”(hhh]”(jV)�”}”(hŒidentify bottlenecks”h]”hà)�”}”(hje h]”hŒidentify bottlenecks”…”�”}”(hjg h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KÅhjc ubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhj` h²hh³hÇh´NubjV)�”}”(hŒ optimize code”h]”hà)�”}”(hj| h]”hŒ optimize code”…”�”}”(hj~ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KÆhjz ubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhj` h²hh³hÇh´NubjV)�”}”(hŒ/make software run faster and more efficiently. ”h]”hà)�”}”(hŒ.make software run faster and more efficiently.”h]”hŒ.make software run faster and more efficiently.”…”�”}”(hj• h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KÇhj‘ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhj` h²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”j·Œ*”uh1jPh³hÇh´KÅhjA h²hubhà)�”}”(hŒ5**What is the difference between perfetto and perf?**”h]”jø)�”}”(hj² h]”hŒ1What is the difference between perfetto and perf?”…”�”}”(hj´ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j÷hj° ubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KÉhjA h²hubjQ)�”}”(hhh]”(jV)�”}”(hŒXperf is tool as part of and specialized for the Linux Kernel and has CLI user interface.”h]”hà)�”}”(hŒXperf is tool as part of and specialized for the Linux Kernel and has CLI user interface.”h]”hŒXperf is tool as part of and specialized for the Linux Kernel and has CLI user interface.”…”�”}”(hjÎ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KËhjÊ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhjÇ h²hh³hÇh´NubjV)�”}”(hŒ�perfetto cross-platform performance analysis stack, has extended functionality into userspace and provides a WEB user interface. ”h]”hà)�”}”(hŒ€perfetto cross-platform performance analysis stack, has extended functionality into userspace and provides a WEB user interface.”h]”hŒ€perfetto cross-platform performance analysis stack, has extended functionality into userspace and provides a WEB user interface.”…”�”}”(hjæ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KÍhjâ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jUhjÇ h²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”j·j¯ uh1jPh³hÇh´KËhjA h²hubhà)�”}”(hŒ?For the full documentation see ``__”h]”(hŒFor the full documentation see ”…”�”}”(hj h²hh³Nh´Nubj^)�”}”(hŒ ``__”h]”hŒhttps://perfetto.dev/docs/”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œhttps://perfetto.dev/docs/”jïj uh1j]hj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KÐhjA h²hubeh}”(h]”j¢ah ]”h"]”Œperfetto”ah$]”h&]”uh1hÈhj'h²hh³hÇh´KÀubeh}”(h]”jah ]”h"]”Œperf & alternatives”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KtubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒKernel panic analysis tools”h]”hŒKernel panic analysis tools”…”�”}”(hj/ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”hÝjÊuh1hÍhj, h²hh³hÇh´KÓubhŒ block_quote”“”)�”}”(hX To capture the crash dump please use ``Kdump`` & ``Kexec``. Below you can find some advice for analysing the data. For the full documentation see the :doc:`/admin-guide/kdump/kdump` In order to find the corresponding line in the code you can use `faddr2line `__; note that you need to enable ``CONFIG_DEBUG_INFO`` for that to work. An alternative to using ``faddr2line`` is the use of ``objdump`` (and its derivatives for the different platforms like ``aarch64-linux-gnu-objdump``). Take this line as an example: ``[ +0.000240] rkvdec_device_run+0x50/0x138 [rockchip_vdec]``. We can find the corresponding line of code by executing:: aarch64-linux-gnu-objdump -dS drivers/staging/media/rkvdec/rockchip-vdec.ko | grep rkvdec_device_run\>: -A 40 0000000000000ac8 : ac8: d503201f nop acc: d503201f nop { ad0: d503233f paciasp ad4: a9bd7bfd stp x29, x30, [sp, #-48]! ad8: 910003fd mov x29, sp adc: a90153f3 stp x19, x20, [sp, #16] ae0: a9025bf5 stp x21, x22, [sp, #32] const struct rkvdec_coded_fmt_desc *desc = ctx->coded_fmt_desc; ae4: f9411814 ldr x20, [x0, #560] struct rkvdec_dev *rkvdec = ctx->dev; ae8: f9418015 ldr x21, [x0, #768] if (WARN_ON(!desc)) aec: b4000654 cbz x20, bb4 ret = pm_runtime_resume_and_get(rkvdec->dev); af0: f943d2b6 ldr x22, [x21, #1952] ret = __pm_runtime_resume(dev, RPM_GET_PUT); af4: aa0003f3 mov x19, x0 af8: 52800081 mov w1, #0x4 // #4 afc: aa1603e0 mov x0, x22 b00: 94000000 bl 0 <__pm_runtime_resume> if (ret < 0) { b04: 37f80340 tbnz w0, #31, b6c dev_warn(rkvdec->dev, "Not good\n"); b08: f943d2a0 ldr x0, [x21, #1952] b0c: 90000001 adrp x1, 0 b10: 91000021 add x1, x1, #0x0 b14: 94000000 bl 0 <_dev_warn> *bad = 1; b18: d2800001 mov x1, #0x0 // #0 ... Meaning, in this line from the crash dump:: [ +0.000240] rkvdec_device_run+0x50/0x138 [rockchip_vdec] I can take the ``0x50`` as offset, which I have to add to the base address of the corresponding function, which I find in this line:: 0000000000000ac8 : The result of ``0xac8 + 0x50 = 0xb18`` And when I search for that address within the function I get the following line:: *bad = 1; b18: d2800001 mov x1, #0x0 ”h]”(hà)�”}”(hŒrTo capture the crash dump please use ``Kdump`` & ``Kexec``. Below you can find some advice for analysing the data.”h]”(hŒ%To capture the crash dump please use ”…”�”}”(hjC h²hh³Nh´Nubj.)�”}”(hŒ ``Kdump``”h]”hŒKdump”…”�”}”(hjK h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjC ubhŒ & ”…”�”}”(hjC h²hh³Nh´Nubj.)�”}”(hŒ ``Kexec``”h]”hŒKexec”…”�”}”(hj] h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjC ubhŒ8. Below you can find some advice for analysing the data.”…”�”}”(hjC h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KÕhj? ubhà)�”}”(hŒBFor the full documentation see the :doc:`/admin-guide/kdump/kdump`”h]”(hŒ#For the full documentation see the ”…”�”}”(hju h²hh³Nh´Nubh)�”}”(hŒ:doc:`/admin-guide/kdump/kdump`”h]”hî)�”}”(hj h]”hŒ/admin-guide/kdump/kdump”…”�”}”(hj� h²hh³Nh´Nubah}”(h]”h ]”(hùŒstd”Œstd-doc”eh"]”h$]”h&]”uh1híhj} ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jŒ refdomain”j‹ Œreftype”Œdoc”Œ refexplicit”‰Œrefwarn”ˆj Œ/admin-guide/kdump/kdump”uh1hh³hÇh´KØhju ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KØhj? ubhà)�”}”(hŒÙIn order to find the corresponding line in the code you can use `faddr2line `__; note that you need to enable ``CONFIG_DEBUG_INFO`` for that to work.”h]”(hŒ@In order to find the corresponding line in the code you can use ”…”�”}”(hj£ h²hh³Nh´Nubj^)�”}”(hŒS`faddr2line `__”h]”hŒ faddr2line”…”�”}”(hj« h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”Œ faddr2line”jïŒBhttps://elixir.bootlin.com/linux/v6.11.6/source/scripts/faddr2line”uh1j]hj£ ubhŒ; note that you need to enable ”…”�”}”(hj£ h²hh³Nh´Nubj.)�”}”(hŒ``CONFIG_DEBUG_INFO``”h]”hŒCONFIG_DEBUG_INFO”…”�”}”(hjÀ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hj£ ubhŒ for that to work.”…”�”}”(hj£ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KÚhj? ubhà)�”}”(hŒ´An alternative to using ``faddr2line`` is the use of ``objdump`` (and its derivatives for the different platforms like ``aarch64-linux-gnu-objdump``). Take this line as an example:”h]”(hŒAn alternative to using ”…”�”}”(hjØ h²hh³Nh´Nubj.)�”}”(hŒ``faddr2line``”h]”hŒ faddr2line”…”�”}”(hjà h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjØ ubhŒ is the use of ”…”�”}”(hjØ h²hh³Nh´Nubj.)�”}”(hŒ ``objdump``”h]”hŒobjdump”…”�”}”(hjò h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjØ ubhŒ7 (and its derivatives for the different platforms like ”…”�”}”(hjØ h²hh³Nh´Nubj.)�”}”(hŒ``aarch64-linux-gnu-objdump``”h]”hŒaarch64-linux-gnu-objdump”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjØ ubhŒ ). Take this line as an example:”…”�”}”(hjØ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´KÞhj? ubhà)�”}”(hŒ@``[ +0.000240] rkvdec_device_run+0x50/0x138 [rockchip_vdec]``.”h]”(j.)�”}”(hŒ?``[ +0.000240] rkvdec_device_run+0x50/0x138 [rockchip_vdec]``”h]”hŒ;[ +0.000240] rkvdec_device_run+0x50/0x138 [rockchip_vdec]”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hj ubhŒ.”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´Kâhj? ubhà)�”}”(hŒ9We can find the corresponding line of code by executing::”h]”hŒ8We can find the corresponding line of code by executing:”…”�”}”(hj8 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´Kähj? ubjä)�”}”(hX5aarch64-linux-gnu-objdump -dS drivers/staging/media/rkvdec/rockchip-vdec.ko | grep rkvdec_device_run\>: -A 40 0000000000000ac8 : ac8: d503201f nop acc: d503201f nop { ad0: d503233f paciasp ad4: a9bd7bfd stp x29, x30, [sp, #-48]! ad8: 910003fd mov x29, sp adc: a90153f3 stp x19, x20, [sp, #16] ae0: a9025bf5 stp x21, x22, [sp, #32] const struct rkvdec_coded_fmt_desc *desc = ctx->coded_fmt_desc; ae4: f9411814 ldr x20, [x0, #560] struct rkvdec_dev *rkvdec = ctx->dev; ae8: f9418015 ldr x21, [x0, #768] if (WARN_ON(!desc)) aec: b4000654 cbz x20, bb4 ret = pm_runtime_resume_and_get(rkvdec->dev); af0: f943d2b6 ldr x22, [x21, #1952] ret = __pm_runtime_resume(dev, RPM_GET_PUT); af4: aa0003f3 mov x19, x0 af8: 52800081 mov w1, #0x4 // #4 afc: aa1603e0 mov x0, x22 b00: 94000000 bl 0 <__pm_runtime_resume> if (ret < 0) { b04: 37f80340 tbnz w0, #31, b6c dev_warn(rkvdec->dev, "Not good\n"); b08: f943d2a0 ldr x0, [x21, #1952] b0c: 90000001 adrp x1, 0 b10: 91000021 add x1, x1, #0x0 b14: 94000000 bl 0 <_dev_warn> *bad = 1; b18: d2800001 mov x1, #0x0 // #0 ...”h]”hX5aarch64-linux-gnu-objdump -dS drivers/staging/media/rkvdec/rockchip-vdec.ko | grep rkvdec_device_run\>: -A 40 0000000000000ac8 : ac8: d503201f nop acc: d503201f nop { ad0: d503233f paciasp ad4: a9bd7bfd stp x29, x30, [sp, #-48]! ad8: 910003fd mov x29, sp adc: a90153f3 stp x19, x20, [sp, #16] ae0: a9025bf5 stp x21, x22, [sp, #32] const struct rkvdec_coded_fmt_desc *desc = ctx->coded_fmt_desc; ae4: f9411814 ldr x20, [x0, #560] struct rkvdec_dev *rkvdec = ctx->dev; ae8: f9418015 ldr x21, [x0, #768] if (WARN_ON(!desc)) aec: b4000654 cbz x20, bb4 ret = pm_runtime_resume_and_get(rkvdec->dev); af0: f943d2b6 ldr x22, [x21, #1952] ret = __pm_runtime_resume(dev, RPM_GET_PUT); af4: aa0003f3 mov x19, x0 af8: 52800081 mov w1, #0x4 // #4 afc: aa1603e0 mov x0, x22 b00: 94000000 bl 0 <__pm_runtime_resume> if (ret < 0) { b04: 37f80340 tbnz w0, #31, b6c dev_warn(rkvdec->dev, "Not good\n"); b08: f943d2a0 ldr x0, [x21, #1952] b0c: 90000001 adrp x1, 0 b10: 91000021 add x1, x1, #0x0 b14: 94000000 bl 0 <_dev_warn> *bad = 1; b18: d2800001 mov x1, #0x0 // #0 ...”…”�”}”hjF sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jãh³hÇh´Kæhj? ubhà)�”}”(hŒ+Meaning, in this line from the crash dump::”h]”hŒ*Meaning, in this line from the crash dump:”…”�”}”(hjT h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´Mhj? ubjä)�”}”(hŒ;[ +0.000240] rkvdec_device_run+0x50/0x138 [rockchip_vdec]”h]”hŒ;[ +0.000240] rkvdec_device_run+0x50/0x138 [rockchip_vdec]”…”�”}”hjb sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jãh³hÇh´M hj? ubhà)�”}”(hŒ…I can take the ``0x50`` as offset, which I have to add to the base address of the corresponding function, which I find in this line::”h]”(hŒI can take the ”…”�”}”(hjp h²hh³Nh´Nubj.)�”}”(hŒ``0x50``”h]”hŒ0x50”…”�”}”(hjx h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjp ubhŒm as offset, which I have to add to the base address of the corresponding function, which I find in this line:”…”�”}”(hjp h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´M hj? ubjä)�”}”(hŒ%0000000000000ac8 :”h]”hŒ%0000000000000ac8 :”…”�”}”hj� sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jãh³hÇh´Mhj? ubhà)�”}”(hŒxThe result of ``0xac8 + 0x50 = 0xb18`` And when I search for that address within the function I get the following line::”h]”(hŒThe result of ”…”�”}”(hjž h²hh³Nh´Nubj.)�”}”(hŒ``0xac8 + 0x50 = 0xb18``”h]”hŒ0xac8 + 0x50 = 0xb18”…”�”}”(hj¦ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j-hjž ubhŒQ And when I search for that address within the function I get the following line:”…”�”}”(hjž h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´Mhj? ubjä)�”}”(hŒ4*bad = 1; b18: d2800001 mov x1, #0x0”h]”hŒ4*bad = 1; b18: d2800001 mov x1, #0x0”…”�”}”hj¾ sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jãh³hÇh´Mhj? ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j= h³hÇh´KÕhj, h²hubhà)�”}”(hŒ **Copyright** ©2024 : Collabora”h]”(jø)�”}”(hŒ **Copyright**”h]”hŒ Copyright”…”�”}”(hjÖ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j÷hjÒ ubhŒ ©2024 : Collabora”…”�”}”(hjÒ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hßh³hÇh´Mhj, h²hubeh}”(h]”jÐah ]”h"]”Œkernel panic analysis tools”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KÓubeh}”(h]”jmah ]”h"]”Œuserspace debugging advice”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”}”jæ]”jÜasŒnameids”}”(jù jmjõjñj�jŒj$j®j¿jæj¾jÍjjïj) jj¸j<jŒ j^j> j€j" j¢jò jÐuŒ nametypes”}”(jù ‰jõ‰j�‰j$‰j¿ˆj¾‰j‰j) ‰j¸‰jŒ ‰j> ‰j" ‰jò ‰uh}”(jmhÊjñj>jŒjj®j’jæjçjÍjçjïjÆjj'j<jFj^j»j€j� j¢jA jÐj, hÞj_j†j}j¨jŸjÇj¾jéjàjjj6j-jXjOjzjqjœj“jÊjÁuŒ 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”“”}”j-K s…”R”Œparse_messages”]”Œtransform_messages”]”hŒsystem_message”“”)�”}”(hhh]”hà)�”}”(hhh]”hŒ5Hyperlink target "read-ftrace-log" is not referenced.”…”�”}”hj‰sbah}”(h]”h ]”h"]”h$]”h&]”uh1hßhj†ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œsource”hÇŒline”K_uh1j„ubaŒ transformer”NŒ include_log”]”Œ decoration”Nh²hub.