Commit a38b72b5 authored by rmcilroy's avatar rmcilroy Committed by Commit bot

Add DeadlineOverrun step to the RendererSchedulerIdlePeriod trace event.

Adds a deadline overrun step to the RendererSchedulerIdlePeriod trace event
to make it obvious when an idle period lasts longer than its deadline.

Also adds a TRACE_EVENT_ASYNC_STEP_INTO_WITH_TIMESTAMP0 which is required
to add the step at the appropriate time.

BUG=455713

Review URL: https://codereview.chromium.org/908473002

Cr-Commit-Position: refs/heads/master@{#315042}
parent 5d4328ee
...@@ -596,6 +596,15 @@ ...@@ -596,6 +596,15 @@
category_group, name, id, TRACE_EVENT_FLAG_NONE, "step", step, \ category_group, name, id, TRACE_EVENT_FLAG_NONE, "step", step, \
arg1_name, arg1_val) arg1_name, arg1_val)
// Similar to TRACE_EVENT_ASYNC_STEP_INTOx but with a custom |at| timestamp
// provided.
#define TRACE_EVENT_ASYNC_STEP_INTO_WITH_TIMESTAMP0(category_group, name, \
id, step, timestamp) \
INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
TRACE_EVENT_PHASE_ASYNC_STEP_INTO, category_group, name, id, \
static_cast<int>(base::PlatformThread::CurrentId()), \
timestamp, TRACE_EVENT_FLAG_NONE, "step", step)
// Records a single ASYNC_STEP_PAST event for |step| immediately. If the // Records a single ASYNC_STEP_PAST event for |step| immediately. If the
// category is not enabled, then this does nothing. The |name| and |id| must // category is not enabled, then this does nothing. The |name| and |id| must
// match the ASYNC_BEGIN event above. The |step| param identifies this step // match the ASYNC_BEGIN event above. The |step| param identifies this step
......
...@@ -261,6 +261,16 @@ void RendererSchedulerImpl::StartIdlePeriod() { ...@@ -261,6 +261,16 @@ void RendererSchedulerImpl::StartIdlePeriod() {
} }
void RendererSchedulerImpl::EndIdlePeriod() { void RendererSchedulerImpl::EndIdlePeriod() {
bool is_tracing;
TRACE_EVENT_CATEGORY_GROUP_ENABLED("renderer.scheduler", &is_tracing);
if (is_tracing && base::TimeTicks::Now() > estimated_next_frame_begin_) {
TRACE_EVENT_ASYNC_STEP_INTO_WITH_TIMESTAMP0(
"renderer.scheduler",
"RendererSchedulerIdlePeriod",
this,
"DeadlineOverrun",
estimated_next_frame_begin_.ToInternalValue());
}
TRACE_EVENT_ASYNC_END0("renderer.scheduler", TRACE_EVENT_ASYNC_END0("renderer.scheduler",
"RendererSchedulerIdlePeriod", this); "RendererSchedulerIdlePeriod", this);
DCHECK(main_thread_checker_.CalledOnValidThread()); DCHECK(main_thread_checker_.CalledOnValidThread());
......
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