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

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

Issue 1286063003: [microdump] Move microdump writes to the crash ring-buffer log (Closed) Base URL: http://google-breakpad.googlecode.com/svn/trunk
Patch Set: Nits Created 5 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/client/linux/log/log.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 (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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 if (success) 98 if (success)
99 success = DumpMappings(); 99 success = DumpMappings();
100 LogLine("-----END BREAKPAD MICRODUMP-----"); 100 LogLine("-----END BREAKPAD MICRODUMP-----");
101 dumper_->ThreadsResume(); 101 dumper_->ThreadsResume();
102 return success; 102 return success;
103 } 103 }
104 104
105 private: 105 private:
106 // Writes one line to the system log. 106 // Writes one line to the system log.
107 void LogLine(const char* msg) { 107 void LogLine(const char* msg) {
108 #if defined(__ANDROID__)
109 logger::writeToCrashLog(msg);
110 #else
108 logger::write(msg, my_strlen(msg)); 111 logger::write(msg, my_strlen(msg));
109 #if !defined(__ANDROID__) 112 logger::write("\n", 1);
110 logger::write("\n", 1); // Android logger appends the \n. Linux's doesn't.
111 #endif 113 #endif
112 } 114 }
113 115
114 // Stages the given string in the current line buffer. 116 // Stages the given string in the current line buffer.
115 void LogAppend(const char* str) { 117 void LogAppend(const char* str) {
116 my_strlcat(log_line_, str, kLineBufferSize); 118 my_strlcat(log_line_, str, kLineBufferSize);
117 } 119 }
118 120
119 // As above (required to take precedence over template specialization below). 121 // As above (required to take precedence over template specialization below).
120 void LogAppend(char* str) { 122 void LogAppend(char* str) {
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 dumper.set_crash_thread(context->tid); 420 dumper.set_crash_thread(context->tid);
419 } 421 }
420 MicrodumpWriter writer(context, mappings, build_fingerprint, product_info, 422 MicrodumpWriter writer(context, mappings, build_fingerprint, product_info,
421 &dumper); 423 &dumper);
422 if (!writer.Init()) 424 if (!writer.Init())
423 return false; 425 return false;
424 return writer.Dump(); 426 return writer.Dump();
425 } 427 }
426 428
427 } // namespace google_breakpad 429 } // namespace google_breakpad
OLDNEW
« no previous file with comments | « src/client/linux/log/log.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698