aboutsummaryrefslogtreecommitdiff
path: root/vm/interp/Stack.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Print the locker thread when waiting on an objectPal Szasz2012-12-061-0/+3
| | | | | | | | | | | | | When dumping stacktraces, and if one thread is blocked due to a call to Object.wait, the dump will just tell us the object pointer it is waiting on, but not the thread which actually locked the object. This patch tries to extract that informatation as well. Note that this information is not always available, since maybe no other thread aquired the lock yet. Change-Id: Id0ae23e17c58fc3712251f00b0a741191b5a5aee
* Log when the native trace is unavailableAndy McFadden2012-09-181-0/+2
| | | | | | | | | | 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 Change-Id: Ibc9e6a6f0fc855a4e5e8e133122232dc939bcb16
* Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-081-7/+7
| | | | | | | | | See https://android-git.corp.google.com/g/#/c/157220 Also fix an occurrence of LOGW missed in an earlier change. Bug: 5449033 Change-Id: I2e3b23839e6dcd09015d6402280e9300c75e3406
* Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGESteve Block2012-01-061-6/+6
| | | | | | | See https://android-git.corp.google.com/g/157065 Bug: 5449033 Change-Id: Ia5d301248024df26c2a29dabdfe738e39ec87c82
* Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGESteve Block2012-01-051-5/+5
| | | | | | | See https://android-git.corp.google.com/g/156801 Bug: 5449033 Change-Id: Ic558031c75b3702d90eb78bd730501ae5d3c077b
* Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGESteve Block2012-01-031-7/+7
| | | | | | | See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: Ic663376d1ad6a6cb14bf81405ad9afd247cf2f60
* Use libcorkscrew to format the stack trace.Jeff Brown2011-11-211-10/+4
| | | | Change-Id: I06ddbb7a8035971b6e1a164adcd00208fae89b1a
* am 50e01501: Merge "Knock ::self() out of the ParseXml profile." into ics-mr1Elliott Hughes2011-11-051-4/+2
|\ | | | | | | | | * commit '50e015017f091118f0147d02d23140ff9f88daec': Knock ::self() out of the ParseXml profile.
| * Knock ::self() out of the ParseXml profile.Elliott Hughes2011-11-031-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New profile (>=0.6, which is where the original seems to have cut off): 47 11.0070 dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*) 30 7.0258 dvmChangeStatus(Thread*, ThreadStatus) 29 6.7916 addLocalReference(Thread*, Object*) 26 6.0890 dexDecodeDebugInfo(DexFile const*, DexCode const*, char const*, unsigned int, unsigned int, int (*)(void*, unsigned int, unsigned int), void (*)(void*, unsigned short, unsigned int, unsigned int, char const*, char const*, char const*), void*) 22 5.1522 dalvik_inst 15 3.5129 lockMonitor(Thread*, Monitor*) 14 3.2787 dvmLineNumFromPC 13 3.0445 javaLangString_equals(unsigned int, unsigned int, unsigned int, unsigned int, JValue*) 13 3.0445 scanObject(Object const*, GcMarkContext*) 12 2.8103 ScopedJniThreadState::ScopedJniThreadState(_JNIEnv*) 12 2.8103 common_invokeMethodNoRange 12 2.8103 dvmDecodeIndirectRef(Thread*, _jobject*) 9 2.1077 IndirectRefTable::add(unsigned int, Object*) 9 2.1077 ReleasePrimitiveArrayCritical(_JNIEnv*, _jarray*, void*, int) 9 2.1077 markObjectNonNull(Object const*, GcMarkContext*, bool) 9 2.1077 unpinPrimitiveArray(ArrayObject*) 8 1.8735 getCodeAddrCommon(unsigned short const*, bool) 7 1.6393 dexStringByTypeIdx(DexFile const*, unsigned int) 7 1.6393 dvmHeapSourceAlloc(unsigned int) 6 1.4052 GetPrimitiveArrayCritical(_JNIEnv*, _jarray*, unsigned char*) 6 1.4052 dvmPlatformInvoke 6 1.4052 pinPrimitiveArray(ArrayObject*) 6 1.4052 readUnsignedLeb128(unsigned char const**) 6 1.4052 scanFields(Object const*, GcMarkContext*) 5 1.1710 IndirectRefTable::get(void*) const 5 1.1710 dvmFindInReferenceTable(ReferenceTable const*, Object**, Object*) 4 0.9368 common_returnFromMethod 4 0.9368 dvmAddToReferenceTable(ReferenceTable*, Object*) 4 0.9368 dvmHeapBitmapScanWalk(HeapBitmap*, void (*)(Object*, void*, void*), void*) 4 0.9368 dvmInterpret(Thread*, Method const*, JValue*) 4 0.9368 dvmLockObject 4 0.9368 dvmMalloc(unsigned int, int) 4 0.9368 findPackedSwitchIndex(unsigned short const*, int, int) 4 0.9368 readStringIdx(DexFile const*, unsigned char const**) 4 0.9368 unlockMonitor(Thread*, Monitor*) 3 0.7026 dvmSetFinalizable Change-Id: Ic5c36859f6810413bd0b48aad1d99da7daa6e8ba
* | Slight change to unwinder API.Jeff Brown2011-11-031-1/+1
| | | | | | | | Change-Id: If73f01fff9fb56ce9cba70a386d865957eaebe78
* | Dump stacks for all native threads, not just those in JNI.Jeff Brown2011-10-271-5/+2
| | | | | | | | Change-Id: I276f5f448f22f8a926cdfc8c93935da687db5d9b
* | Dump native stack of JNI methods when handling SIGQUIT.Jeff Brown2011-10-221-0/+37
|/ | | | Change-Id: I7da7259f1350e853153ba4dea96797fc86284068
* Don't wrap the actual type in parens if its null.Jesse Wilson2011-08-141-6/+1
| | | | | | | Otherwise the exception message has unnecessary parens: "expected receiver of type java.lang.String, but got (null)" Change-Id: Iacd806d018019784afa6e9f25f7c039d9ca18fae
* Don't use dvmIsValidObject outside the GC.Elliott Hughes2011-07-191-3/+3
| | | | | | | | Use dvmIsHeapPointer outside the GC. (This still isn't safe because there's no synchronization when dealing with the HeapSource.) Bug: 5049447 Change-Id: Ie0b325ef0a92687ea1eaf1491a4bb832298893c5
* Improve -verbose:jni.Elliott Hughes2011-06-281-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old output just told you what functions were being called and made no attempt to show you their arguments. The new output was sufficient to debug an actual problem with an app we don't have the source to. Still to do: 0. an easier way for third-party developers to enable this. 1. the primitive type arguments to SetIntField and so forth. 2. return values. A few examples of the new output... A decoded jclass: JNI: libcore.io.Posix.readBytes called IsInstanceOf((JNIEnv*)0x9618470, 0x28100015, java.lang.Class<byte[]>) A decoded jfieldID: JNI: libcore.io.Posix.ioctlInt called GetIntField((JNIEnv*)0x9618470, 0x5cb00011, java.io.FileDescriptor.descriptor) A decoded jmethodID (the FileDescriptor constructor): JNI: libcore.io.Posix.open called NewObject((JNIEnv*)0x9780480, java.lang.Class<java.io.FileDescriptor>, java.io.FileDescriptor.<init>()V, ...) A const char*: JNI: libcore.io.Posix.getsockoptLinger called NewStringUTF((JNIEnv*)0x9618470, "getsockopt") A jint release mode: JNI: libcore.io.Posix.writeBytes called ReleaseByteArrayElements((JNIEnv*)0x9780480, 0x2700009, (void*) 0xf5f623c4, JNI_ABORT) The -verbose:jni option now turns on a bit more output about JNI_OnLoad calls but no longer causes any logging of calls to JNIEnv or JavaVM functions. The old -Xjnitrace: option has been extended to enable this new tracing for the native methods that it covers. They go very well together for debugging purposes. I've also made us a bit more verbose if we fail to initialize. In the longer term I think we want to just abort if we hit any failure during startup, but my extra logging will save us a bit of time next time we have one of these failures (this one was caused for me by only having one half of the finalizer watchdog change; I was missing the libcore side). (Cherry pick of 6734b8224fb869c94e42e704ec03f2ce8483af2b from dalvik-dev.) Change-Id: I69b7620b20620e9f06576da244520d9d83f89ab8
* Add and use StringAppendF.Elliott Hughes2011-06-171-2/+2
| | | | | | I've also removed the dvm prefix from the existing StringPrintf. Change-Id: I3d01f676c876957b6c6e032c674e1a06c3670021
* Improve reference table dumping.Elliott Hughes2011-06-161-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Show the newest entry first; I always assume the top is the newest. 2. Use human-readable type names. 3. Improve the human-readable type name code to show _which_ Class (i.e. java.lang.Class<java.lang.String> rather than just java.lang.Class). 4. Make it clear when we're reporting the number of elements in an array. 5. Show the first few characters of a string. 6. Show the length of a string if we truncate it. (I've also removed some redundant casts and improved const-correctness.) Example: Last 10 entries in JNI local reference table: 16: 0x40f8ec70 java.lang.String "android.permissi... (41 chars) 15: 0x40f8d450 android.os.Parcel 14: 0x40f8eb90 java.lang.String "BlackSurface" 13: 0x408caca0 android.view.SurfaceSession 12: 0x40f8eb60 android.view.Surface 11: 0x406bc6f0 java.lang.Class<com.android.server.SystemServer> 10: 0x406c0278 java.lang.String "com/android/serv... (31 chars) 9: 0x4015d488 dalvik.system.PathClassLoader 8: 0x40148de8 java.lang.Class<java.lang.ClassLoader> 7: 0x406bc560 java.lang.String[] JNI local reference table summary (17 entries): 6 of java.lang.Class<com.android.server.SystemServer> (5 unique instances) 5 of java.lang.String (5 unique instances) 1 of java.lang.String[] 1 of java.lang.String[] (2 elements) 1 of dalvik.system.PathClassLoader 1 of android.os.Parcel 1 of android.view.SurfaceSession 1 of android.view.Surface Change-Id: I56494104cd0daada3ecc1e610f1c94df1e11c640
* Improve "waiting on"/"waiting to lock" SIGQUIT dump info.Elliott Hughes2011-06-071-22/+25
| | | | | | | | | | | | | In particular, when we're waiting on a Class, say which class: I(16573) - waiting on <0xf5ed54f8> (java.lang.Class<java.lang.ref.ReferenceQueue>) versus: I(16573) - waiting on <0xf5feda38> (a java.util.LinkedList) Bug: http://code.google.com/p/android/issues/detail?id=17349 Change-Id: I844d02c008b1499adb02995ff3da25ba8cad0e0a
* Switch dvmHumanReadableDescriptor over to std::string.Elliott Hughes2011-06-071-38/+29
| | | | | | (Prep work before making a change to stack dumps.) Change-Id: I0af49b920f450fd2611e4b96e717a637483122d6
* More LOG newline cleanup.Dan Bornstein2011-05-261-3/+3
| | | | | | | This changes all the places I could find where the log string was on the line after its LOG call. Change-Id: Iac6a9fcc64f46631fb093824ab60237dce1a5241
* Further conservation of newlines.Dan Bornstein2011-05-261-29/+29
| | | | | | Friends don't let friends end LOG() strings with newlines. Change-Id: I5a18c766c90c4ab5f03caa6acd601d34d91beb00
* Establish a subclass relationship between DataObject and Object.Carl Shapiro2011-05-021-1/+1
| | | | Change-Id: Ifd0e364f7789d9e13f769f8d6a65c3c573915fd3
* Get rid of uneeded extern, enum, typedef and struct qualifiers.Carl Shapiro2011-04-271-2/+2
| | | | Change-Id: I236c5a1553a51f82c9bc3eaaab042046c854d3b4
* Consolidate curFrame fields in thread storagebuzbee2011-04-221-60/+74
| | | | | | | We ended up with two locations in the Thread structure for saved Dalvik frame pointer. This change consolidates them. Change-Id: I78f288e4e57e232f29663be930101e775bfe370f
* am 90232632: Kill stale assert, fix for 4310384buzbee2011-04-211-4/+0
| | | | | * commit '902326326616642ae5ad0dd3c493a9e3abcd55da': Kill stale assert, fix for 4310384
* Move the verifier and parts of the interpreter into C++.Carl Shapiro2011-04-151-0/+1384
Change-Id: I8ce5fb558871d9709b251512dd01206be5ca8497