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

Side by Side Diff: client/linux/microdump_writer/microdump_writer.cc

Issue 2087413002: Add process type to MicroDumpExtraInfo (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad/src.git@master
Patch Set: rebase Created 4 years, 5 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
« no previous file with comments | « client/linux/handler/microdump_extra_info.h ('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 (c) 2014, Google Inc. 1 // Copyright (c) 2014, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 if (!dumper_->Init() || !log_line_) 157 if (!dumper_->Init() || !log_line_)
158 return false; 158 return false;
159 return dumper_->ThreadsSuspend() && dumper_->LateInit(); 159 return dumper_->ThreadsSuspend() && dumper_->LateInit();
160 } 160 }
161 161
162 bool Dump() { 162 bool Dump() {
163 bool success; 163 bool success;
164 LogLine("-----BEGIN BREAKPAD MICRODUMP-----"); 164 LogLine("-----BEGIN BREAKPAD MICRODUMP-----");
165 DumpProductInformation(); 165 DumpProductInformation();
166 DumpOSInformation(); 166 DumpOSInformation();
167 DumpProcessType();
167 DumpGPUInformation(); 168 DumpGPUInformation();
168 #if !defined(__LP64__) 169 #if !defined(__LP64__)
169 DumpFreeSpace(); 170 DumpFreeSpace();
170 #endif 171 #endif
171 success = DumpCrashingThread(); 172 success = DumpCrashingThread();
172 if (success) 173 if (success)
173 success = DumpMappings(); 174 success = DumpMappings();
174 LogLine("-----END BREAKPAD MICRODUMP-----"); 175 LogLine("-----END BREAKPAD MICRODUMP-----");
175 dumper_->ThreadsResume(); 176 dumper_->ThreadsResume();
176 return success; 177 return success;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 void DumpProductInformation() { 227 void DumpProductInformation() {
227 LogAppend("V "); 228 LogAppend("V ");
228 if (microdump_extra_info_.product_info) { 229 if (microdump_extra_info_.product_info) {
229 LogAppend(microdump_extra_info_.product_info); 230 LogAppend(microdump_extra_info_.product_info);
230 } else { 231 } else {
231 LogAppend("UNKNOWN:0.0.0.0"); 232 LogAppend("UNKNOWN:0.0.0.0");
232 } 233 }
233 LogCommitLine(); 234 LogCommitLine();
234 } 235 }
235 236
237 void DumpProcessType() {
238 LogAppend("P ");
239 if (microdump_extra_info_.process_type) {
240 LogAppend(microdump_extra_info_.process_type);
241 } else {
242 LogAppend("UNKNOWN");
243 }
244 LogCommitLine();
245 }
246
236 void DumpOSInformation() { 247 void DumpOSInformation() {
237 const uint8_t n_cpus = static_cast<uint8_t>(sysconf(_SC_NPROCESSORS_CONF)); 248 const uint8_t n_cpus = static_cast<uint8_t>(sysconf(_SC_NPROCESSORS_CONF));
238 249
239 #if defined(__ANDROID__) 250 #if defined(__ANDROID__)
240 const char kOSId[] = "A"; 251 const char kOSId[] = "A";
241 #else 252 #else
242 const char kOSId[] = "L"; 253 const char kOSId[] = "L";
243 #endif 254 #endif
244 255
245 // Dump the runtime architecture. On multiarch devices it might not match the 256 // Dump the runtime architecture. On multiarch devices it might not match the
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 dumper.set_crash_signal(context->siginfo.si_signo); 600 dumper.set_crash_signal(context->siginfo.si_signo);
590 dumper.set_crash_thread(context->tid); 601 dumper.set_crash_thread(context->tid);
591 } 602 }
592 MicrodumpWriter writer(context, mappings, microdump_extra_info, &dumper); 603 MicrodumpWriter writer(context, mappings, microdump_extra_info, &dumper);
593 if (!writer.Init()) 604 if (!writer.Init())
594 return false; 605 return false;
595 return writer.Dump(); 606 return writer.Dump();
596 } 607 }
597 608
598 } // namespace google_breakpad 609 } // namespace google_breakpad
OLDNEW
« no previous file with comments | « client/linux/handler/microdump_extra_info.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698