ACPIDebuggingAMLwithSystemTap

Revision 2 as of 2011-09-15 13:12:46

Clear message

ACPI: Debugging AML with SystemTap

This document is intended to explain to dump out ACPI AML opcodes at run time using SystemTap. This approach is an alternative to dumping out AML opcodes using CONFIG_ACPI_DEBUG and setting the appropriate debug_level/debug_layer bitmasks that produces copious amounts of debug.

Instructions

1. Clone the pmdebug git repository:

git clone git://kernel.ubuntu.com/cking/pmdebug.git

2. Install SystemTap and the appropriate kernel .ddebs

sudo apt-get install systemtap

2.1) Create an /etc/apt/sources.list.d/ddebs.list by running the following line at a terminal:

echo "deb http://ddebs.ubuntu.com $(lsb_release -cs) main restricted universe multiverse" |\
 sudo tee -a /etc/apt/sources.list.d/ddebs.list

2.2) Import the debug symbol archive signing key:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 428D7C01

2.3) Then run:

sudo apt-get update

2.4) Download and install the debug kernel, e.g.

sudo apt-get install linux-image-`uame -r`-dbgsym

3. Run the script

sudo stap -g pmdebug/systemtap/amltrace/amltrace.stp

..this will take a few moments to build and then run. You can then see the objects being evaluated, an AML op-code disassembly and calls to other methods as the AML is being executed.

Starting ACPI debugger.
Evaluate _Q66():
  Op: 0x002d INT_NAMEPATH_OP      [0x02 ARGUMENT]
  Op: 0x000a BYTE_OP              [0x02 ARGUMENT]
  Op: 0x0093 LEQUAL_OP            [0x00 EXECUTE]
  Op: 0x0092 LNOT_OP              [0x00 EXECUTE]
  Op: 0x00a0 IF_OP                [0x04 CONTROL]
  Op: 0x0035 INT_METHODCALL_OP    [0x09 METHOD_CALL]
Call NEVT():
  Op: 0x0035 INT_METHODCALL_OP    [0x09 METHOD_CALL]
Call ECG1():
  Op: 0x000a BYTE_OP              [0x02 ARGUMENT]
  Op: 0x0035 INT_METHODCALL_OP    [0x09 METHOD_CALL]
Call ECRW():
  Op: 0x0068 ARG0                 [0x02 ARGUMENT]
  Op: 0x0035 INT_METHODCALL_OP    [0x09 METHOD_CALL]
Call ECR2():
  Op: 0x0068 ARG0                 [0x02 ARGUMENT]
  Op: 0x0035 INT_METHODCALL_OP    [0x09 METHOD_CALL]
Call ECR1():
  Op: 0x002d INT_NAMEPATH_OP      [0x02 ARGUMENT]
  Op: 0x000a BYTE_OP              [0x02 ARGUMENT]
  Op: 0x0093 LEQUAL_OP            [0x00 EXECUTE]
  Op: 0x00a0 IF_OP                [0x04 CONTROL]