summaryrefslogtreecommitdiffstats
path: root/runtime/gc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2015-03-13 17:21:25 -0700
committerMathieu Chartier <mathieuc@google.com>2015-03-13 17:32:48 -0700
commitbf9fc581e8870faddbd320a935f9a627da724c48 (patch)
tree0a4a6c21fbd4c771b06fac186d32efa6722605b2 /runtime/gc
parent3d96846b6adedf57be64eb3873de0ca58ec4b827 (diff)
downloadart-bf9fc581e8870faddbd320a935f9a627da724c48.zip
art-bf9fc581e8870faddbd320a935f9a627da724c48.tar.gz
art-bf9fc581e8870faddbd320a935f9a627da724c48.tar.bz2
Add more info to who called SuspendAll
Helps diagnose related jank. Change-Id: I38191cdda723c6f0355d0197c494a3dff2b6653c
Diffstat (limited to 'runtime/gc')
-rw-r--r--runtime/gc/collector/garbage_collector.cc2
-rw-r--r--runtime/gc/heap.cc10
-rw-r--r--runtime/gc/space/rosalloc_space.cc2
3 files changed, 7 insertions, 7 deletions
diff --git a/runtime/gc/collector/garbage_collector.cc b/runtime/gc/collector/garbage_collector.cc
index eafcc45..47d6ada 100644
--- a/runtime/gc/collector/garbage_collector.cc
+++ b/runtime/gc/collector/garbage_collector.cc
@@ -157,7 +157,7 @@ void GarbageCollector::ResetMeasurements() {
GarbageCollector::ScopedPause::ScopedPause(GarbageCollector* collector)
: start_time_(NanoTime()), collector_(collector) {
- Runtime::Current()->GetThreadList()->SuspendAll();
+ Runtime::Current()->GetThreadList()->SuspendAll(__FUNCTION__);
}
GarbageCollector::ScopedPause::~ScopedPause() {
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index 1298272..0cad11f 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -576,7 +576,7 @@ void Heap::DisableMovingGc() {
ThreadList* tl = Runtime::Current()->GetThreadList();
Thread* self = Thread::Current();
ScopedThreadStateChange tsc(self, kSuspended);
- tl->SuspendAll();
+ tl->SuspendAll(__FUNCTION__);
// Something may have caused the transition to fail.
if (!IsMovingGc(collector_type_) && non_moving_space_ != main_space_) {
CHECK(main_space_ != nullptr);
@@ -758,7 +758,7 @@ void Heap::VisitObjects(ObjectCallback callback, void* arg) {
IncrementDisableMovingGC(self);
self->TransitionFromRunnableToSuspended(kWaitingForVisitObjects);
ThreadList* tl = Runtime::Current()->GetThreadList();
- tl->SuspendAll();
+ tl->SuspendAll(__FUNCTION__);
VisitObjectsInternalRegionSpace(callback, arg);
VisitObjectsInternal(callback, arg);
tl->ResumeAll();
@@ -1058,7 +1058,7 @@ void Heap::Trim(Thread* self) {
// Deflate the monitors, this can cause a pause but shouldn't matter since we don't care
// about pauses.
Runtime* runtime = Runtime::Current();
- runtime->GetThreadList()->SuspendAll();
+ runtime->GetThreadList()->SuspendAll(__FUNCTION__);
uint64_t start_time = NanoTime();
size_t count = runtime->GetMonitorList()->DeflateMonitors();
VLOG(heap) << "Deflating " << count << " monitors took "
@@ -1697,7 +1697,7 @@ HomogeneousSpaceCompactResult Heap::PerformHomogeneousSpaceCompact() {
return HomogeneousSpaceCompactResult::kErrorVMShuttingDown;
}
// Suspend all threads.
- tl->SuspendAll();
+ tl->SuspendAll(__FUNCTION__);
uint64_t start_time = NanoTime();
// Launch compaction.
space::MallocSpace* to_space = main_space_backup_.release();
@@ -1779,7 +1779,7 @@ void Heap::TransitionCollector(CollectorType collector_type) {
return;
}
collector::GarbageCollector* collector = nullptr;
- tl->SuspendAll();
+ tl->SuspendAll(__FUNCTION__);
switch (collector_type) {
case kCollectorTypeSS: {
if (!IsMovingGc(collector_type_)) {
diff --git a/runtime/gc/space/rosalloc_space.cc b/runtime/gc/space/rosalloc_space.cc
index f140021..eb1d5f4 100644
--- a/runtime/gc/space/rosalloc_space.cc
+++ b/runtime/gc/space/rosalloc_space.cc
@@ -303,7 +303,7 @@ void RosAllocSpace::InspectAllRosAllocWithSuspendAll(
// TODO: NO_THREAD_SAFETY_ANALYSIS.
Thread* self = Thread::Current();
ThreadList* tl = Runtime::Current()->GetThreadList();
- tl->SuspendAll();
+ tl->SuspendAll(__FUNCTION__);
{
MutexLock mu(self, *Locks::runtime_shutdown_lock_);
MutexLock mu2(self, *Locks::thread_list_lock_);