€•§UŒ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ŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/pt_BR/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.”…””}”(hj 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.”…””}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒUser Interface”h]”hŒUser Interface”…””}”(hj6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj3h²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:”…””}”(hjDh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K#hj3h²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”…””}”hjTsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jRh³hÇh´K'hj3h²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.”…””}”(hjbh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K+hj3h²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:”…””}”(hjph²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K.hj3h²hubjS)”}”(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"”…””}”hj~sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jRh³hÇh´K0hj3h²hubhÞ)”}”(hŒ, where the meaning is:”h]”hŒ, where the meaning is:”…””}”(hjŒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K8hj3h²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´K 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Æuh1jRh³hÇh´K…hj¡h²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.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K‡hj¡h²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”jGŒ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!jjjjMjJjžj›jjuŒ nametypes”}”(j!‰j‰jM‰jž‰j‰uh}”(jhÊjj3jJjj›jPjj¡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”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.