Changbin Du | 99ed6bf | 2019-04-25 01:52:58 +0800 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0 |
Bjorn Helgaas | a0d84a9 | 2008-11-07 16:58:05 -0700 | [diff] [blame] | 2 | |
Rafael J. Wysocki | 3aadd86 | 2021-02-22 20:00:43 +0100 | [diff] [blame] | 3 | ==================== |
| 4 | ACPI CA Debug Output |
| 5 | ==================== |
Bjorn Helgaas | a0d84a9 | 2008-11-07 16:58:05 -0700 | [diff] [blame] | 6 | |
Rafael J. Wysocki | 3aadd86 | 2021-02-22 20:00:43 +0100 | [diff] [blame] | 7 | The ACPI CA can generate debug output. This document describes how to use this |
| 8 | facility. |
Bjorn Helgaas | a0d84a9 | 2008-11-07 16:58:05 -0700 | [diff] [blame] | 9 | |
| 10 | Compile-time configuration |
Changbin Du | 99ed6bf | 2019-04-25 01:52:58 +0800 | [diff] [blame] | 11 | ========================== |
Bjorn Helgaas | a0d84a9 | 2008-11-07 16:58:05 -0700 | [diff] [blame] | 12 | |
Rafael J. Wysocki | 3aadd86 | 2021-02-22 20:00:43 +0100 | [diff] [blame] | 13 | The ACPI CA debug output is globally enabled by CONFIG_ACPI_DEBUG. If this |
| 14 | config option is not set, the debug messages are not even built into the kernel. |
Bjorn Helgaas | a0d84a9 | 2008-11-07 16:58:05 -0700 | [diff] [blame] | 15 | |
| 16 | Boot- and run-time configuration |
Changbin Du | 99ed6bf | 2019-04-25 01:52:58 +0800 | [diff] [blame] | 17 | ================================ |
Bjorn Helgaas | a0d84a9 | 2008-11-07 16:58:05 -0700 | [diff] [blame] | 18 | |
| 19 | When CONFIG_ACPI_DEBUG=y, you can select the component and level of messages |
| 20 | you're interested in. At boot-time, use the acpi.debug_layer and |
| 21 | acpi.debug_level kernel command line options. After boot, you can use the |
| 22 | debug_layer and debug_level files in /sys/module/acpi/parameters/ to control |
| 23 | the debug messages. |
| 24 | |
| 25 | debug_layer (component) |
Changbin Du | 99ed6bf | 2019-04-25 01:52:58 +0800 | [diff] [blame] | 26 | ======================= |
Bjorn Helgaas | a0d84a9 | 2008-11-07 16:58:05 -0700 | [diff] [blame] | 27 | |
| 28 | The "debug_layer" is a mask that selects components of interest, e.g., a |
Rafael J. Wysocki | 3aadd86 | 2021-02-22 20:00:43 +0100 | [diff] [blame] | 29 | specific part of the ACPI interpreter. To build the debug_layer bitmask, look |
| 30 | for the "#define _COMPONENT" in an ACPI source file. |
Bjorn Helgaas | a0d84a9 | 2008-11-07 16:58:05 -0700 | [diff] [blame] | 31 | |
| 32 | You can set the debug_layer mask at boot-time using the acpi.debug_layer |
| 33 | command line argument, and you can change it after boot by writing values |
| 34 | to /sys/module/acpi/parameters/debug_layer. |
| 35 | |
Rafael J. Wysocki | 3aadd86 | 2021-02-22 20:00:43 +0100 | [diff] [blame] | 36 | The possible components are defined in include/acpi/acoutput.h. |
| 37 | |
| 38 | Reading /sys/module/acpi/parameters/debug_layer shows the supported mask values:: |
Bjorn Helgaas | a0d84a9 | 2008-11-07 16:58:05 -0700 | [diff] [blame] | 39 | |
| 40 | ACPI_UTILITIES 0x00000001 |
| 41 | ACPI_HARDWARE 0x00000002 |
| 42 | ACPI_EVENTS 0x00000004 |
| 43 | ACPI_TABLES 0x00000008 |
| 44 | ACPI_NAMESPACE 0x00000010 |
| 45 | ACPI_PARSER 0x00000020 |
| 46 | ACPI_DISPATCHER 0x00000040 |
| 47 | ACPI_EXECUTER 0x00000080 |
| 48 | ACPI_RESOURCES 0x00000100 |
| 49 | ACPI_CA_DEBUGGER 0x00000200 |
| 50 | ACPI_OS_SERVICES 0x00000400 |
| 51 | ACPI_CA_DISASSEMBLER 0x00000800 |
| 52 | ACPI_COMPILER 0x00001000 |
| 53 | ACPI_TOOLS 0x00002000 |
Bjorn Helgaas | a0d84a9 | 2008-11-07 16:58:05 -0700 | [diff] [blame] | 54 | |
| 55 | debug_level |
Changbin Du | 99ed6bf | 2019-04-25 01:52:58 +0800 | [diff] [blame] | 56 | =========== |
Bjorn Helgaas | a0d84a9 | 2008-11-07 16:58:05 -0700 | [diff] [blame] | 57 | |
| 58 | The "debug_level" is a mask that selects different types of messages, e.g., |
| 59 | those related to initialization, method execution, informational messages, etc. |
| 60 | To build debug_level, look at the level specified in an ACPI_DEBUG_PRINT() |
| 61 | statement. |
| 62 | |
| 63 | The ACPI interpreter uses several different levels, but the Linux |
| 64 | ACPI core and ACPI drivers generally only use ACPI_LV_INFO. |
| 65 | |
| 66 | You can set the debug_level mask at boot-time using the acpi.debug_level |
| 67 | command line argument, and you can change it after boot by writing values |
| 68 | to /sys/module/acpi/parameters/debug_level. |
| 69 | |
| 70 | The possible levels are defined in include/acpi/acoutput.h. Reading |
| 71 | /sys/module/acpi/parameters/debug_level shows the supported mask values, |
Changbin Du | 99ed6bf | 2019-04-25 01:52:58 +0800 | [diff] [blame] | 72 | currently these:: |
Bjorn Helgaas | a0d84a9 | 2008-11-07 16:58:05 -0700 | [diff] [blame] | 73 | |
| 74 | ACPI_LV_INIT 0x00000001 |
| 75 | ACPI_LV_DEBUG_OBJECT 0x00000002 |
| 76 | ACPI_LV_INFO 0x00000004 |
| 77 | ACPI_LV_INIT_NAMES 0x00000020 |
| 78 | ACPI_LV_PARSE 0x00000040 |
| 79 | ACPI_LV_LOAD 0x00000080 |
| 80 | ACPI_LV_DISPATCH 0x00000100 |
| 81 | ACPI_LV_EXEC 0x00000200 |
| 82 | ACPI_LV_NAMES 0x00000400 |
| 83 | ACPI_LV_OPREGION 0x00000800 |
| 84 | ACPI_LV_BFIELD 0x00001000 |
| 85 | ACPI_LV_TABLES 0x00002000 |
| 86 | ACPI_LV_VALUES 0x00004000 |
| 87 | ACPI_LV_OBJECTS 0x00008000 |
| 88 | ACPI_LV_RESOURCES 0x00010000 |
| 89 | ACPI_LV_USER_REQUESTS 0x00020000 |
| 90 | ACPI_LV_PACKAGE 0x00040000 |
| 91 | ACPI_LV_ALLOCATIONS 0x00100000 |
| 92 | ACPI_LV_FUNCTIONS 0x00200000 |
| 93 | ACPI_LV_OPTIMIZATIONS 0x00400000 |
| 94 | ACPI_LV_MUTEX 0x01000000 |
| 95 | ACPI_LV_THREADS 0x02000000 |
| 96 | ACPI_LV_IO 0x04000000 |
| 97 | ACPI_LV_INTERRUPTS 0x08000000 |
| 98 | ACPI_LV_AML_DISASSEMBLE 0x10000000 |
| 99 | ACPI_LV_VERBOSE_INFO 0x20000000 |
| 100 | ACPI_LV_FULL_TABLES 0x40000000 |
| 101 | ACPI_LV_EVENTS 0x80000000 |
| 102 | |
| 103 | Examples |
Changbin Du | 99ed6bf | 2019-04-25 01:52:58 +0800 | [diff] [blame] | 104 | ======== |
Bjorn Helgaas | a0d84a9 | 2008-11-07 16:58:05 -0700 | [diff] [blame] | 105 | |
Rafael J. Wysocki | 12bfee9 | 2021-01-20 20:01:18 +0100 | [diff] [blame] | 106 | For example, drivers/acpi/acpica/evxfevnt.c contains this:: |
Bjorn Helgaas | a0d84a9 | 2008-11-07 16:58:05 -0700 | [diff] [blame] | 107 | |
Rafael J. Wysocki | 12bfee9 | 2021-01-20 20:01:18 +0100 | [diff] [blame] | 108 | #define _COMPONENT ACPI_EVENTS |
Bjorn Helgaas | a0d84a9 | 2008-11-07 16:58:05 -0700 | [diff] [blame] | 109 | ... |
Rafael J. Wysocki | 12bfee9 | 2021-01-20 20:01:18 +0100 | [diff] [blame] | 110 | ACPI_DEBUG_PRINT((ACPI_DB_INIT, "ACPI mode disabled\n")); |
Bjorn Helgaas | a0d84a9 | 2008-11-07 16:58:05 -0700 | [diff] [blame] | 111 | |
Rafael J. Wysocki | 12bfee9 | 2021-01-20 20:01:18 +0100 | [diff] [blame] | 112 | To turn on this message, set the ACPI_EVENTS bit in acpi.debug_layer |
| 113 | and the ACPI_LV_INIT bit in acpi.debug_level. (The ACPI_DEBUG_PRINT |
| 114 | statement uses ACPI_DB_INIT, which is a macro based on the ACPI_LV_INIT |
Bjorn Helgaas | a0d84a9 | 2008-11-07 16:58:05 -0700 | [diff] [blame] | 115 | definition.) |
| 116 | |
| 117 | Enable all AML "Debug" output (stores to the Debug object while interpreting |
Changbin Du | 99ed6bf | 2019-04-25 01:52:58 +0800 | [diff] [blame] | 118 | AML) during boot:: |
Bjorn Helgaas | a0d84a9 | 2008-11-07 16:58:05 -0700 | [diff] [blame] | 119 | |
| 120 | acpi.debug_layer=0xffffffff acpi.debug_level=0x2 |
| 121 | |
Changbin Du | 99ed6bf | 2019-04-25 01:52:58 +0800 | [diff] [blame] | 122 | Enable all ACPI hardware-related messages:: |
Bjorn Helgaas | a0d84a9 | 2008-11-07 16:58:05 -0700 | [diff] [blame] | 123 | |
| 124 | acpi.debug_layer=0x2 acpi.debug_level=0xffffffff |
| 125 | |
Changbin Du | 99ed6bf | 2019-04-25 01:52:58 +0800 | [diff] [blame] | 126 | Enable all ACPI_DB_INFO messages after boot:: |
Bjorn Helgaas | a0d84a9 | 2008-11-07 16:58:05 -0700 | [diff] [blame] | 127 | |
| 128 | # echo 0x4 > /sys/module/acpi/parameters/debug_level |
| 129 | |
Changbin Du | 99ed6bf | 2019-04-25 01:52:58 +0800 | [diff] [blame] | 130 | Show all valid component values:: |
Bjorn Helgaas | a0d84a9 | 2008-11-07 16:58:05 -0700 | [diff] [blame] | 131 | |
| 132 | # cat /sys/module/acpi/parameters/debug_layer |