brintos

brintos / linux-shallow public Read only

0
0
Text · 4.8 KiB · 0639c9d Raw
133 lines · plain
1.. SPDX-License-Identifier: GPL-2.02 3====================4ACPI CA Debug Output5====================6 7The ACPI CA can generate debug output.  This document describes how to use this8facility.9 10Compile-time configuration11==========================12 13The ACPI CA debug output is globally enabled by CONFIG_ACPI_DEBUG.  If this14config option is not set, the debug messages are not even built into the kernel.15 16Boot- and run-time configuration17================================18 19When CONFIG_ACPI_DEBUG=y, you can select the component and level of messages20you're interested in.  At boot-time, use the acpi.debug_layer and21acpi.debug_level kernel command line options.  After boot, you can use the22debug_layer and debug_level files in /sys/module/acpi/parameters/ to control23the debug messages.24 25debug_layer (component)26=======================27 28The "debug_layer" is a mask that selects components of interest, e.g., a29specific part of the ACPI interpreter.  To build the debug_layer bitmask, look30for the "#define _COMPONENT" in an ACPI source file.31 32You can set the debug_layer mask at boot-time using the acpi.debug_layer33command line argument, and you can change it after boot by writing values34to /sys/module/acpi/parameters/debug_layer.35 36The possible components are defined in include/acpi/acoutput.h.37 38Reading /sys/module/acpi/parameters/debug_layer shows the supported mask values::39 40    ACPI_UTILITIES                  0x0000000141    ACPI_HARDWARE                   0x0000000242    ACPI_EVENTS                     0x0000000443    ACPI_TABLES                     0x0000000844    ACPI_NAMESPACE                  0x0000001045    ACPI_PARSER                     0x0000002046    ACPI_DISPATCHER                 0x0000004047    ACPI_EXECUTER                   0x0000008048    ACPI_RESOURCES                  0x0000010049    ACPI_CA_DEBUGGER                0x0000020050    ACPI_OS_SERVICES                0x0000040051    ACPI_CA_DISASSEMBLER            0x0000080052    ACPI_COMPILER                   0x0000100053    ACPI_TOOLS                      0x0000200054 55debug_level56===========57 58The "debug_level" is a mask that selects different types of messages, e.g.,59those related to initialization, method execution, informational messages, etc.60To build debug_level, look at the level specified in an ACPI_DEBUG_PRINT()61statement.62 63The ACPI interpreter uses several different levels, but the Linux64ACPI core and ACPI drivers generally only use ACPI_LV_INFO.65 66You can set the debug_level mask at boot-time using the acpi.debug_level67command line argument, and you can change it after boot by writing values68to /sys/module/acpi/parameters/debug_level.69 70The possible levels are defined in include/acpi/acoutput.h.  Reading71/sys/module/acpi/parameters/debug_level shows the supported mask values,72currently these::73 74    ACPI_LV_INIT                    0x0000000175    ACPI_LV_DEBUG_OBJECT            0x0000000276    ACPI_LV_INFO                    0x0000000477    ACPI_LV_INIT_NAMES              0x0000002078    ACPI_LV_PARSE                   0x0000004079    ACPI_LV_LOAD                    0x0000008080    ACPI_LV_DISPATCH                0x0000010081    ACPI_LV_EXEC                    0x0000020082    ACPI_LV_NAMES                   0x0000040083    ACPI_LV_OPREGION                0x0000080084    ACPI_LV_BFIELD                  0x0000100085    ACPI_LV_TABLES                  0x0000200086    ACPI_LV_VALUES                  0x0000400087    ACPI_LV_OBJECTS                 0x0000800088    ACPI_LV_RESOURCES               0x0001000089    ACPI_LV_USER_REQUESTS           0x0002000090    ACPI_LV_PACKAGE                 0x0004000091    ACPI_LV_ALLOCATIONS             0x0010000092    ACPI_LV_FUNCTIONS               0x0020000093    ACPI_LV_OPTIMIZATIONS           0x0040000094    ACPI_LV_MUTEX                   0x0100000095    ACPI_LV_THREADS                 0x0200000096    ACPI_LV_IO                      0x0400000097    ACPI_LV_INTERRUPTS              0x0800000098    ACPI_LV_AML_DISASSEMBLE         0x1000000099    ACPI_LV_VERBOSE_INFO            0x20000000100    ACPI_LV_FULL_TABLES             0x40000000101    ACPI_LV_EVENTS                  0x80000000102 103Examples104========105 106For example, drivers/acpi/acpica/evxfevnt.c contains this::107 108    #define _COMPONENT          ACPI_EVENTS109    ...110    ACPI_DEBUG_PRINT((ACPI_DB_INIT, "ACPI mode disabled\n"));111 112To turn on this message, set the ACPI_EVENTS bit in acpi.debug_layer113and the ACPI_LV_INIT bit in acpi.debug_level.  (The ACPI_DEBUG_PRINT114statement uses ACPI_DB_INIT, which is a macro based on the ACPI_LV_INIT115definition.)116 117Enable all AML "Debug" output (stores to the Debug object while interpreting118AML) during boot::119 120    acpi.debug_layer=0xffffffff acpi.debug_level=0x2121 122Enable all ACPI hardware-related messages::123 124    acpi.debug_layer=0x2 acpi.debug_level=0xffffffff125 126Enable all ACPI_DB_INFO messages after boot::127 128    # echo 0x4 > /sys/module/acpi/parameters/debug_level129 130Show all valid component values::131 132    # cat /sys/module/acpi/parameters/debug_layer133