On Aug 5, 9:24 am, "[email protected]"
<[email protected]> wrote:
> I ended up writing an app that sleeps forevern in an event handling
> function. Whenever I need to dump stacks, I just run this app and then
> adb pull /data/and/traces.txt

If you send SIGQUIT (signal 3) to a process, it will dump all stacks.
You could use android.os.Process.sendSignal() to do this from within
an Android app.

They go to the log file unless the dalvik.vm.stack-trace-file property
was set when the system was started.  Since this is currently being
set to /data/anr/traces.txt, the traces get written there instead.

You could gather the stacks from within the program, by calling
Thread.getAllStackTraces().  However, if you're trying to identify a
deadlock, the SIGQUIT output is probably more useful.  In froyo, if a
thread is blocked trying to acquire a monitor lock, the output will
indicate which lock it's after and which thread currently holds that
lock.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to