Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1581)

Unified Diff: cc/scheduler/scheduler.cc

Issue 561043002: cc: Add trace events to track main thread latency mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@snclogging
Patch Set: add disabled by default counter Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/scheduler/scheduler_state_machine.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/scheduler.cc
diff --git a/cc/scheduler/scheduler.cc b/cc/scheduler/scheduler.cc
index e98f96689e16f247bf23482997264bb49bb8db9c..23e4855e4dced63f7eeb1c36e40e3b2f832d5b51 100644
--- a/cc/scheduler/scheduler.cc
+++ b/cc/scheduler/scheduler.cc
@@ -516,7 +516,17 @@ void Scheduler::PostBeginRetroFrameIfNeeded() {
// for a BeginMainFrame+activation to complete before it times out and draws
// any asynchronous animation and scroll/pinch updates.
void Scheduler::BeginImplFrame(const BeginFrameArgs& args) {
- TRACE_EVENT1("cc", "Scheduler::BeginImplFrame", "args", args.AsValue());
+ bool main_thread_is_in_high_latency_mode =
+ state_machine_.MainThreadIsInHighLatencyMode();
+ TRACE_EVENT2("cc",
+ "Scheduler::BeginImplFrame",
+ "args",
+ args.AsValue(),
+ "main_thread_is_high_latency",
+ main_thread_is_in_high_latency_mode);
+ TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler"),
+ "MainThreadLatency",
+ main_thread_is_in_high_latency_mode);
DCHECK_EQ(state_machine_.begin_impl_frame_state(),
SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE);
DCHECK(state_machine_.HasInitializedOutputSurface());
@@ -528,7 +538,7 @@ void Scheduler::BeginImplFrame(const BeginFrameArgs& args) {
begin_impl_frame_args_.deadline -= draw_duration_estimate;
if (!state_machine_.impl_latency_takes_priority() &&
- state_machine_.MainThreadIsInHighLatencyMode() &&
+ main_thread_is_in_high_latency_mode &&
CanCommitAndActivateBeforeDeadline()) {
state_machine_.SetSkipNextBeginMainFrameToReduceLatency();
}
« no previous file with comments | « no previous file | cc/scheduler/scheduler_state_machine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698