1# ACPI debugging
2
3## ACPICA debug interfaces
4
5To turn on ACPICA's debug output, pass "ENABLE\_ACPI\_DEBUG=1" to make.  When this
6option is enabled, ACPICA uses two global variables to control debug output.
7
8### AcpiDbgLevel
9
10AcpiDbgLevel is a bitmap of values defined in
11third\_party/lib/acpica/source/include/acpica/acoutput.h with the prefix
12"ACPI\_LV\_".  For convenience, there are some pre-defined verbosity levels:
13ACPI\_LV\_VERBOSITY1, ACPI\_LV\_VERBOSITY2, ACPI\_LV\_VERBOSITY3.  These control
14types of tracing events to log.  For example, if you want to trace all function
15calls and mutex operations, you can set AcpiDbgLevel to
16
17"ACPI\_LV\_FUNCTIONS | ACPI\_LV\_MUTEX"
18
19### AcpiDbgLayer
20
21AcpiDbgLayer is a bitmap of values defined in
22third\_party/lib/acpica/source/include/acpica/acoutput.h.  These do not have a
23common prefix, but are listed as "Component IDs".  These control which
24submodules of ACPICA are to be traced.  For example, to trace through the
25namespace logic and the executor, you can set AcpiDbgLayer to
26
27"ACPI\_NAMESPACE | ACPI\_EXECUTOR"
28
29### Setting these values
30
31One easy place to set these in the AcpiOsInitialize method that we define in
32third\_party/lib/acpica/source/os\_specific/service\_layers/osfuchsia.cpp.
33One technique that may be useful is zeroing both values in AcpiOsInitialize, and
34setting it to a non-zero value immediate before a call into ACPICA of interest.
35
36### AcpiDebugTrace
37
38There is additionally a method named AcpiDebugTrace in the ACPIA API.  It
39supposedly supports tracing particular ACPI methods by their 4-character
40namespace names (but with no scoping to particular Nodes).  See the ACPICA
41manual for details.
42