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

Side by Side Diff: content/browser/gpu/gpu_process_host.cc

Issue 108683003: Store gpu crashes in the systemprofileproto (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Alexei comments1 Created 7 years 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/gpu/gpu_process_host.h" 5 #include "content/browser/gpu/gpu_process_host.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/base_switches.h" 8 #include "base/base_switches.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 10 matching lines...) Expand all
21 #include "content/browser/gpu/gpu_process_host_ui_shim.h" 21 #include "content/browser/gpu/gpu_process_host_ui_shim.h"
22 #include "content/browser/gpu/shader_disk_cache.h" 22 #include "content/browser/gpu/shader_disk_cache.h"
23 #include "content/browser/renderer_host/render_widget_helper.h" 23 #include "content/browser/renderer_host/render_widget_helper.h"
24 #include "content/browser/renderer_host/render_widget_host_impl.h" 24 #include "content/browser/renderer_host/render_widget_host_impl.h"
25 #include "content/common/child_process_host_impl.h" 25 #include "content/common/child_process_host_impl.h"
26 #include "content/common/gpu/gpu_messages.h" 26 #include "content/common/gpu/gpu_messages.h"
27 #include "content/common/view_messages.h" 27 #include "content/common/view_messages.h"
28 #include "content/port/browser/render_widget_host_view_frame_subscriber.h" 28 #include "content/port/browser/render_widget_host_view_frame_subscriber.h"
29 #include "content/public/browser/browser_thread.h" 29 #include "content/public/browser/browser_thread.h"
30 #include "content/public/browser/content_browser_client.h" 30 #include "content/public/browser/content_browser_client.h"
31 #include "content/public/browser/notification_service.h"
32 #include "content/public/browser/notification_types.h"
31 #include "content/public/browser/render_process_host.h" 33 #include "content/public/browser/render_process_host.h"
32 #include "content/public/browser/render_widget_host_view.h" 34 #include "content/public/browser/render_widget_host_view.h"
33 #include "content/public/common/content_client.h" 35 #include "content/public/common/content_client.h"
34 #include "content/public/common/content_switches.h" 36 #include "content/public/common/content_switches.h"
35 #include "content/public/common/result_codes.h" 37 #include "content/public/common/result_codes.h"
36 #include "gpu/command_buffer/service/gpu_switches.h" 38 #include "gpu/command_buffer/service/gpu_switches.h"
37 #include "ipc/ipc_channel_handle.h" 39 #include "ipc/ipc_channel_handle.h"
38 #include "ipc/ipc_switches.h" 40 #include "ipc/ipc_switches.h"
39 #include "ui/events/latency_info.h" 41 #include "ui/events/latency_info.h"
40 #include "ui/gl/gl_switches.h" 42 #include "ui/gl/gl_switches.h"
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 uma_memory_stats_.bytes_allocated_current / 1024 / 1024, 1, 2000, 50); 515 uma_memory_stats_.bytes_allocated_current / 1024 / 1024, 1, 2000, 50);
514 UMA_HISTOGRAM_CUSTOM_COUNTS( 516 UMA_HISTOGRAM_CUSTOM_COUNTS(
515 "GPU.AtExitMBytesAllocatedMax", 517 "GPU.AtExitMBytesAllocatedMax",
516 uma_memory_stats_.bytes_allocated_max / 1024 / 1024, 1, 2000, 50); 518 uma_memory_stats_.bytes_allocated_max / 1024 / 1024, 1, 2000, 50);
517 UMA_HISTOGRAM_CUSTOM_COUNTS( 519 UMA_HISTOGRAM_CUSTOM_COUNTS(
518 "GPU.AtExitMBytesLimit", 520 "GPU.AtExitMBytesLimit",
519 uma_memory_stats_.bytes_limit / 1024 / 1024, 1, 2000, 50); 521 uma_memory_stats_.bytes_limit / 1024 / 1024, 1, 2000, 50);
520 } 522 }
521 523
522 std::string message; 524 std::string message;
525 base::TerminationStatus status = base::TERMINATION_STATUS_NORMAL_TERMINATION;
523 if (!in_process_) { 526 if (!in_process_) {
524 int exit_code; 527 int exit_code;
525 base::TerminationStatus status = process_->GetTerminationStatus( 528 status = process_->GetTerminationStatus(false /* known_dead */, &exit_code);
526 false /* known_dead */, &exit_code);
527 UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessTerminationStatus", 529 UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessTerminationStatus",
528 status, 530 status,
529 base::TERMINATION_STATUS_MAX_ENUM); 531 base::TERMINATION_STATUS_MAX_ENUM);
530 532
531 if (status == base::TERMINATION_STATUS_NORMAL_TERMINATION || 533 if (status == base::TERMINATION_STATUS_NORMAL_TERMINATION ||
532 status == base::TERMINATION_STATUS_ABNORMAL_TERMINATION) { 534 status == base::TERMINATION_STATUS_ABNORMAL_TERMINATION) {
533 UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessExitCode", 535 UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessExitCode",
534 exit_code, 536 exit_code,
535 RESULT_CODE_LAST_CODE); 537 RESULT_CODE_LAST_CODE);
536 } 538 }
(...skipping 15 matching lines...) Expand all
552 break; 554 break;
553 default: 555 default:
554 break; 556 break;
555 } 557 }
556 } 558 }
557 559
558 BrowserThread::PostTask(BrowserThread::UI, 560 BrowserThread::PostTask(BrowserThread::UI,
559 FROM_HERE, 561 FROM_HERE,
560 base::Bind(&GpuProcessHostUIShim::Destroy, 562 base::Bind(&GpuProcessHostUIShim::Destroy,
561 host_id_, 563 host_id_,
564 status,
562 message)); 565 message));
563 } 566 }
564 567
565 bool GpuProcessHost::Init() { 568 bool GpuProcessHost::Init() {
566 init_start_time_ = base::TimeTicks::Now(); 569 init_start_time_ = base::TimeTicks::Now();
567 570
568 TRACE_EVENT_INSTANT0("gpu", "LaunchGpuProcess", TRACE_EVENT_SCOPE_THREAD); 571 TRACE_EVENT_INSTANT0("gpu", "LaunchGpuProcess", TRACE_EVENT_SCOPE_THREAD);
569 572
570 std::string channel_id = process_->GetHost()->CreateChannel(); 573 std::string channel_id = process_->GetHost()->CreateChannel();
571 if (channel_id.empty()) 574 if (channel_id.empty())
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
1251 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); 1254 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader");
1252 ClientIdToShaderCacheMap::iterator iter = 1255 ClientIdToShaderCacheMap::iterator iter =
1253 client_id_to_shader_cache_.find(client_id); 1256 client_id_to_shader_cache_.find(client_id);
1254 // If the cache doesn't exist then this is an off the record profile. 1257 // If the cache doesn't exist then this is an off the record profile.
1255 if (iter == client_id_to_shader_cache_.end()) 1258 if (iter == client_id_to_shader_cache_.end())
1256 return; 1259 return;
1257 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); 1260 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader);
1258 } 1261 }
1259 1262
1260 } // namespace content 1263 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698