summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/gc/collector/garbage_collector.cc8
-rw-r--r--runtime/gc/collector/mark_sweep.cc2
2 files changed, 8 insertions, 2 deletions
diff --git a/runtime/gc/collector/garbage_collector.cc b/runtime/gc/collector/garbage_collector.cc
index b7641a4162..edfea9489f 100644
--- a/runtime/gc/collector/garbage_collector.cc
+++ b/runtime/gc/collector/garbage_collector.cc
@@ -88,12 +88,16 @@ void GarbageCollector::Run() {
bool done = false;
while (!done) {
uint64_t pause_start = NanoTime();
- ATRACE_BEGIN("Application threads suspended");
+ ATRACE_BEGIN("Suspending mutator threads");
thread_list->SuspendAll();
+ ATRACE_END();
+ ATRACE_BEGIN("All mutator threads suspended");
done = HandleDirtyObjectsPhase();
- thread_list->ResumeAll();
ATRACE_END();
uint64_t pause_end = NanoTime();
+ ATRACE_BEGIN("Resuming mutator threads");
+ thread_list->ResumeAll();
+ ATRACE_END();
pause_times_.push_back(pause_end - pause_start);
}
{
diff --git a/runtime/gc/collector/mark_sweep.cc b/runtime/gc/collector/mark_sweep.cc
index 2f68f8e1c7..953fbf9848 100644
--- a/runtime/gc/collector/mark_sweep.cc
+++ b/runtime/gc/collector/mark_sweep.cc
@@ -1069,11 +1069,13 @@ class CheckpointMarkThreadRoots : public Closure {
explicit CheckpointMarkThreadRoots(MarkSweep* mark_sweep) : mark_sweep_(mark_sweep) {}
virtual void Run(Thread* thread) NO_THREAD_SAFETY_ANALYSIS {
+ ATRACE_BEGIN("Marking thread roots");
// Note: self is not necessarily equal to thread since thread may be suspended.
Thread* self = Thread::Current();
CHECK(thread == self || thread->IsSuspended() || thread->GetState() == kWaitingPerformingGc)
<< thread->GetState() << " thread " << thread << " self " << self;
thread->VisitRoots(MarkSweep::MarkRootParallelCallback, mark_sweep_);
+ ATRACE_END();
mark_sweep_->GetBarrier().Pass(self);
}