Closed Bug 853851 Opened 13 years ago Closed 13 years ago

Transition some breakpad logging to BPLOG

Categories

(Core :: Gecko Profiler, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: jseward, Assigned: jseward)

Details

Attachments

(2 files, 1 obsolete file)

Transition some breakpad profiling from fprintf(stderr, ...) to BPLOG so it works sanely for SPS running on Android. Also add a bit more logging to src/common/linux/dump_symbols.cc.
Assignee: nobody → jseward
Attached patch Proposed patch (obsolete) — Splinter Review
Attachment #728212 - Flags: feedback?(ted)
This was a stopgap fix whilst breakpad didn't have adequate logging in dump_symbols.cc. The other patch on this bug adds that, though, and does it better. In which case the stuff in local_debug_info_symbolizer.cc is redundant.
Attachment #728225 - Flags: review?(ted)
Also moves pathname_stripper.{cc,h} and pathname_stripper_unittest.cc from processor/ to common/, so as to work around link failures when --disable-crashreporter is not given.
Attachment #728212 - Attachment is obsolete: true
Attachment #728212 - Flags: feedback?(ted)
Attachment #729021 - Flags: review?(ted)
Comment on attachment 729021 [details] [diff] [review] Proposed patch, take 2 Review of attachment 729021 [details] [diff] [review]: ----------------------------------------------------------------- This looks fine to me. I'd like to get this up for upstream review just to see what Mark thinks of the idea of using the existing logging code in the symbol dumping code. ::: toolkit/crashreporter/google-breakpad/src/common/dwarf_cfi_to_module.cc @@ +233,5 @@ > } > > void DwarfCFIToModule::Reporter::UnnamedRegister(size_t offset, int reg) { > + BPLOG(INFO) << file_ << ", section '" << section_ > + << "': the call frame entry at offset 0x" nit: you've got some trailing spaces in this file. ::: toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc @@ +528,5 @@ > typedef typename ElfClass::Addr Addr; > typedef typename ElfClass::Phdr Phdr; > typedef typename ElfClass::Shdr Shdr; > > + BPLOG(INFO) << ""; Any reason for this blank line? ::: toolkit/crashreporter/google-breakpad/src/processor/logging.cc @@ +48,5 @@ > #ifdef _WIN32 > #define snprintf _snprintf > #endif > > +#ifdef ANDROID You want __ANDROID__ here and below. @@ +86,5 @@ > LogStream::~LogStream() { > +#ifdef ANDROID > + __android_log_print(ANDROID_LOG_ERROR, > + "Profiler", "%s", str_.str().c_str()); > +#else I'm sure there's a smarter way of handling this, like implementing our own stringstream or ostream subclass and handling << endl to do the log print, and then changing the #defines in logging.h to use our new class, but that seems like a lot more work. ::: toolkit/crashreporter/google-breakpad/src/processor/logging.h @@ +100,2 @@ > template<typename T> std::ostream& operator<<(const T &t) { > + return str_ << t; I'm not sure it matters much in practice, but would it be better to ifdef this so the behavior doesn't change on non-Android?
Attachment #729021 - Flags: review?(ted) → review+
Attachment #728225 - Flags: review?(ted) → review+
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: