diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-08-19 01:01:35 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-08-19 01:01:35 +0000 |
commit | ab9c74ec6adf2058a46bb4be4382d535d75ea930 (patch) | |
tree | c96a95d49cee13daa45586cf79e84082aa03d2d1 | |
parent | b3eb3fedaaec4870688beec8460df7de1675ee59 (diff) | |
parent | 0c71a925766adbf909ba0087b605830922e79a21 (diff) |
Snap for 7655495 from 0c71a925766adbf909ba0087b605830922e79a21 to sc-qpr1-release
Change-Id: Ic857ee8ec1d92ffc4e3f7a734995441c00fe000e
-rw-r--r-- | runtime/class_linker.cc | 16 | ||||
-rw-r--r-- | test/art-run-test-target-template.xml | 3 |
2 files changed, 8 insertions, 11 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index b9751ab965..8b9e42a572 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -9814,22 +9814,16 @@ void ClassLinker::SetEntryPointsForObsoleteMethod(ArtMethod* method) const { } void ClassLinker::DumpForSigQuit(std::ostream& os) { - // Avoid a deadlock between a garbage collecting thread running a checkpoint, - // a thread holding the dex or classlinker lock and blocking on a condition variable for - // weak references access, and a thread blocking on the dex or classlinker lock and thus - // unable to run the checkpoint. - Thread* self = Thread::Current(); - ScopedObjectAccess soa(self); - gc::ScopedGCCriticalSection gcs(self, gc::kGcCauseClassLinker, gc::kCollectorTypeClassLinker); - ReaderMutexLock mu(self, *Locks::classlinker_classes_lock_); + ScopedObjectAccess soa(Thread::Current()); + ReaderMutexLock mu(soa.Self(), *Locks::classlinker_classes_lock_); os << "Zygote loaded classes=" << NumZygoteClasses() << " post zygote classes=" << NumNonZygoteClasses() << "\n"; - ReaderMutexLock mu2(self, *Locks::dex_lock_); + ReaderMutexLock mu2(soa.Self(), *Locks::dex_lock_); os << "Dumping registered class loaders\n"; size_t class_loader_index = 0; for (const ClassLoaderData& class_loader : class_loaders_) { ObjPtr<mirror::ClassLoader> loader = - ObjPtr<mirror::ClassLoader>::DownCast(self->DecodeJObject(class_loader.weak_root)); + ObjPtr<mirror::ClassLoader>::DownCast(soa.Self()->DecodeJObject(class_loader.weak_root)); if (loader != nullptr) { os << "#" << class_loader_index++ << " " << loader->GetClass()->PrettyDescriptor() << ": ["; bool saw_one_dex_file = false; @@ -9848,7 +9842,7 @@ void ClassLinker::DumpForSigQuit(std::ostream& os) { size_t parent_index = 0; for (const ClassLoaderData& class_loader2 : class_loaders_) { ObjPtr<mirror::ClassLoader> loader2 = ObjPtr<mirror::ClassLoader>::DownCast( - self->DecodeJObject(class_loader2.weak_root)); + soa.Self()->DecodeJObject(class_loader2.weak_root)); if (loader2 == loader->GetParent()) { os << ", parent #" << parent_index; found_parent = true; diff --git a/test/art-run-test-target-template.xml b/test/art-run-test-target-template.xml index 4084afa6c3..433654a9a0 100644 --- a/test/art-run-test-target-template.xml +++ b/test/art-run-test-target-template.xml @@ -38,4 +38,7 @@ <!-- ART Mainline Module (external (AOSP) version). --> <option name="mainline-module-package-name" value="com.android.art" /> </object> + + <!--- Only run tests if the device under test is SDK version 31 (Android 12) or above. --> + <object type="module_controller" class="com.android.tradefed.testtype.suite.module.Sdk31ModuleController" /> </configuration> |