€•ÏTŒ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/core-api/printk-index”Œ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/core-api/printk-index”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/it_IT/core-api/printk-index”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/ja_JP/core-api/printk-index”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/ko_KR/core-api/printk-index”Œ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/core-api/printk-index”Œ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ŸŒC/var/lib/git/docbuild/linux/Documentation/core-api/printk-index.rst”h KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ Printk Index”h]”hŒ Printk Index”…””}”(hh»hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hh¶hžhhŸh³h KubhŒ paragraph”“”)”}”(hŒÎThere are many ways to monitor the state of the system. One important source of information is the system log. It provides a lot of information, including more or less important warnings and error messages.”h]”hŒÎThere are many ways to monitor the state of the system. One important source of information is the system log. It provides a lot of information, including more or less important warnings and error messages.”…””}”(hhËhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khh¶hžhubhÊ)”}”(hŒPThere are monitoring tools that filter and take action based on messages logged.”h]”hŒPThere are monitoring tools that filter and take action based on messages logged.”…””}”(hhÙhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K hh¶hžhubhÊ)”}”(hŒ€The kernel messages are evolving together with the code. As a result, particular kernel messages are not KABI and never will be!”h]”hŒ€The kernel messages are evolving together with the code. As a result, particular kernel messages are not KABI and never will be!”…””}”(hhçhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khh¶hžhubhÊ)”}”(hX¨It is a huge challenge for maintaining the system log monitors. It requires knowing what messages were updated in a particular kernel version and why. Finding these changes in the sources would require non-trivial parsers. Also it would require matching the sources with the binary kernel which is not always trivial. Various changes might be backported. Various kernel versions might be used on different monitored systems.”h]”hX¨It is a huge challenge for maintaining the system log monitors. It requires knowing what messages were updated in a particular kernel version and why. Finding these changes in the sources would require non-trivial parsers. Also it would require matching the sources with the binary kernel which is not always trivial. Various changes might be backported. Various kernel versions might be used on different monitored systems.”…””}”(hhõhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khh¶hžhubhÊ)”}”(hŒÞThis is where the printk index feature might become useful. It provides a dump of printk formats used all over the source code used for the kernel and modules on the running system. It is accessible at runtime via debugfs.”h]”hŒÞThis is where the printk index feature might become useful. It provides a dump of printk formats used all over the source code used for the kernel and modules on the running system. It is accessible at runtime via debugfs.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khh¶hžhubhÊ)”}”(hŒ”The printk index helps to find changes in the message formats. Also it helps to track the strings back to the kernel sources and the related commit.”h]”hŒ”The printk index helps to find changes in the message formats. Also it helps to track the strings back to the kernel sources and the related commit.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khh¶hžhubhµ)”}”(hhh]”(hº)”}”(hŒUser Interface”h]”hŒUser Interface”…””}”(hj"hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hjhžhhŸh³h K!ubhÊ)”}”(hŒ×The index of printk formats are split in into separate files. The files are named according to the binaries where the printk formats are built-in. There is always "vmlinux" and optionally also modules, for example::”h]”hŒÚThe index of printk formats are split in into separate files. The files are named according to the binaries where the printk formats are built-in. There is always “vmlinux†and optionally also modules, for example:”…””}”(hj0hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K#hjhžhubhŒ literal_block”“”)”}”(hŒr/sys/kernel/debug/printk/index/vmlinux /sys/kernel/debug/printk/index/ext4 /sys/kernel/debug/printk/index/scsi_mod”h]”hŒr/sys/kernel/debug/printk/index/vmlinux /sys/kernel/debug/printk/index/ext4 /sys/kernel/debug/printk/index/scsi_mod”…””}”hj@sbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1j>hŸh³h K'hjhžhubhÊ)”}”(hŒNote that only loaded modules are shown. Also printk formats from a module might appear in "vmlinux" when the module is built-in.”h]”hŒ…Note that only loaded modules are shown. Also printk formats from a module might appear in “vmlinux†when the module is built-in.”…””}”(hjNhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K+hjhžhubhÊ)”}”(hŒGThe content is inspired by the dynamic debug interface and looks like::”h]”hŒFThe content is inspired by the dynamic debug interface and looks like:”…””}”(hj\hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K.hjhžhubj?)”}”(hX$> head -1 /sys/kernel/debug/printk/index/vmlinux; shuf -n 5 vmlinux # filename:line function "format" <5> block/blk-settings.c:661 disk_stack_limits "%s: Warning: Device %s is misaligned\n" <4> kernel/trace/trace.c:8296 trace_create_file "Could not create tracefs '%s' entry\n" <6> arch/x86/kernel/hpet.c:144 _hpet_print_config "hpet: %s(%d):\n" <6> init/do_mounts.c:605 prepare_namespace "Waiting for root device %s...\n" <6> drivers/acpi/osl.c:1410 acpi_no_auto_serialize_setup "ACPI: auto-serialization disabled\n"”h]”hX$> head -1 /sys/kernel/debug/printk/index/vmlinux; shuf -n 5 vmlinux # filename:line function "format" <5> block/blk-settings.c:661 disk_stack_limits "%s: Warning: Device %s is misaligned\n" <4> kernel/trace/trace.c:8296 trace_create_file "Could not create tracefs '%s' entry\n" <6> arch/x86/kernel/hpet.c:144 _hpet_print_config "hpet: %s(%d):\n" <6> init/do_mounts.c:605 prepare_namespace "Waiting for root device %s...\n" <6> drivers/acpi/osl.c:1410 acpi_no_auto_serialize_setup "ACPI: auto-serialization disabled\n"”…””}”hjjsbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1j>hŸh³h K0hjhžhubhÊ)”}”(hŒ, where the meaning is:”h]”hŒ, where the meaning is:”…””}”(hjxhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K8hjhžhubhŒ block_quote”“”)”}”(hXÃ- :level: log level value: 0-7 for particular severity, -1 as default, 'c' as continuous line without an explicit log level - :flags: optional flags: currently only 'c' for KERN_CONT - :filename\:line: source filename and line number of the related printk() call. Note that there are many wrappers, for example, pr_warn(), pr_warn_once(), dev_warn(). - :function: function name where the printk() call is used. - :format: format string ”h]”hŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒ|:level: log level value: 0-7 for particular severity, -1 as default, 'c' as continuous line without an explicit log level”h]”hŒ field_list”“”)”}”(hhh]”hŒfield”“”)”}”(hhh]”(hŒ field_name”“”)”}”(hŒlevel”h]”hŒlevel”…””}”(hj£hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j¡hjžhŸh³h KubhŒ field_body”“”)”}”(hŒqlog level value: 0-7 for particular severity, -1 as default, 'c' as continuous line without an explicit log level”h]”hÊ)”}”(hŒqlog level value: 0-7 for particular severity, -1 as default, 'c' as continuous line without an explicit log level”h]”hŒulog level value: 0-7 for particular severity, -1 as default, ‘c’ as continuous line without an explicit log level”…””}”(hj·hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K:hj³ubah}”(h]”h ]”h"]”h$]”h&]”uh1j±hjžubeh}”(h]”h ]”h"]”h$]”h&]”uh1jœhŸh³h K:hj™ubah}”(h]”h ]”h"]”h$]”h&]”uh1j—hj“ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‘hjŽubj’)”}”(hŒ8:flags: optional flags: currently only 'c' for KERN_CONT”h]”j˜)”}”(hhh]”j)”}”(hhh]”(j¢)”}”(hŒflags”h]”hŒflags”…””}”(hjçhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j¡hjähŸh³h Kubj²)”}”(hŒ0optional flags: currently only 'c' for KERN_CONT”h]”hÊ)”}”(hj÷h]”hŒ4optional flags: currently only ‘c’ for KERN_CONT”…””}”(hjùhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KhŸh³h KyhjhžhubhÊ)”}”(hŒ2This results in the following printk index entry::”h]”hŒ1This results in the following printk index entry:”…””}”(hjÖhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Kƒhjhžhubj?)”}”(hŒ^<6> drivers/acpi/osl.c:1410 acpi_no_auto_serialize_setup "ACPI: auto-serialization disabled\n"”h]”hŒ^<6> drivers/acpi/osl.c:1410 acpi_no_auto_serialize_setup "ACPI: auto-serialization disabled\n"”…””}”hjäsbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1j>hŸh³h K…hjhžhubhÊ)”}”(hŒ¯It helps matching messages from the real log with printk index. Then the source file name, line number, and function name can be used to match the string with the source code.”h]”hŒ¯It helps matching messages from the real log with printk index. Then the source file name, line number, and function name can be used to match the string with the source code.”…””}”(hjòhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K‡hjhžhubeh}”(h]”Œsubsystem-specific-prefix”ah ]”h"]”Œsubsystem specific prefix”ah$]”h&]”uh1h´hh¶hžhhŸh³h Klubeh}”(h]”Œ printk-index”ah ]”h"]”Œ printk index”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”j3Œ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 jjj9j6jŠj‡jjuŒ nametypes”}”(j ‰j‰j9‰jЉj‰uh}”(j h¶jjj6jj‡j<jjuŒ 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.