Commit 9311bc11 authored by mlippautz's avatar mlippautz Committed by Commit bot

[heap] Print timestamp in memory reducer

R=ulan@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2473073002
Cr-Commit-Position: refs/heads/master@{#40756}
parent 7fede7bb
...@@ -35,9 +35,10 @@ void MemoryReducer::TimerTask::RunInternal() { ...@@ -35,9 +35,10 @@ void MemoryReducer::TimerTask::RunInternal() {
bool is_idle = js_call_rate < kJsCallsPerMsThreshold && low_allocation_rate; bool is_idle = js_call_rate < kJsCallsPerMsThreshold && low_allocation_rate;
bool optimize_for_memory = heap->ShouldOptimizeForMemoryUsage(); bool optimize_for_memory = heap->ShouldOptimizeForMemoryUsage();
if (FLAG_trace_gc_verbose) { if (FLAG_trace_gc_verbose) {
PrintIsolate(heap->isolate(), "Memory reducer: call rate %.3lf, %s, %s\n", heap->isolate()->PrintWithTimestamp(
js_call_rate, low_allocation_rate ? "low alloc" : "high alloc", "Memory reducer: call rate %.3lf, %s, %s\n", js_call_rate,
optimize_for_memory ? "background" : "foreground"); low_allocation_rate ? "low alloc" : "high alloc",
optimize_for_memory ? "background" : "foreground");
} }
event.type = kTimer; event.type = kTimer;
event.time_ms = time_ms; event.time_ms = time_ms;
...@@ -70,8 +71,8 @@ void MemoryReducer::NotifyTimer(const Event& event) { ...@@ -70,8 +71,8 @@ void MemoryReducer::NotifyTimer(const Event& event) {
DCHECK(heap()->incremental_marking()->IsStopped()); DCHECK(heap()->incremental_marking()->IsStopped());
DCHECK(FLAG_incremental_marking); DCHECK(FLAG_incremental_marking);
if (FLAG_trace_gc_verbose) { if (FLAG_trace_gc_verbose) {
PrintIsolate(heap()->isolate(), "Memory reducer: started GC #%d\n", heap()->isolate()->PrintWithTimestamp("Memory reducer: started GC #%d\n",
state_.started_gcs); state_.started_gcs);
} }
heap()->StartIdleIncrementalMarking( heap()->StartIdleIncrementalMarking(
GarbageCollectionReason::kMemoryReducer); GarbageCollectionReason::kMemoryReducer);
...@@ -93,8 +94,9 @@ void MemoryReducer::NotifyTimer(const Event& event) { ...@@ -93,8 +94,9 @@ void MemoryReducer::NotifyTimer(const Event& event) {
// Re-schedule the timer. // Re-schedule the timer.
ScheduleTimer(event.time_ms, state_.next_gc_start_ms - event.time_ms); ScheduleTimer(event.time_ms, state_.next_gc_start_ms - event.time_ms);
if (FLAG_trace_gc_verbose) { if (FLAG_trace_gc_verbose) {
PrintIsolate(heap()->isolate(), "Memory reducer: waiting for %.f ms\n", heap()->isolate()->PrintWithTimestamp(
state_.next_gc_start_ms - event.time_ms); "Memory reducer: waiting for %.f ms\n",
state_.next_gc_start_ms - event.time_ms);
} }
} }
} }
...@@ -110,9 +112,9 @@ void MemoryReducer::NotifyMarkCompact(const Event& event) { ...@@ -110,9 +112,9 @@ void MemoryReducer::NotifyMarkCompact(const Event& event) {
} }
if (old_action == kRun) { if (old_action == kRun) {
if (FLAG_trace_gc_verbose) { if (FLAG_trace_gc_verbose) {
PrintIsolate(heap()->isolate(), "Memory reducer: finished GC #%d (%s)\n", heap()->isolate()->PrintWithTimestamp(
state_.started_gcs, "Memory reducer: finished GC #%d (%s)\n", state_.started_gcs,
state_.action == kWait ? "will do more" : "done"); state_.action == kWait ? "will do more" : "done");
} }
} }
} }
......
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