€•ìiŒ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/debugging”Œ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/debugging”Œ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/debugging”Œ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/debugging”Œ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/debugging”Œ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/debugging”Œ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/debugging”Œ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 the tracer for debugging”h]”hŒUsing the tracer for debugging”…””}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³Œ=/var/lib/git/docbuild/linux/Documentation/trace/debugging.rst”h´KubhŒ paragraph”“”)”}”(hŒCopyright 2024 Google LLC.”h]”hŒCopyright 2024 Google LLC.”…””}”(hhÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhŒ field_list”“”)”}”(hhh]”(hŒfield”“”)”}”(hhh]”(hŒ field_name”“”)”}”(hŒAuthor”h]”hŒAuthor”…””}”(hhçh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1håhhâh³hÊh´KubhŒ field_body”“”)”}”(hŒ$Steven Rostedt ”h]”hÌ)”}”(hhùh]”(hŒSteven Rostedt <”…””}”(hhûh²hh³Nh´NubhŒ reference”“”)”}”(hŒrostedt@goodmis.org”h]”hŒrostedt@goodmis.org”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:rostedt@goodmis.org”uh1jhhûubhŒ>”…””}”(hhûh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh÷ubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhhâubeh}”(h]”h ]”h"]”h$]”h&]”uh1hàh³hÊh´KhhÝh²hubhá)”}”(hhh]”(hæ)”}”(hŒLicense”h]”hŒLicense”…””}”(hj-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1håhj*h³hÊh´Kubhö)”}”(hŒQThe GNU Free Documentation License, Version 1.2 (dual licensed under the GPL v2) ”h]”hÌ)”}”(hŒPThe GNU Free Documentation License, Version 1.2 (dual licensed under the GPL v2)”h]”hŒPThe GNU Free Documentation License, Version 1.2 (dual licensed under the GPL v2)”…””}”(hj?h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khj;ubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhj*ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hàh³hÊh´KhhÝh²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÛhh·h²hh³hÊh´KubhŒ bullet_list”“”)”}”(hhh]”hŒ list_item”“”)”}”(hŒWritten for: 6.12 ”h]”hÌ)”}”(hŒWritten for: 6.12”h]”hŒWritten for: 6.12”…””}”(hjjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K hjfubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjah²hh³hÊh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1j_h³hÊh´K hh·h²hubh¶)”}”(hhh]”(h»)”}”(hŒ Introduction”h]”hŒ Introduction”…””}”(hj‰h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj†h²hh³hÊh´KubhÌ)”}”(hŒ The tracing infrastructure can be very useful for debugging the Linux kernel. This document is a place to add various methods of using the tracer for debugging.”h]”hŒ The tracing infrastructure can be very useful for debugging the Linux kernel. This document is a place to add various methods of using the tracer for debugging.”…””}”(hj—h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khj†h²hubhÌ)”}”(hŒ:First, make sure that the tracefs file system is mounted::”h]”hŒ9First, make sure that the tracefs file system is mounted:”…””}”(hj¥h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khj†h²hubhŒ literal_block”“”)”}”(hŒ3$ sudo mount -t tracefs tracefs /sys/kernel/tracing”h]”hŒ3$ sudo mount -t tracefs tracefs /sys/kernel/tracing”…””}”hjµsbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1j³h³hÊh´Khj†h²hubeh}”(h]”Œ introduction”ah ]”h"]”Œ introduction”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)”}”(hhh]”(h»)”}”(hŒUsing trace_printk()”h]”hŒUsing trace_printk()”…””}”(hjÐh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjÍh²hh³hÊh´KubhÌ)”}”(hXktrace_printk() is a very lightweight utility that can be used in any context inside the kernel, with the exception of "noinstr" sections. It can be used in normal, softirq, interrupt and even NMI context. The trace data is written to the tracing ring buffer in a lockless way. To make it even lighter weight, when possible, it will only record the pointer to the format string, and save the raw arguments into the buffer. The format and the arguments will be post processed when the ring buffer is read. This way the trace_printk() format conversions are not done during the hot path, where the trace is being recorded.”h]”hXotrace_printk() is a very lightweight utility that can be used in any context inside the kernel, with the exception of “noinstr†sections. It can be used in normal, softirq, interrupt and even NMI context. The trace data is written to the tracing ring buffer in a lockless way. To make it even lighter weight, when possible, it will only record the pointer to the format string, and save the raw arguments into the buffer. The format and the arguments will be post processed when the ring buffer is read. This way the trace_printk() format conversions are not done during the hot path, where the trace is being recorded.”…””}”(hjÞh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KhjÍh²hubhÌ)”}”(hŒòtrace_printk() is meant only for debugging, and should never be added into a subsystem of the kernel. If you need debugging traces, add trace events instead. If a trace_printk() is found in the kernel, the following will appear in the dmesg::”h]”hŒñtrace_printk() is meant only for debugging, and should never be added into a subsystem of the kernel. If you need debugging traces, add trace events instead. If a trace_printk() is found in the kernel, the following will appear in the dmesg:”…””}”(hjìh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K%hjÍh²hubj´)”}”(hXþ********************************************************** ** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE ** ** ** ** trace_printk() being used. Allocating extra memory. ** ** ** ** This means that this is a DEBUG kernel and it is ** ** unsafe for production use. ** ** ** ** If you see this message and you are not debugging ** ** the kernel, report this immediately to your vendor! ** ** ** ** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE ** **********************************************************”h]”hXþ********************************************************** ** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE ** ** ** ** trace_printk() being used. Allocating extra memory. ** ** ** ** This means that this is a DEBUG kernel and it is ** ** unsafe for production use. ** ** ** ** If you see this message and you are not debugging ** ** the kernel, report this immediately to your vendor! ** ** ** ** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE ** **********************************************************”…””}”hjúsbah}”(h]”h ]”h"]”h$]”h&]”jÃjÄuh1j³h³hÊh´K*hjÍh²hubeh}”(h]”Œusing-trace-printk”ah ]”h"]”Œusing trace_printk()”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)”}”(hhh]”(h»)”}”(hŒDebugging kernel crashes”h]”hŒDebugging kernel crashes”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjh²hh³hÊh´K9ubhÌ)”}”(hXThere is various methods of acquiring the state of the system when a kernel crash occurs. This could be from the oops message in printk, or one could use kexec/kdump. But these just show what happened at the time of the crash. It can be very useful in knowing what happened up to the point of the crash. The tracing ring buffer, by default, is a circular buffer that will overwrite older events with newer ones. When a crash happens, the content of the ring buffer will be all the events that lead up to the crash.”h]”hXThere is various methods of acquiring the state of the system when a kernel crash occurs. This could be from the oops message in printk, or one could use kexec/kdump. But these just show what happened at the time of the crash. It can be very useful in knowing what happened up to the point of the crash. The tracing ring buffer, by default, is a circular buffer that will overwrite older events with newer ones. When a crash happens, the content of the ring buffer will be all the events that lead up to the crash.”…””}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K:hjh²hubhÌ)”}”(hXãThere are several kernel command line parameters that can be used to help in this. The first is "ftrace_dump_on_oops". This will dump the tracing ring buffer when a oops occurs to the console. This can be useful if the console is being logged somewhere. If a serial console is used, it may be prudent to make sure the ring buffer is relatively small, otherwise the dumping of the ring buffer may take several minutes to hours to finish. Here's an example of the kernel command line::”h]”hXèThere are several kernel command line parameters that can be used to help in this. The first is “ftrace_dump_on_oopsâ€. This will dump the tracing ring buffer when a oops occurs to the console. This can be useful if the console is being logged somewhere. If a serial console is used, it may be prudent to make sure the ring buffer is relatively small, otherwise the dumping of the ring buffer may take several minutes to hours to finish. Here’s an example of the kernel command line:”…””}”(hj/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KBhjh²hubj´)”}”(hŒ&ftrace_dump_on_oops trace_buf_size=50K”h]”hŒ&ftrace_dump_on_oops trace_buf_size=50K”…””}”hj=sbah}”(h]”h ]”h"]”h$]”h&]”jÃjÄuh1j³h³hÊh´KJhjh²hubhÌ)”}”(hXNote, the tracing buffer is made up of per CPU buffers where each of these buffers is broken up into sub-buffers that are by default PAGE_SIZE. The above trace_buf_size option above sets each of the per CPU buffers to 50K, so, on a machine with 8 CPUs, that's actually 400K total.”h]”hXNote, the tracing buffer is made up of per CPU buffers where each of these buffers is broken up into sub-buffers that are by default PAGE_SIZE. The above trace_buf_size option above sets each of the per CPU buffers to 50K, so, on a machine with 8 CPUs, that’s actually 400K total.”…””}”(hjKh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KLhjh²hubeh}”(h]”Œdebugging-kernel-crashes”ah ]”h"]”Œdebugging kernel crashes”ah$]”h&]”uh1hµhh·h²hh³hÊh´K9ubh¶)”}”(hhh]”(h»)”}”(hŒPersistent buffers across boots”h]”hŒPersistent buffers across boots”…””}”(hjdh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjah²hh³hÊh´KRubhÌ)”}”(hX3If the system memory allows it, the tracing ring buffer can be specified at a specific location in memory. If the location is the same across boots and the memory is not modified, the tracing buffer can be retrieved from the following boot. There's two ways to reserve memory for the use of the ring buffer.”h]”hX5If the system memory allows it, the tracing ring buffer can be specified at a specific location in memory. If the location is the same across boots and the memory is not modified, the tracing buffer can be retrieved from the following boot. There’s two ways to reserve memory for the use of the ring buffer.”…””}”(hjrh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KShjah²hubhÌ)”}”(hXDThe more reliable way (on x86) is to reserve memory with the "memmap" kernel command line option and then use that memory for the trace_instance. This requires a bit of knowledge of the physical memory layout of the system. The advantage of using this method, is that the memory for the ring buffer will always be the same::”h]”hXGThe more reliable way (on x86) is to reserve memory with the “memmap†kernel command line option and then use that memory for the trace_instance. This requires a bit of knowledge of the physical memory layout of the system. The advantage of using this method, is that the memory for the ring buffer will always be the same:”…””}”(hj€h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KYhjah²hubj´)”}”(hŒ?memmap==12M$0x284500000 trace_instance=boot_map@0x284500000:12M”h]”hŒ?memmap==12M$0x284500000 trace_instance=boot_map@0x284500000:12M”…””}”hjŽsbah}”(h]”h ]”h"]”h$]”h&]”jÃjÄuh1j³h³hÊh´K_hjah²hubhÌ)”}”(hXThe memmap above reserves 12 megabytes of memory at the physical memory location 0x284500000. Then the trace_instance option will create a trace instance "boot_map" at that same location with the same amount of memory reserved. As the ring buffer is broke up into per CPU buffers, the 12 megabytes will be broken up evenly between those CPUs. If you have 8 CPUs, each per CPU ring buffer will be 1.5 megabytes in size. Note, that also includes meta data, so the amount of memory actually used by the ring buffer will be slightly smaller.”h]”hXThe memmap above reserves 12 megabytes of memory at the physical memory location 0x284500000. Then the trace_instance option will create a trace instance “boot_map†at that same location with the same amount of memory reserved. As the ring buffer is broke up into per CPU buffers, the 12 megabytes will be broken up evenly between those CPUs. If you have 8 CPUs, each per CPU ring buffer will be 1.5 megabytes in size. Note, that also includes meta data, so the amount of memory actually used by the ring buffer will be slightly smaller.”…””}”(hjœh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kahjah²hubhÌ)”}”(hŒuAnother more generic but less robust way to allocate a ring buffer mapping at boot is with the "reserve_mem" option::”h]”hŒxAnother more generic but less robust way to allocate a ring buffer mapping at boot is with the “reserve_mem†option:”…””}”(hjªh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kjhjah²hubj´)”}”(hŒ8reserve_mem=12M:4096:trace trace_instance=boot_map@trace”h]”hŒ8reserve_mem=12M:4096:trace trace_instance=boot_map@trace”…””}”hj¸sbah}”(h]”h ]”h"]”h$]”h&]”jÃjÄuh1j³h³hÊh´Kmhjah²hubhÌ)”}”(hŒÃThe reserve_mem option above will find 12 megabytes that are available at boot up, and align it by 4096 bytes. It will label this memory as "trace" that can be used by later command line options.”h]”hŒÇThe reserve_mem option above will find 12 megabytes that are available at boot up, and align it by 4096 bytes. It will label this memory as “trace†that can be used by later command line options.”…””}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kohjah²hubhÌ)”}”(hXrThe trace_instance option creates a "boot_map" instance and will use the memory reserved by reserve_mem that was labeled as "trace". This method is more generic but may not be as reliable. Due to KASLR, the memory reserved by reserve_mem may not be located at the same location. If this happens, then the ring buffer will not be from the previous boot and will be reset.”h]”hXzThe trace_instance option creates a “boot_map†instance and will use the memory reserved by reserve_mem that was labeled as “traceâ€. This method is more generic but may not be as reliable. Due to KASLR, the memory reserved by reserve_mem may not be located at the same location. If this happens, then the ring buffer will not be from the previous boot and will be reset.”…””}”(hjÔh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kshjah²hubhÌ)”}”(hXSometimes, by using a larger alignment, it can keep KASLR from moving things around in such a way that it will move the location of the reserve_mem. By using a larger alignment, you may find better that the buffer is more consistent to where it is placed::”h]”hŒÿSometimes, by using a larger alignment, it can keep KASLR from moving things around in such a way that it will move the location of the reserve_mem. By using a larger alignment, you may find better that the buffer is more consistent to where it is placed:”…””}”(hjâh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kyhjah²hubj´)”}”(hŒ=reserve_mem=12M:0x2000000:trace trace_instance=boot_map@trace”h]”hŒ=reserve_mem=12M:0x2000000:trace trace_instance=boot_map@trace”…””}”hjðsbah}”(h]”h ]”h"]”h$]”h&]”jÃjÄuh1j³h³hÊh´K~hjah²hubhÌ)”}”(hXFOn boot up, the memory reserved for the ring buffer is validated. It will go through a series of tests to make sure that the ring buffer contains valid data. If it is, it will then set it up to be available to read from the instance. If it fails any of the tests, it will clear the entire ring buffer and initialize it as new.”h]”hXFOn boot up, the memory reserved for the ring buffer is validated. It will go through a series of tests to make sure that the ring buffer contains valid data. If it is, it will then set it up to be available to read from the instance. If it fails any of the tests, it will clear the entire ring buffer and initialize it as new.”…””}”(hjþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K€hjah²hubhÌ)”}”(hŒüThe layout of this mapped memory may not be consistent from kernel to kernel, so only the same kernel is guaranteed to work if the mapping is preserved. Switching to a different kernel version may find a different layout and mark the buffer as invalid.”h]”hŒüThe layout of this mapped memory may not be consistent from kernel to kernel, so only the same kernel is guaranteed to work if the mapping is preserved. Switching to a different kernel version may find a different layout and mark the buffer as invalid.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K†hjah²hubhÌ)”}”(hŒONB: Both the mapped address and size must be page aligned for the architecture.”h]”hŒONB: Both the mapped address and size must be page aligned for the architecture.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K‹hjah²hubeh}”(h]”Œpersistent-buffers-across-boots”ah ]”h"]”Œpersistent buffers across boots”ah$]”h&]”uh1hµhh·h²hh³hÊh´KRubh¶)”}”(hhh]”(h»)”}”(hŒ)Using trace_printk() in the boot instance”h]”hŒ)Using trace_printk() in the boot instance”…””}”(hj3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj0h²hh³hÊh´KŽubhÌ)”}”(hXŽBy default, the content of trace_printk() goes into the top level tracing instance. But this instance is never preserved across boots. To have the trace_printk() content, and some other internal tracing go to the preserved buffer (like dump stacks), either set the instance to be the trace_printk() destination from the kernel command line, or set it after boot up via the trace_printk_dest option.”h]”hXŽBy default, the content of trace_printk() goes into the top level tracing instance. But this instance is never preserved across boots. To have the trace_printk() content, and some other internal tracing go to the preserved buffer (like dump stacks), either set the instance to be the trace_printk() destination from the kernel command line, or set it after boot up via the trace_printk_dest option.”…””}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khj0h²hubhÌ)”}”(hŒAfter boot up::”h]”hŒAfter boot up:”…””}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K–hj0h²hubj´)”}”(hŒIecho 1 > /sys/kernel/tracing/instances/boot_map/options/trace_printk_dest”h]”hŒIecho 1 > /sys/kernel/tracing/instances/boot_map/options/trace_printk_dest”…””}”hj]sbah}”(h]”h ]”h"]”h$]”h&]”jÃjÄuh1j³h³hÊh´K˜hj0h²hubhÌ)”}”(hŒFrom the kernel command line::”h]”hŒFrom the kernel command line:”…””}”(hjkh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kšhj0h²hubj´)”}”(hŒMreserve_mem=12M:4096:trace trace_instance=boot_map^traceprintk^traceoff@trace”h]”hŒMreserve_mem=12M:4096:trace trace_instance=boot_map^traceprintk^traceoff@trace”…””}”hjysbah}”(h]”h ]”h"]”h$]”h&]”jÃjÄuh1j³h³hÊh´Kœhj0h²hubhÌ)”}”(hXIf setting it from the kernel command line, it is recommended to also disable tracing with the "traceoff" flag, and enable tracing after boot up. Otherwise the trace from the most recent boot will be mixed with the trace from the previous boot, and may make it confusing to read.”h]”hXIf setting it from the kernel command line, it is recommended to also disable tracing with the “traceoff†flag, and enable tracing after boot up. Otherwise the trace from the most recent boot will be mixed with the trace from the previous boot, and may make it confusing to read.”…””}”(hj‡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kžhj0h²hubeh}”(h]”Œ'using-trace-printk-in-the-boot-instance”ah ]”h"]”Œ)using trace_printk() in the boot instance”ah$]”h&]”uh1hµhh·h²hh³hÊh´KŽubh¶)”}”(hhh]”(h»)”}”(hŒ6Using a backup instance for keeping previous boot data”h]”hŒ6Using a backup instance for keeping previous boot data”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjh²hh³hÊh´K¤ubhÌ)”}”(hXIt is also possible to record trace data at system boot time by specifying events with the persistent ring buffer, but in this case the data before the reboot will be lost before it can be read. This problem can be solved by a backup instance. From the kernel command line::”h]”hXIt is also possible to record trace data at system boot time by specifying events with the persistent ring buffer, but in this case the data before the reboot will be lost before it can be read. This problem can be solved by a backup instance. From the kernel command line:”…””}”(hj®h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¦hjh²hubj´)”}”(hŒareserve_mem=12M:4096:trace trace_instance=boot_map@trace,sched,irq trace_instance=backup=boot_map”h]”hŒareserve_mem=12M:4096:trace trace_instance=boot_map@trace,sched,irq trace_instance=backup=boot_map”…””}”hj¼sbah}”(h]”h ]”h"]”h$]”h&]”jÃjÄuh1j³h³hÊh´K«hjh²hubhÌ)”}”(hXOn boot up, the previous data in the "boot_map" is copied to the "backup" instance, and the "sched:*" and "irq:*" events for the current boot are traced in the "boot_map". Thus the user can read the previous boot data from the "backup" instance without stopping the trace.”h]”(hŒmOn boot up, the previous data in the “boot_map†is copied to the “backup†instance, and the “sched:”…””}”(hjÊh²hh³Nh´NubhŒemphasis”“”)”}”(hŒ *" and "irq:*”h]”hŒ†and “irq:”…””}”(hjÔh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÒhjÊubhŒªâ€ events for the current boot are traced in the “boot_mapâ€. Thus the user can read the previous boot data from the “backup†instance without stopping the trace.”…””}”(hjÊh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K­hjh²hubhÌ)”}”(hŒ»Note that this "backup" instance is readonly, and will be removed automatically if you clear the trace data or read out all trace data from the "trace_pipe" or the "trace_pipe_raw" files.”h]”hŒÇNote that this “backup†instance is readonly, and will be removed automatically if you clear the trace data or read out all trace data from the “trace_pipe†or the “trace_pipe_raw†files.”…””}”(hjìh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K²hjh²hubeh}”(h]”Œ6using-a-backup-instance-for-keeping-previous-boot-data”ah ]”h"]”Œ6using a backup instance for keeping previous boot data”ah$]”h&]”uh1hµhh·h²hh³hÊh´K¤ubeh}”(h]”Œusing-the-tracer-for-debugging”ah ]”h"]”Œusing the tracer for debugging”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”}”(jjjÊjÇj j j^j[j-j*jšj—jÿjüuŒ nametypes”}”(j‰jʉj ‰j^‰j-‰jš‰jÿ‰uh}”(jh·jÇj†j jÍj[jj*jaj—j0jüjuŒ 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.