Last Friday, Lv Zheng of Intel sent a 5-part patch to the linux-acpi and linux-kernel mailing lists. Below is documentation excerpt from initial patch:
ACPICA / debugger: Add in-kernel AML debugger support
This patchset enables ACPICA debugger for Linux kernel and implements a userspace utility to access it.
A. Build the AML debugger
In order to build the kernel support of AML debugger, the following kconfig items should be enabled:
CONFIG_ACPI_DEBUG=y
CONFIG_ACPI_DEBUGGER=y
CONFIG_DEBUG_FS=y
CONFIG_ACPI_DEBUGGER_USER=m
The userspace tool can be found at tools/power/acpi/tools/acpidbg. To build this utility, staying in tools folder and type “make acpi”.
B. Load the AML debugger during runtime
In order to use the in-kernel AML debugger, the following command should be executed using root user:
# modprobe acpi_dbg
# mount -t debugfs none /sys/kernel/debug
# acpidbg
C. Batch mode
In order to support scripts, the userspace utility also supports single command batch mode:
# acpidbg -b “help”
# acpidbg -b “tables”
# acpidbg -b “find _LID”
# acpidbg -b “execute \_SB.LID0._LID”
You can find the documentation about the ACPICA debugger commands in:
https://acpica.org/sites/acpica/files/acpica-reference_17.pdf
(The latest document can be found at https://acpica.org/documentation)
And refer to the chapter – ACPICA debugger reference to obtain the full description of the debugger commands. Note that not all commands are supported by an in-kernel AML debugger.
D. Unload the AML debugger during runtime
After terminating all acpidbg instances, the following command can be executed to remove the AML debugger from kernel:
# rmmod acpi_dbg
The following tasks are not completed:
1. .flush() support in the kernel debugger IO driver.
2. multi-commands batch mode.
3. upstream the userspace acpidbg to the ACPICA upstream.
For more information, see the threads on the linux-kernel and linux-acpi mailing lists, run at vger.kernel.org.