From 610e1ef3195fe3b27e246fa39c8ac8d1a48460df Mon Sep 17 00:00:00 2001 From: "thestig@chromium.org" Date: Tue, 23 Jun 2009 18:32:37 +0000 Subject: Report the process type in Linux crash reports. BUG=none TEST=none Review URL: http://codereview.chromium.org/147031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19036 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/app/breakpad_linux.cc | 29 +++++++++++++++++++++- chrome/app/breakpad_linux.h | 2 ++ .../render_crash_handler_host_linux.cc | 1 + 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/chrome/app/breakpad_linux.cc b/chrome/app/breakpad_linux.cc index 588118a..598ad28 100644 --- a/chrome/app/breakpad_linux.cc +++ b/chrome/app/breakpad_linux.cc @@ -39,6 +39,8 @@ static void write_uint64_hex(char* output, uint64_t v) { } pid_t UploadCrashDump(const char* filename, + const char* process_type, + unsigned process_type_length, const char* crash_url, unsigned crash_url_length, const char* guid, @@ -159,6 +161,7 @@ pid_t UploadCrashDump(const char* filename, static const char content_type_msg[] = "Content-Type: application/octet-stream"; static const char url_chunk_msg[] = "url-chunk-"; + static const char process_type_msg[] = "ptype"; struct kernel_iovec iov[29]; iov[0].iov_base = mime_boundary; @@ -231,6 +234,30 @@ pid_t UploadCrashDump(const char* filename, sys_writev(fd, iov, 29); + if (process_type_length) { + iov[0].iov_base = const_cast(form_data_msg); + iov[0].iov_len = sizeof(form_data_msg) - 1; + iov[1].iov_base = const_cast(process_type_msg); + iov[1].iov_len = sizeof(process_type_msg) - 1; + iov[2].iov_base = const_cast(quote_msg); + iov[2].iov_len = sizeof(quote_msg); + iov[3].iov_base = const_cast(rn); + iov[3].iov_len = sizeof(rn); + iov[4].iov_base = const_cast(rn); + iov[4].iov_len = sizeof(rn); + + iov[5].iov_base = const_cast(process_type); + iov[5].iov_len = process_type_length; + iov[6].iov_base = const_cast(rn); + iov[6].iov_len = sizeof(rn); + iov[7].iov_base = mime_boundary; + iov[7].iov_len = sizeof(mime_boundary) - 1; + iov[8].iov_base = const_cast(rn); + iov[8].iov_len = sizeof(rn); + + sys_writev(fd, iov, 9); + } + if (crash_url_length) { unsigned i = 0, done = 0; static const unsigned kMaxCrashChunkSize = 64; @@ -427,7 +454,7 @@ static bool CrashDone(const char* dump_path, memcpy(path + dump_path_len + 1 + minidump_id_len, ".dmp", 4); path[dump_path_len + 1 + minidump_id_len + 4] = 0; - UploadCrashDump(path, NULL, 0, google_update::linux_guid.data(), + UploadCrashDump(path, "browser", 7, NULL, 0, google_update::linux_guid.data(), google_update::linux_guid.length()); return true; diff --git a/chrome/app/breakpad_linux.h b/chrome/app/breakpad_linux.h index e55d12e..3e82383a 100644 --- a/chrome/app/breakpad_linux.h +++ b/chrome/app/breakpad_linux.h @@ -7,6 +7,8 @@ extern void InitCrashReporter(); extern int UploadCrashDump(const char* filename, + const char* process_type, + unsigned process_type_length, const char* crash_url, unsigned crash_url_length, const char* guid, diff --git a/chrome/browser/renderer_host/render_crash_handler_host_linux.cc b/chrome/browser/renderer_host/render_crash_handler_host_linux.cc index 87abf25..207913f 100644 --- a/chrome/browser/renderer_host/render_crash_handler_host_linux.cc +++ b/chrome/browser/renderer_host/render_crash_handler_host_linux.cc @@ -183,6 +183,7 @@ void RenderCrashHandlerHostLinux::OnFileCanReadWithoutBlocking(int fd) { HANDLE_EINTR(close(signal_fd)); UploadCrashDump(minidump_filename.c_str(), + "renderer", 8, crash_url, crash_url_len, guid, kGuidSize); } -- cgit v1.1