diff options
author | Sebastien Hertz <shertz@google.com> | 2013-12-17 10:42:03 +0100 |
---|---|---|
committer | Sebastien Hertz <shertz@google.com> | 2014-07-09 16:10:45 +0200 |
commit | bae182cbc6adc8796154162a87fc54ae804e0469 (patch) | |
tree | d5c1fdb048edab194e948e4e90bff66703c5f55e /runtime/thread_list.cc | |
parent | 0c1734665c38b3116e38a90ad06c3f152d9316c5 (diff) | |
download | art-bae182cbc6adc8796154162a87fc54ae804e0469.zip art-bae182cbc6adc8796154162a87fc54ae804e0469.tar.gz art-bae182cbc6adc8796154162a87fc54ae804e0469.tar.bz2 |
Fix method tracing from command-line
Transitions current thread to the new kWaitingForMethodTracingStart thread
state when starting method tracing.
Ensures there is a current thread when method tracing is stopped due to runtime
shutdown. If the current thread has been detached, we now re-attach it.
Note: we only do this if method tracing has been activated from command-line.
Fixes instrumentation when forcing interpreter mode (-Xint) with method tracing
enabled.
Removes unused parameter from UnsafeLogFatalForThreadSuspendAllTimeout.
Bug: https://code.google.com/p/android/issues/detail?id=72094
Bug: 11683397
Change-Id: I70f000fb46ddd95d6ad51ea0a8eee77697a045e9
Diffstat (limited to 'runtime/thread_list.cc')
-rw-r--r-- | runtime/thread_list.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/runtime/thread_list.cc b/runtime/thread_list.cc index d20a459..54732fa 100644 --- a/runtime/thread_list.cc +++ b/runtime/thread_list.cc @@ -153,8 +153,8 @@ void ThreadList::AssertThreadsAreSuspended(Thread* self, Thread* ignore1, Thread #if HAVE_TIMED_RWLOCK // Attempt to rectify locks so that we dump thread list with required locks before exiting. -static void UnsafeLogFatalForThreadSuspendAllTimeout(Thread* self) NO_THREAD_SAFETY_ANALYSIS __attribute__((noreturn)); -static void UnsafeLogFatalForThreadSuspendAllTimeout(Thread* self) { +static void UnsafeLogFatalForThreadSuspendAllTimeout() NO_THREAD_SAFETY_ANALYSIS __attribute__((noreturn)); +static void UnsafeLogFatalForThreadSuspendAllTimeout() { Runtime* runtime = Runtime::Current(); std::ostringstream ss; ss << "Thread suspend timeout\n"; @@ -332,7 +332,7 @@ void ThreadList::SuspendAll() { #if HAVE_TIMED_RWLOCK // Timeout if we wait more than 30 seconds. if (!Locks::mutator_lock_->ExclusiveLockWithTimeout(self, 30 * 1000, 0)) { - UnsafeLogFatalForThreadSuspendAllTimeout(self); + UnsafeLogFatalForThreadSuspendAllTimeout(); } #else Locks::mutator_lock_->ExclusiveLock(self); @@ -351,6 +351,7 @@ void ThreadList::SuspendAll() { void ThreadList::ResumeAll() { Thread* self = Thread::Current(); + DCHECK(self != nullptr); VLOG(threads) << *self << " ResumeAll starting"; @@ -587,7 +588,7 @@ void ThreadList::SuspendAllForDebugger() { #if HAVE_TIMED_RWLOCK // Timeout if we wait more than 30 seconds. if (!Locks::mutator_lock_->ExclusiveLockWithTimeout(self, 30 * 1000, 0)) { - UnsafeLogFatalForThreadSuspendAllTimeout(self); + UnsafeLogFatalForThreadSuspendAllTimeout(); } else { Locks::mutator_lock_->ExclusiveUnlock(self); } |