debug.rst 4.8 KB

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