0001 .. SPDX-License-Identifier: GPL-2.0
0002
0003 ====================
0004 ACPI CA Debug Output
0005 ====================
0006
0007 The ACPI CA can generate debug output. This document describes how to use this
0008 facility.
0009
0010 Compile-time configuration
0011 ==========================
0012
0013 The ACPI CA debug output is globally enabled by CONFIG_ACPI_DEBUG. If this
0014 config option is not set, the debug messages are not even built into the kernel.
0015
0016 Boot- and run-time configuration
0017 ================================
0018
0019 When CONFIG_ACPI_DEBUG=y, you can select the component and level of messages
0020 you're interested in. At boot-time, use the acpi.debug_layer and
0021 acpi.debug_level kernel command line options. After boot, you can use the
0022 debug_layer and debug_level files in /sys/module/acpi/parameters/ to control
0023 the debug messages.
0024
0025 debug_layer (component)
0026 =======================
0027
0028 The "debug_layer" is a mask that selects components of interest, e.g., a
0029 specific part of the ACPI interpreter. To build the debug_layer bitmask, look
0030 for the "#define _COMPONENT" in an ACPI source file.
0031
0032 You can set the debug_layer mask at boot-time using the acpi.debug_layer
0033 command line argument, and you can change it after boot by writing values
0034 to /sys/module/acpi/parameters/debug_layer.
0035
0036 The possible components are defined in include/acpi/acoutput.h.
0037
0038 Reading /sys/module/acpi/parameters/debug_layer shows the supported mask values::
0039
0040 ACPI_UTILITIES 0x00000001
0041 ACPI_HARDWARE 0x00000002
0042 ACPI_EVENTS 0x00000004
0043 ACPI_TABLES 0x00000008
0044 ACPI_NAMESPACE 0x00000010
0045 ACPI_PARSER 0x00000020
0046 ACPI_DISPATCHER 0x00000040
0047 ACPI_EXECUTER 0x00000080
0048 ACPI_RESOURCES 0x00000100
0049 ACPI_CA_DEBUGGER 0x00000200
0050 ACPI_OS_SERVICES 0x00000400
0051 ACPI_CA_DISASSEMBLER 0x00000800
0052 ACPI_COMPILER 0x00001000
0053 ACPI_TOOLS 0x00002000
0054
0055 debug_level
0056 ===========
0057
0058 The "debug_level" is a mask that selects different types of messages, e.g.,
0059 those related to initialization, method execution, informational messages, etc.
0060 To build debug_level, look at the level specified in an ACPI_DEBUG_PRINT()
0061 statement.
0062
0063 The ACPI interpreter uses several different levels, but the Linux
0064 ACPI core and ACPI drivers generally only use ACPI_LV_INFO.
0065
0066 You can set the debug_level mask at boot-time using the acpi.debug_level
0067 command line argument, and you can change it after boot by writing values
0068 to /sys/module/acpi/parameters/debug_level.
0069
0070 The possible levels are defined in include/acpi/acoutput.h. Reading
0071 /sys/module/acpi/parameters/debug_level shows the supported mask values,
0072 currently these::
0073
0074 ACPI_LV_INIT 0x00000001
0075 ACPI_LV_DEBUG_OBJECT 0x00000002
0076 ACPI_LV_INFO 0x00000004
0077 ACPI_LV_INIT_NAMES 0x00000020
0078 ACPI_LV_PARSE 0x00000040
0079 ACPI_LV_LOAD 0x00000080
0080 ACPI_LV_DISPATCH 0x00000100
0081 ACPI_LV_EXEC 0x00000200
0082 ACPI_LV_NAMES 0x00000400
0083 ACPI_LV_OPREGION 0x00000800
0084 ACPI_LV_BFIELD 0x00001000
0085 ACPI_LV_TABLES 0x00002000
0086 ACPI_LV_VALUES 0x00004000
0087 ACPI_LV_OBJECTS 0x00008000
0088 ACPI_LV_RESOURCES 0x00010000
0089 ACPI_LV_USER_REQUESTS 0x00020000
0090 ACPI_LV_PACKAGE 0x00040000
0091 ACPI_LV_ALLOCATIONS 0x00100000
0092 ACPI_LV_FUNCTIONS 0x00200000
0093 ACPI_LV_OPTIMIZATIONS 0x00400000
0094 ACPI_LV_MUTEX 0x01000000
0095 ACPI_LV_THREADS 0x02000000
0096 ACPI_LV_IO 0x04000000
0097 ACPI_LV_INTERRUPTS 0x08000000
0098 ACPI_LV_AML_DISASSEMBLE 0x10000000
0099 ACPI_LV_VERBOSE_INFO 0x20000000
0100 ACPI_LV_FULL_TABLES 0x40000000
0101 ACPI_LV_EVENTS 0x80000000
0102
0103 Examples
0104 ========
0105
0106 For example, drivers/acpi/acpica/evxfevnt.c contains this::
0107
0108 #define _COMPONENT ACPI_EVENTS
0109 ...
0110 ACPI_DEBUG_PRINT((ACPI_DB_INIT, "ACPI mode disabled\n"));
0111
0112 To turn on this message, set the ACPI_EVENTS bit in acpi.debug_layer
0113 and the ACPI_LV_INIT bit in acpi.debug_level. (The ACPI_DEBUG_PRINT
0114 statement uses ACPI_DB_INIT, which is a macro based on the ACPI_LV_INIT
0115 definition.)
0116
0117 Enable all AML "Debug" output (stores to the Debug object while interpreting
0118 AML) during boot::
0119
0120 acpi.debug_layer=0xffffffff acpi.debug_level=0x2
0121
0122 Enable all ACPI hardware-related messages::
0123
0124 acpi.debug_layer=0x2 acpi.debug_level=0xffffffff
0125
0126 Enable all ACPI_DB_INFO messages after boot::
0127
0128 # echo 0x4 > /sys/module/acpi/parameters/debug_level
0129
0130 Show all valid component values::
0131
0132 # cat /sys/module/acpi/parameters/debug_layer