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

Side by Side Diff: cc/trees/proxy_impl.cc

Issue 2819723002: cc: Add more info to the BeginMainFrame dump. (Closed)
Patch Set: more tracing Created 3 years, 8 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 unified diff | Download patch
« cc/scheduler/begin_frame_source.cc ('K') | « cc/tiles/tile_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/proxy_impl.h" 5 #include "cc/trees/proxy_impl.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 *main_frame_will_happen = false; 225 *main_frame_will_happen = false;
226 } 226 }
227 completion->Signal(); 227 completion->Signal();
228 } 228 }
229 229
230 // TODO(sunnyps): Remove this code once crbug.com/668892 is fixed. 230 // TODO(sunnyps): Remove this code once crbug.com/668892 is fixed.
231 NOINLINE void ProxyImpl::DumpForBeginMainFrameHang() { 231 NOINLINE void ProxyImpl::DumpForBeginMainFrameHang() {
232 DCHECK(IsImplThread()); 232 DCHECK(IsImplThread());
233 DCHECK(scheduler_); 233 DCHECK(scheduler_);
234 234
235 char stack_string[20000] = ""; 235 auto state = base::MakeUnique<base::trace_event::TracedValue>();
236
237 state->SetBoolean("commit_completion_waits_for_activation",
238 commit_completion_waits_for_activation_);
239 state->SetBoolean("commit_completion_event", !!commit_completion_event_);
240 state->SetBoolean("activation_completion_event",
241 !!activation_completion_event_);
242
243 state->BeginDictionary("scheduler_state");
244 scheduler_->AsValueInto(state.get());
245 state->EndDictionary();
246
247 state->BeginDictionary("tile_manager_state");
248 layer_tree_host_impl_->tile_manager()->ActivationStateAsValueInto(
249 state.get());
250 state->EndDictionary();
251
252 char stack_string[50000] = "";
236 base::debug::Alias(&stack_string); 253 base::debug::Alias(&stack_string);
237 254 strncpy(stack_string, state->ToString().c_str(), arraysize(stack_string) - 1);
238 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> scheduler_state =
239 scheduler_->AsValue();
240 strncat(stack_string, scheduler_state->ToString().c_str(),
241 arraysize(stack_string) - strlen(stack_string) - 1);
242
243 std::unique_ptr<base::trace_event::ConvertableToTraceFormat>
244 tile_manager_state =
245 layer_tree_host_impl_->tile_manager()->ActivationStateAsValue();
246 strncat(stack_string, tile_manager_state->ToString().c_str(),
247 arraysize(stack_string) - strlen(stack_string) - 1);
248 255
249 base::debug::DumpWithoutCrashing(); 256 base::debug::DumpWithoutCrashing();
250 } 257 }
251 258
252 void ProxyImpl::NotifyReadyToCommitOnImpl( 259 void ProxyImpl::NotifyReadyToCommitOnImpl(
253 CompletionEvent* completion, 260 CompletionEvent* completion,
254 LayerTreeHost* layer_tree_host, 261 LayerTreeHost* layer_tree_host,
255 base::TimeTicks main_thread_start_time, 262 base::TimeTicks main_thread_start_time,
256 bool hold_commit_for_activation) { 263 bool hold_commit_for_activation) {
257 TRACE_EVENT0("cc", "ProxyImpl::NotifyReadyToCommitOnImpl"); 264 TRACE_EVENT0("cc", "ProxyImpl::NotifyReadyToCommitOnImpl");
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { 682 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() {
676 DCHECK(IsMainThreadBlocked() && commit_completion_event_); 683 DCHECK(IsMainThreadBlocked() && commit_completion_event_);
677 return main_thread_blocked_commit_vars_unsafe_; 684 return main_thread_blocked_commit_vars_unsafe_;
678 } 685 }
679 686
680 base::SingleThreadTaskRunner* ProxyImpl::MainThreadTaskRunner() { 687 base::SingleThreadTaskRunner* ProxyImpl::MainThreadTaskRunner() {
681 return task_runner_provider_->MainThreadTaskRunner(); 688 return task_runner_provider_->MainThreadTaskRunner();
682 } 689 }
683 690
684 } // namespace cc 691 } // namespace cc
OLDNEW
« cc/scheduler/begin_frame_source.cc ('K') | « cc/tiles/tile_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698