Commit 26587641 authored by Hannes Payer's avatar Hannes Payer Committed by Commit Bot

[oilpan] Report total garbage collection time to UMA.

Bug: 
Change-Id: Ia4a87a4fa6e98902bca8b3328399dcd4de79af3a
Reviewed-on: https://chromium-review.googlesource.com/833938
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#525299}
parent d48ae0a6
......@@ -1247,8 +1247,6 @@ void ThreadState::IncrementalMarkingFinalize() {
void ThreadState::CollectGarbage(BlinkGC::StackState stack_state,
BlinkGC::GCType gc_type,
BlinkGC::GCReason reason) {
double start_time = WTF::CurrentTimeTicksInMilliseconds();
// Nested garbage collection invocations are not supported.
CHECK(!IsGCForbidden());
// Garbage collection during sweeping is not supported. This can happen when
......@@ -1256,6 +1254,9 @@ void ThreadState::CollectGarbage(BlinkGC::StackState stack_state,
if (SweepForbidden())
return;
double start_total_collect_garbage_time =
WTF::CurrentTimeTicksInMilliseconds();
CompleteSweep();
RUNTIME_CALL_TIMER_SCOPE_IF_ISOLATE_EXISTS(
......@@ -1285,9 +1286,15 @@ void ThreadState::CollectGarbage(BlinkGC::StackState stack_state,
PreSweep(gc_type);
double total_collect_garbage_time =
WTF::CurrentTimeTicksInMilliseconds() - start_total_collect_garbage_time;
DEFINE_THREAD_SAFE_STATIC_LOCAL(
CustomCountHistogram, time_for_total_collect_garbage_histogram,
("BlinkGC.TimeForTotalCollectGarbage", 1, 10 * 1000, 50));
time_for_total_collect_garbage_histogram.Count(total_collect_garbage_time);
VLOG(1) << "[state:" << this << "]"
<< " CollectGarbage: time: " << std::setprecision(2)
<< (WTF::CurrentTimeTicksInMilliseconds() - start_time) << "ms"
<< total_collect_garbage_time << "ms"
<< " stack: " << StackStateString(stack_state)
<< " type: " << GcTypeString(gc_type)
<< " reason: " << GcReasonString(reason);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment