summaryrefslogtreecommitdiffstats
path: root/vm/Thread.cpp
Commit message (Collapse)AuthorAgeFilesLines
* export setThreadName() and add NULL checkWilliam Roberts2014-01-171-3/+9
| | | | Change-Id: I9b69a23b308fe851ed49722c0da3953433b3f5b8
* Add support for sample profiling in traceview.Jeff Hao2013-08-281-0/+1
| | | | | | | | | | Instead of method instrumentation, allow traceview to periodically sample stack traces of threads. Disabled by default until we add gui support for this new mode. (cherry picked from commit 676f8a527fb62abd39663d55c7d9208f5ca03093) Change-Id: Ia5d0d57012305a5830d042bcb903a429432b035b
* am f6944312: Merge "Fix a minor bug in dvmCreateInterpThread"Elliott Hughes2013-06-051-0/+1
|\ | | | | | | | | * commit 'f694431279501527cc3271d50b619533000dbd8f': Fix a minor bug in dvmCreateInterpThread
| * Merge "Fix a minor bug in dvmCreateInterpThread"Elliott Hughes2013-06-051-0/+1
| |\
| | * Fix a minor bug in dvmCreateInterpThreadYou Kim2013-04-041-0/+1
| | | | | | | | | | | | Change-Id: I452ee02290bc7e0be7fefcf5755c5cd9628142dc
* | | am f3079bda: Merge "Rename unreasonable function name dmvCompilerTemplateEnd"Elliott Hughes2013-06-051-1/+1
|\| | | | | | | | | | | | | | * commit 'f3079bdadf30d93b37e0a59a8787c636027a36f5': Rename unreasonable function name dmvCompilerTemplateEnd
| * | Rename unreasonable function name dmvCompilerTemplateEndYanchuan Nian2013-06-051-1/+1
| | | | | | | | | | | | | | | | | | | | | In dalvik, most function names start with "dvm" except dmvCompilerTemplateEnd. Convert it to dvmCompilerTemplateEnd in order to follow the rule. Change-Id: I09c41f8c9d55058013fbdb62ac5922ccd067ce39
| * | Remove spammy logging from 8470684 investigation.Elliott Hughes2013-04-231-43/+3
| | | | | | | | | | | | | | | | | | | | | | | | This has been tracked down to a kernel bug, so we no longer need the extra diagnostics. Bug: 8470684 Change-Id: Ib170d1f7b94488ed4acc763f8dddc44c81807aed
| * | More native stack dump hardening.Elliott Hughes2013-04-121-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Threads just starting up or shutting down might not have any managed stack frames, leading to a NULL "currFrame" frame pointer in the interpreter stack. Bug: 8596028 Change-Id: Ie24c8d5f8e78a5abe882a9e639046c03abb91649
| * | Harden the native stack dumping decision.Elliott Hughes2013-04-111-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We've seen monkey crashes in this code, though I haven't been able to reproduce them in my own SIGQUIT stress tests. Address the two most likely causes of trouble: dumping the signal catcher's own thread (which will always be runnable), and assuming that the Method* pulled from the save area is non-NULL. Bug: 8596028 Change-Id: I59d1dcb2264a774d8416d50a5f77a06c70d37c59
| * | Dump native stacks for all threads in native code.Elliott Hughes2013-04-051-10/+21
| |/ | | | | | | | | Bug: 7432159 Change-Id: I83cb530155edfc35ae3be0f7a2a044245223d2d5
| * Extra log information when pthread_create fails.Elliott Hughes2013-03-291-11/+45
| | | | | | | | | | Bug: 8470684 Change-Id: I24d22d5ec4181614d173a582773540c8f712ab18
* | Merge "Add systrace tracing for GC and thread suspension." into jb-mr2-devJamie Gennis2013-05-081-0/+5
|\ \
| * | Add systrace tracing for GC and thread suspension.Jamie Gennis2013-05-071-0/+5
| | | | | | | | | | | | | | | Bug: 8856374 Change-Id: I58420a14fb52eab6295381a4d8f2d59eacfe0473
* | | Remove spammy logging from 8470684 investigation.Elliott Hughes2013-04-231-43/+3
|/ / | | | | | | | | | | | | | | | | | | | | This has been tracked down to a kernel bug, so we no longer need the extra diagnostics. Bug: 8470684 (cherry picked from commit 3a9dbd30eb1598c737af7ef6110d46767d6e0336) Change-Id: I0877a24a5a409695c3a1a9ddb5c7c4d78e6a578e
* | More native stack dump hardening.Elliott Hughes2013-04-121-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | Threads just starting up or shutting down might not have any managed stack frames, leading to a NULL "currFrame" frame pointer in the interpreter stack. Bug: 8596028 (cherry picked from commit 46371593812d966c40e1ec4019e3c7c6613046a6) Change-Id: I0fbc6d422bcae0fd080f7c1a63198755235e9e00
* | Harden the native stack dumping decision.Elliott Hughes2013-04-111-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | We've seen monkey crashes in this code, though I haven't been able to reproduce them in my own SIGQUIT stress tests. Address the two most likely causes of trouble: dumping the signal catcher's own thread (which will always be runnable), and assuming that the Method* pulled from the save area is non-NULL. (cherry-pick of feddac5b7718dd8141391bfeb6359f1906542823.) Bug: 8596028 Change-Id: I7a70ce047c8285715eb7bbb9438e8ef5d81fc59c
* | Dump native stacks for all threads in native code.Elliott Hughes2013-04-051-10/+21
| | | | | | | | | | | | | | | | Bug: 7432159 (cherry picked from commit 890ce010c4846deb82d3ac09b6d2ceb76e59fb67) Change-Id: I12e9b6998f2119e0fabb5717e9c54c53f206d34f
* | Extra log information when pthread_create fails.Elliott Hughes2013-03-291-11/+45
|/ | | | | | | | Bug: 8470684 (cherry picked from commit 3eeda5e6fe172758e47d237694daf4f9421f3c12) Change-Id: Ideba410d393b69753bbfae7558a2692edd08d339
* pthread_create doesn't set errno.Elliott Hughes2013-03-261-13/+20
| | | | | | | | | | Let's try to get slightly better logging and exception detail messages. Also fix the "set but not read" warnings for the other pthread functions in this file. Bug: 8470684 Change-Id: I7f9dbb4d39b4e3022cd5f1a8a45c6426e68c858b
* Reclaiming attribute obj after pthread_createYou Kim2012-12-171-7/+6
| | | | | | call pthread_attr_destroy in order to reclaim attribute object. Change-Id: I2592903ef67101a7c656a3ab0ad243a9716298b5
* Fix dalvik's use of readdir_r(3).Elliott Hughes2012-10-261-5/+4
| | | | Change-Id: Ic2c9b88b2b3204b4c02f4838766dc4d9ebad06a2
* Log when the native trace is unavailableAndy McFadden2012-09-201-4/+12
| | | | | | | | | | | | 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
* resolved conflicts for merge of 93a44a28 to jb-dev-plus-aospElliott Hughes2012-05-031-5/+15
|\ | | | | | | Change-Id: I9c1f2e37602bea86e70333d2b274665e99fcbd92
| * [MIPS] Dalvik fast interpreter support and JIT implementationRaghu Gandham2012-05-021-3/+14
| | | | | | | | | | | | | | | | Change-Id: I9bb4f6875b7061d3ffaee73f204026cb8ba3ed39 Signed-off-by: Raghu Gandham <raghu@mips.com> Signed-off-by: Chris Dearman <chris@mips.com> Signed-off-by: Douglas Leung <douglas@mips.com> Signed-off-by: Don Padgett <don@mips.com>
| * Fix a small memory leak.Elliott Hughes2012-04-191-1/+4
| | | | | | | | | | | | | | | | | | | | Found by someone reading the code, rather than because we saw a crash. This is only a small leak, and you'd have to be dumping threads (because of an ANR) or creating a new thread to provoke it. (cherry picked from commit 6d1a1dfd0ef006e19067b6ffd927160d0c6d9647) Change-Id: Id857efca8d34b20d1acaa452c3fe5d2975e2572b
* | Add a -XX:mainThreadStackSize= option.Elliott Hughes2012-04-121-1/+1
| | | | | | | | | | | | | | Similar to -Xss, but for the main thread only. Bug: 6315322 Change-Id: I84bd5974f830f348fd9a0486ae972520b4a02cc4
* | Dump the native stacks of threads in VmWait as well Native.Elliott Hughes2012-04-051-1/+1
| | | | | | | | | | | | | | | | | | Mostly these are boring, but when they're boring they're also short. And sometimes they're interesting. Bug: 6294717 Change-Id: I1bf9e32a5cc237efda365abe39ad84ac59fd5c8f
* | Fix a small memory leak.Elliott Hughes2012-01-091-1/+4
| | | | | | | | | | | | | | | | Found by someone reading the code, rather than because we saw a crash. This is only a small leak, and you'd have to be dumping threads (because of an ANR) or creating a new thread to provoke it. Change-Id: I9c660d86056765bcbebbdfa634032885c3f91b82
* | Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-081-21/+21
| | | | | | | | | | | | | | | | | | 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-21/+21
| | | | | | | | | | | | | | 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-6/+6
| | | | | | | | | | | | | | 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-16/+16
| | | | | | | | | | | | | | See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: Ic663376d1ad6a6cb14bf81405ad9afd247cf2f60
* | Disable dumping native stacks of non-Dalvik threads.Jeff Brown2011-11-031-1/+3
| | | | | | | | | | | | | | | | | | Bug: 5544153 We are seeing cases where dumping certain non-Dalvik threads causes system instability. Temporarily disable this feature. Change-Id: I14d7907a90f152bcb15d066f8bd3fdedc578e722
* | Dump stacks for all native threads, not just those in JNI.Jeff Brown2011-10-271-45/+144
| | | | | | | | Change-Id: I276f5f448f22f8a926cdfc8c93935da687db5d9b
* | Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGESteve Block2011-10-261-10/+10
| | | | | | | | | | | | | | See https://android-git.corp.google.com/g/#/c/143865 Bug: 5449033 Change-Id: I8bd96961e369a08e86ff78b82d90f20f42787eb1
* | Dump native stack of JNI methods when handling SIGQUIT.Jeff Brown2011-10-221-0/+5
|/ | | | Change-Id: I7da7259f1350e853153ba4dea96797fc86284068
* Clean up IndirectRefTable a bit.Elliott Hughes2011-06-211-3/+4
| | | | | | | The main purpose here was to have slightly less unclear warnings for JNI local reference abuse. Change-Id: I2c6378dd0a94d8afb96a8e409f7460205e3cd315
* Break a dependency on frameworks/base when building a host VM.Elliott Hughes2011-06-151-82/+3
| | | | | | | These aren't necessarily good abstractions, but they're no worse than what we had, and having them factored out is a step in the right direction. Change-Id: I5b839608317d2ca1ca54d8a38624fb686f2c37de
* Improve "waiting on"/"waiting to lock" SIGQUIT dump info.Elliott Hughes2011-06-071-25/+10
| | | | | | | | | | | | | 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
* 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-98/+98
| | | | | | Friends don't let friends end LOG() strings with newlines. Change-Id: I5a18c766c90c4ab5f03caa6acd601d34d91beb00
* Remove dead code.Carl Shapiro2011-05-111-1/+0
| | | | Change-Id: I3093925668eef9a839fc9fc490fc8260c001b777
* InterpBreak cleanup (part 1)buzbee2011-04-221-35/+28
| | | | | | | | | Moved the suspend count variables from the interpBreak structure. These are already protected by a mutex, and we need the space in interpBreak for additional subMode flags. This CL just does the move and expands the width of subMode to 16-bits. Change-Id: I4a6070b1ba4fb08a0f6e0aba6f150b30f9159eed
* Consolidate curFrame fields in thread storagebuzbee2011-04-221-4/+4
| | | | | | | We ended up with two locations in the Thread structure for saved Dalvik frame pointer. This change consolidates them. Change-Id: I78f288e4e57e232f29663be930101e775bfe370f
* Remove DVM_LOCK_INIT and DVM_LOCK_INITIAL_THIN_VALUE.Carl Shapiro2011-04-201-1/+0
| | | | | | | | | | | | The original implementation for thin locks used a magic non-zero value to encode the initial thin lock state. This magic value was kept around in DVM_LOCK_INITIAL_THIN_VALUE and stored into the lock word of newly allocated objects. A later revision to the thin locking code made the initial thin lock value be 0. That change eliminated the requirement that lock words be explicitly initialized as the allocator always returns zero-filled memory. Change-Id: I34e0b43b4c4db0f45cf7cf524e15d4a6096c1365
* Remove unneeded void argument list declarations.Carl Shapiro2011-04-201-17/+17
| | | | Change-Id: Ica749f6defa890363ec531b29e25bc415dc2cbb9
* Move the remaining non-compiler VM code into C++.Carl Shapiro2011-04-151-0/+3554
Change-Id: Id8693208d2741c55a7b0474d1264f2112019d11f