diff options
author | Jeff Hao <jeffhao@google.com> | 2014-10-14 13:12:01 -0700 |
---|---|---|
committer | Jeff Hao <jeffhao@google.com> | 2014-10-14 18:12:09 -0700 |
commit | e094b87c6f6ea9ebf83aa56a3114ac59556aaf9f (patch) | |
tree | d6db16b54affbe5304a8155bee3536b982acafd7 /runtime/trace.cc | |
parent | cfd8adec84701752a56ddccf556b8c40142a9e0f (diff) | |
download | art-e094b87c6f6ea9ebf83aa56a3114ac59556aaf9f.tar.gz art-e094b87c6f6ea9ebf83aa56a3114ac59556aaf9f.tar.bz2 art-e094b87c6f6ea9ebf83aa56a3114ac59556aaf9f.zip |
Store exiting thread ids and names while tracing to output later.
Bug: 17909204
(cherry picked from commit fdcbc5c4c7c67bba06e038ac96a2e8bc49b91f84)
Change-Id: Iea087560ba8b983412a6dde2ec166c9e7214f3a1
Diffstat (limited to 'runtime/trace.cc')
-rw-r--r-- | runtime/trace.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/runtime/trace.cc b/runtime/trace.cc index 027f62d880..91a37fddaf 100644 --- a/runtime/trace.cc +++ b/runtime/trace.cc @@ -706,9 +706,21 @@ static void DumpThread(Thread* t, void* arg) { void Trace::DumpThreadList(std::ostream& os) { Thread* self = Thread::Current(); + for (auto it : exited_threads_) { + os << it.first << "\t" << it.second << "\n"; + } Locks::thread_list_lock_->AssertNotHeld(self); MutexLock mu(self, *Locks::thread_list_lock_); Runtime::Current()->GetThreadList()->ForEach(DumpThread, &os); } +void Trace::StoreExitingThreadInfo(Thread* thread) { + MutexLock mu(thread, *Locks::trace_lock_); + if (the_trace_ != nullptr) { + std::string name; + thread->GetThreadName(name); + the_trace_->exited_threads_.Put(thread->GetTid(), name); + } +} + } // namespace art |