Skip to content
A kernel extension and DSDT patches to enable debug tracing from ACPI code (DSDT) to system.log
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
ACPIDebug.xcodeproj rework version info injection Sep 4, 2015
.gitignore initial commit Oct 15, 2013
.maciasl initial commit Oct 15, 2013
README Update README download link for bitbucket bug Feb 23, 2017
debug.txt add instrumentation patches May 12, 2014
debug_extern.txt add instrumentation patches May 12, 2014 add Instrument LID Jun 17, 2014
instrument_Lxx.txt add Instrument LID Jun 17, 2014
instrument_Qxx.txt need double backslash on rmdt references May 12, 2014
instrument_WAK_PTS.txt add instrumentation patches May 12, 2014
makefile install to /L/E on 10.11+ Oct 31, 2015 install to /L/E on 10.11+ Oct 31, 2015


Written by RehabMan 2013-10-15

Advanced Configuration and Power Interface (ACPI) based kernel extension for debugging DSDT code.  This kext allows one to easily trace variables and execution path from DSDT (or SSDT) code.


To use it you must install the two components that make up the software.  First of all, you must patch your DSDT to add the RMDT (RehabMan Debug Trace) device.  The presence of this device allows the kext to load.  Apply the debug.txt patch via MaciASL.  You can also add this repo as a MaciASL "source" in MaciASL preferences:

Second, you must install the kext (ACPIDebug.kext).  You can build it at the command line with 'make' and install it with Kext Wizard (or your favorite kext installer), or you can install it at the command line with 'make install'.  Of course, you can also build it with Xcode.  I'm using Xcode 5.0 at the moment.  You can also use my pre-built kext downloaded from bitbucket.  Links are provided below.

Third, add code to your DSDT to where you wish to cause trace messages to system.log (call \RMDT.PUSH).

Change Log:


- fix minor thread sync bug that would cause a spurious 0x0 to be output


- added ability to force calls into DBGx methods in RMDT device via 'ioio' utility


- initial release

Downloads and more information:

Downloads are available on Bitbucket:

Please see this thread on


Using the tracing facility:

The DSDT patch adds the RMDT device at the root of your DSDT.  There are several methods you can use from within the DSDT to "push" debug output to the kext:

PUSH: Takes a single parameter (of any type, including Packages and Buffers).  The contents of this parameter will be displayed by the kext to system.log.

P1, P2 through P7.  P1 does exactly the same as PUSH.  Each of these utility methods takes 1 to 7 parameters (according to the name of the method).  This makes it easy to provide descriptions for your data or have multiple variables displayed on one line in system.log.

The other methods COUN, and FTCH are part of the implementation.  These methods are called by ACPIDebug.kext to pull information.


\RMDT.PUSH("Entering _WAK")
output: ACPIDebug: "Entering _WAK"

example output: ACPIDebug: 0x10

\RMDT.P2("Local0", Local0)
example output: ACPIDebug: { "Local0", 0x10, }

\RMDT.P4("OSFL() returns", OSFL(), "OSVR is", OSVR)
example output: ACPIDebug: { "OSFL() returns", 0xABC, "OSVR is", 0x60, }

Name(TEST, Buffer() { 128, 255, 10, 127 }
example output: ACPIDebug: { 0x80, 0xFF, 0x0A, 0x7F, }

Name(TEST, Package() { Package() { 128, 255 }, Package() { 1, 2, 3, 10 })
example output: ACPIDebug: { { 0x80, 0xFF }, { 0x1, 0x2, 0x3, 0xA }, }

How it works:

Internally the RMDT device maintains a ring buffer of objects added via PUSH (ring buffer uses a Package).  The ring buffer size is 256.  The ACPIDebug.kext polls the RMDT device (via FTCH) every 100ms to see if any objects are available for printing.  If they are they are pulled from the ring buffer and output to system.log (it is a FIFO ring).  Objects added to the ring buffer when it is full are ignored.

Forcing calls into RMDT from Terminal:

With the latest changes you can also force calls into methods in RMDT by using ioio.  For ioio, see:

The mapping of properties to methods is as follows:

dbg0 -> DBG0
dbg1 -> DBG1
dbg9 -> DBG9

The methods will take one parameter (which is the value that the property was set to).  The return value of the method is ignored.

So, in the RMDT device, you can add a method as such:

Method(DBG0, 1, Serialized)
   \RMDT.P2("DBG0 Arg0=", Arg0)
   If (LEqual(Arg0, 5))
      \RMDT.P1("You set dbg0 to 5")
      \RMDT.P1("You set dbg0 to something other than 5")

You could, of course, output any other DSDT data you wanted to in that method.

In order to trigger the method, set the 'dbg0' property with ioio:

# in Terminal
ioio -s org_rehabman_ACPIDebug dbg0 5

You can’t perform that action at this time.