S3SystemTapDebug
ACPI Suspend/Resume Debug Tool
UNDER DEVELOPMENT
S3 debug scripts
How to Use
0. Clone the git repo:
sudo apt-get install git git clone git://kernel.ubuntu.com/cking/pmdebug.git
and build the locatehang tool:
cd pmdebug/locatehang make cd ../..
1. Install kernel debug .ddeb (this may take a while!)
1.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
1.2) Import the debug symbol archive signing key:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 428D7C01
1.3) Then run:
sudo apt-get update
1.4) Download and install the debug kernel:
sudo apt-get install linux-image-$(uname -r)-dbgsym
1.5) Install systemtap
sudo apt-get install systemtap
2. Run the s3test script
cd pmdebug/systemtap sudo ./s3test -s
There are a few optional arguments to do some deeper debugging.
-f, --flash funcname flash the keyboard LEDs when we execute one of the s3 instrumented functions -b, --beep beep the speaker when we execute one of the s3 instrumented functions -r, --reboot reboot the machine when we execute one of the s3 instrumented functions -s automatically suspend the machine
3. Examine the gathered data
- Full trace log in s3-systemtap.log
- Function traces in s3-trace.log (note that some inline'd functions and return paths cannot be traced).
- Device suspend/resume state in s3-devices.log
- Task suspend/resume state in s3-tasks.log
- Test results in s3-test.log
If the machine hangs, reboot the machine and run the 'locatehang' program. This will convert a hash in the Real Time Clock (RTC) back into a function hash and then lookup and determine the last instrumented function executed before the machine locked up. Note that one has to reboot the machine and run 'locatehang' fairly quickly since the RTC will overwrite the stored hash after 3 minutes.
4. Examples
sudo ./s3test -s --flash syscore_suspend
flash keyboard LEDs when we reach syscore_suspend()
sudo ./s3test -s --reboot disable_nonboot_cpus --beep usermodehelper_disable
reboot the machine if we get as far as disable_nonboot_cpus() and beep the PC speaker when we enter/exit usermodehelper_disable().
Kernel/Reference/S3SystemTapDebug (last edited 2011-09-19 10:49:18 by colin-king)