The aml-debugger.txt the instruction of how to enable AML debugger, is available at Documentation/acpi/ in Linux kernel source code. In short, two things are required to run AML debugging
- Enabling AML debugging (CONFIG_ACPI_DEBUGGER=y & CONFIG_ACPI_DEBUGGER_USER=m) in Linux kernel
- Compile an utility, acpidbg from Linux kernel (I uploaded a copy here)
Executing acpidbg on Ubuntu 18.04 is very straight-forward
and "help" shows a list supported commands
acpidbg is particularly handy when one needs to evaluate any ACPI AML objects during runtime - especially the ones that changes under different conditions. This may be best explained by some examples below:
Example - Determine implementation for AC power status. This includes 1) find _PSR object, 2) evaluate _PSR when AC is disconnected, and 3) evaluate _PSR when AC is connected.
acpidbg also works with more complex returns such as packages.
Example - Determine battery information and status. This include 1) find _BIF and _BST objects, 2) evaluate _BIF and _BST objects (note _BST changes dynamically).
acpidbg can decode bit fields in the return to save some time on counting bits. Please try to run acpidbg on any _PLD objects and you will understand what I mean :).