diff options
author | Andy McFadden <fadden@android.com> | 2012-09-18 17:50:59 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2012-09-20 11:30:57 -0700 |
commit | c32a3774e9c1eeb289d71e0e53199893b6951b1b (patch) | |
tree | 915a4abd943848dd0dd3f52c82492b26473128b4 /vm/Thread.cpp | |
parent | a177aa50c665e97f92ee7519ed9d32b0e89e84d3 (diff) | |
download | android_dalvik-c32a3774e9c1eeb289d71e0e53199893b6951b1b.tar.gz android_dalvik-c32a3774e9c1eeb289d71e0e53199893b6951b1b.tar.bz2 android_dalvik-c32a3774e9c1eeb289d71e0e53199893b6951b1b.zip |
Log when the native trace is unavailable
This should allow us to differentiate between "couldn't get the
stack" and "didn't try to get the stack". Also show the thread's
state (e.g. 'R' for running, 'D' for uninterruptible syscall).
Bug 7053953
(cherry-pick of b3667a19f5c573b7785876979af4781292d27327.)
Change-Id: I0a40cb3d3cdd9aef8589a39586cccd9c229aa8cb
Diffstat (limited to 'vm/Thread.cpp')
-rw-r--r-- | vm/Thread.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/vm/Thread.cpp b/vm/Thread.cpp index aa2352af2..7f6f58376 100644 --- a/vm/Thread.cpp +++ b/vm/Thread.cpp @@ -3236,9 +3236,9 @@ static void dumpSchedStat(const DebugOutputTarget* target, pid_t tid) { /* show what we got */ dvmPrintDebugMessage(target, - " | schedstat=( %s ) utm=%lu stm=%lu core=%d\n", - schedstatBuf, procStatData.utime, procStatData.stime, - procStatData.processor); + " | state=%c schedstat=( %s ) utm=%lu stm=%lu core=%d\n", + procStatData.state, schedstatBuf, procStatData.utime, + procStatData.stime, procStatData.processor); #endif } @@ -3344,7 +3344,15 @@ void dvmDumpThreadEx(const DebugOutputTarget* target, Thread* thread, dumpSchedStat(target, thread->systemTid); - /* grab the native stack, if possible */ + /* + * Grab the native stack, if possible. + * + * The native thread is still running, even if the Dalvik side is + * suspended. This means the thread can move itself out of NATIVE state + * while we're in here, shifting to SUSPENDED after a brief moment at + * RUNNING. At that point the native stack isn't all that interesting, + * though, so if we fail to dump it there's little lost. + */ if (thread->status == THREAD_NATIVE || thread->status == THREAD_VMWAIT) { dvmDumpNativeStack(target, thread->systemTid); } |