diff options
author | vangelis@chromium.org <vangelis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-03 18:21:20 +0000 |
---|---|---|
committer | vangelis@chromium.org <vangelis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-03 18:21:20 +0000 |
commit | 9289af828c3cb0323a4655aac6264d06e9b0a409 (patch) | |
tree | 5587be77175d42c70a39a79c41099400dda45c70 /chrome | |
parent | cac984cfed7c91fe452ceb15afa519777267a9b6 (diff) | |
download | chromium_src-9289af828c3cb0323a4655aac6264d06e9b0a409.zip chromium_src-9289af828c3cb0323a4655aac6264d06e9b0a409.tar.gz chromium_src-9289af828c3cb0323a4655aac6264d06e9b0a409.tar.bz2 |
Adding crash reporting on Linux for the GPU process.
BUG=49577
TEST=Tested as follows:
1. Set GYP_DEFINES="linux_breakpad=1"
2. From src/ issue:
./build/gyp_chromium -f make
3. Build chromium
4. Run: chrome --enable-crash-reporter
5. Visit a page that causes the gpu process to be launched (e.g. "about:gpu")
6. Go to "about:gpucrash" to force a gpu process crash
7. Verify that a .dmp file is create in ~/.config/chromium/Crash\ Reports/
Review URL: http://codereview.chromium.org/6368072
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73639 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/breakpad_linux.cc | 5 | ||||
-rw-r--r-- | chrome/browser/child_process_launcher.cc | 10 | ||||
-rw-r--r-- | chrome/browser/crash_handler_host_linux.cc | 16 | ||||
-rw-r--r-- | chrome/browser/crash_handler_host_linux.h | 17 | ||||
-rw-r--r-- | chrome/browser/crash_handler_host_linux_stub.cc | 11 | ||||
-rw-r--r-- | chrome/browser/gpu_process_host.cc | 2 |
6 files changed, 57 insertions, 4 deletions
diff --git a/chrome/app/breakpad_linux.cc b/chrome/app/breakpad_linux.cc index 15d6e65..e471e55 100644 --- a/chrome/app/breakpad_linux.cc +++ b/chrome/app/breakpad_linux.cc @@ -646,7 +646,7 @@ void EnableCrashDumping(const bool unattended) { } } -// Currently Non-Browser = Renderer, Plugins and Native Client +// Currently Non-Browser = Renderer, Plugins, Native Client and Gpu static bool NonBrowserCrashHandler(const void* crash_context, size_t crash_context_size, void* context) { @@ -748,7 +748,8 @@ void InitCrashReporter() { } else if (process_type == switches::kRendererProcess || process_type == switches::kPluginProcess || process_type == switches::kZygoteProcess || - process_type == switches::kNaClLoaderProcess) { + process_type == switches::kNaClLoaderProcess || + process_type == switches::kGpuProcess) { // We might be chrooted in a zygote or renderer process so we cannot call // GetCollectStatsConsent because that needs access the the user's home // dir. Instead, we set a command line flag for these processes. diff --git a/chrome/browser/child_process_launcher.cc b/chrome/browser/child_process_launcher.cc index 598bbef..0ed3f89 100644 --- a/chrome/browser/child_process_launcher.cc +++ b/chrome/browser/child_process_launcher.cc @@ -140,15 +140,21 @@ class ChildProcessLauncher::Context bool is_plugin = cmd_line->GetSwitchValueASCII(switches::kProcessType) == switches::kPluginProcess; + bool is_gpu = + cmd_line->GetSwitchValueASCII(switches::kProcessType) == + switches::kGpuProcess; - if (is_renderer || is_plugin) { + if (is_renderer || is_plugin || is_gpu) { int crash_signal_fd; if (is_renderer) { crash_signal_fd = RendererCrashHandlerHostLinux::GetInstance()-> GetDeathSignalSocket(); - } else { + } else if (is_plugin) { crash_signal_fd = PluginCrashHandlerHostLinux::GetInstance()-> GetDeathSignalSocket(); + } else { + crash_signal_fd = GpuCrashHandlerHostLinux::GetInstance()-> + GetDeathSignalSocket(); } if (crash_signal_fd >= 0) { fds_to_map.push_back(std::make_pair( diff --git a/chrome/browser/crash_handler_host_linux.cc b/chrome/browser/crash_handler_host_linux.cc index a22ff95..aa14cf5 100644 --- a/chrome/browser/crash_handler_host_linux.cc +++ b/chrome/browser/crash_handler_host_linux.cc @@ -354,6 +354,22 @@ bool CrashHandlerHostLinux::IsShuttingDown() const { return shutting_down_; } +GpuCrashHandlerHostLinux::GpuCrashHandlerHostLinux() { + InitCrashUploaderThread(); +} + +GpuCrashHandlerHostLinux::~GpuCrashHandlerHostLinux() { +} + +void GpuCrashHandlerHostLinux::SetProcessType() { + process_type_ = "gpu-process"; +} + +// static +GpuCrashHandlerHostLinux* GpuCrashHandlerHostLinux::GetInstance() { + return Singleton<GpuCrashHandlerHostLinux>::get(); +} + PluginCrashHandlerHostLinux::PluginCrashHandlerHostLinux() { InitCrashUploaderThread(); } diff --git a/chrome/browser/crash_handler_host_linux.h b/chrome/browser/crash_handler_host_linux.h index 9ff5333..8eb5947 100644 --- a/chrome/browser/crash_handler_host_linux.h +++ b/chrome/browser/crash_handler_host_linux.h @@ -79,6 +79,23 @@ class CrashHandlerHostLinux : public MessageLoopForIO::Watcher, DISALLOW_COPY_AND_ASSIGN(CrashHandlerHostLinux); }; +class GpuCrashHandlerHostLinux : public CrashHandlerHostLinux { + public: + // Returns the singleton instance. + static GpuCrashHandlerHostLinux* GetInstance(); + + private: + friend struct DefaultSingletonTraits<GpuCrashHandlerHostLinux>; + GpuCrashHandlerHostLinux(); + virtual ~GpuCrashHandlerHostLinux(); + +#if defined(USE_LINUX_BREAKPAD) + virtual void SetProcessType(); +#endif + + DISALLOW_COPY_AND_ASSIGN(GpuCrashHandlerHostLinux); +}; + class PluginCrashHandlerHostLinux : public CrashHandlerHostLinux { public: // Returns the singleton instance. diff --git a/chrome/browser/crash_handler_host_linux_stub.cc b/chrome/browser/crash_handler_host_linux_stub.cc index 157d772..3ec9ebb 100644 --- a/chrome/browser/crash_handler_host_linux_stub.cc +++ b/chrome/browser/crash_handler_host_linux_stub.cc @@ -26,6 +26,17 @@ void CrashHandlerHostLinux::OnFileCanWriteWithoutBlocking(int fd) { void CrashHandlerHostLinux::WillDestroyCurrentMessageLoop() { } +GpuCrashHandlerHostLinux::GpuCrashHandlerHostLinux() { +} + +GpuCrashHandlerHostLinux::~GpuCrashHandlerHostLinux() { +} + +// static +GpuCrashHandlerHostLinux* GpuCrashHandlerHostLinux::GetInstance() { + return Singleton<GpuCrashHandlerHostLinux>::get(); +} + PluginCrashHandlerHostLinux::PluginCrashHandlerHostLinux() { } diff --git a/chrome/browser/gpu_process_host.cc b/chrome/browser/gpu_process_host.cc index 155caf6..c362679 100644 --- a/chrome/browser/gpu_process_host.cc +++ b/chrome/browser/gpu_process_host.cc @@ -495,6 +495,8 @@ bool GpuProcessHost::LaunchGpuProcess() { cmd_line->AppendSwitchASCII(switches::kProcessType, switches::kGpuProcess); cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id()); + SetCrashReporterCommandLine(cmd_line); + // Propagate relevant command line switches. static const char* const kSwitchNames[] = { switches::kUseGL, |