Index: src/client/linux/microdump_writer/microdump_writer.cc |
diff --git a/src/client/linux/microdump_writer/microdump_writer.cc b/src/client/linux/microdump_writer/microdump_writer.cc |
index d2eaa6ee69f7ae20f0464716ba571e21810b6fcb..aa9f94136761b98a20dd664198431138eb9dd556 100644 |
--- a/src/client/linux/microdump_writer/microdump_writer.cc |
+++ b/src/client/linux/microdump_writer/microdump_writer.cc |
@@ -37,6 +37,7 @@ |
#include "client/linux/dump_writer_common/thread_info.h" |
#include "client/linux/dump_writer_common/ucontext_reader.h" |
#include "client/linux/handler/exception_handler.h" |
+#include "client/linux/handler/microdump_extra_info.h" |
#include "client/linux/log/log.h" |
#include "client/linux/minidump_writer/linux_ptrace_dumper.h" |
#include "common/linux/linux_libc_support.h" |
@@ -48,6 +49,7 @@ using google_breakpad::LinuxDumper; |
using google_breakpad::LinuxPtraceDumper; |
using google_breakpad::MappingInfo; |
using google_breakpad::MappingList; |
+using google_breakpad::MicrodumpExtraInfo; |
using google_breakpad::RawContextCPU; |
using google_breakpad::ThreadInfo; |
using google_breakpad::UContextReader; |
@@ -58,8 +60,7 @@ class MicrodumpWriter { |
public: |
MicrodumpWriter(const ExceptionHandler::CrashContext* context, |
const MappingList& mappings, |
- const char* build_fingerprint, |
- const char* product_info, |
+ const MicrodumpExtraInfo& microdump_extra_info, |
LinuxDumper* dumper) |
: ucontext_(context ? &context->context : NULL), |
#if !defined(__ARM_EABI__) && !defined(__mips__) |
@@ -67,8 +68,7 @@ class MicrodumpWriter { |
#endif |
dumper_(dumper), |
mapping_list_(mappings), |
- build_fingerprint_(build_fingerprint), |
- product_info_(product_info), |
+ microdump_extra_info_(microdump_extra_info), |
log_line_(NULL) { |
log_line_ = reinterpret_cast<char*>(Alloc(kLineBufferSize)); |
if (log_line_) |
@@ -92,6 +92,7 @@ class MicrodumpWriter { |
LogLine("-----BEGIN BREAKPAD MICRODUMP-----"); |
DumpProductInformation(); |
DumpOSInformation(); |
+ DumpGPUInformation(); |
success = DumpCrashingThread(); |
if (success) |
success = DumpMappings(); |
@@ -149,8 +150,8 @@ class MicrodumpWriter { |
void DumpProductInformation() { |
LogAppend("V "); |
- if (product_info_) { |
- LogAppend(product_info_); |
+ if (microdump_extra_info_.product_info) { |
+ LogAppend(microdump_extra_info_.product_info); |
} else { |
LogAppend("UNKNOWN:0.0.0.0"); |
} |
@@ -200,8 +201,8 @@ class MicrodumpWriter { |
// If the client has attached a build fingerprint to the MinidumpDescriptor |
// use that one. Otherwise try to get some basic info from uname(). |
- if (build_fingerprint_) { |
- LogAppend(build_fingerprint_); |
+ if (microdump_extra_info_.build_fingerprint) { |
+ LogAppend(microdump_extra_info_.build_fingerprint); |
} else if (has_uts_info) { |
LogAppend(uts.release); |
LogAppend(" "); |
@@ -212,6 +213,16 @@ class MicrodumpWriter { |
LogCommitLine(); |
} |
+ void DumpGPUInformation() { |
+ LogAppend("G "); |
+ if (microdump_extra_info_.gpu_fingerprint) { |
+ LogAppend(microdump_extra_info_.gpu_fingerprint); |
+ } else { |
+ LogAppend("UNKNOWN"); |
+ } |
+ LogCommitLine(); |
+ } |
+ |
bool DumpThreadStack(uint32_t thread_id, |
uintptr_t stack_pointer, |
int max_stack_len, |
@@ -390,8 +401,7 @@ class MicrodumpWriter { |
#endif |
LinuxDumper* dumper_; |
const MappingList& mapping_list_; |
- const char* const build_fingerprint_; |
- const char* const product_info_; |
+ const MicrodumpExtraInfo microdump_extra_info_; |
char* log_line_; |
}; |
} // namespace |
@@ -402,8 +412,7 @@ bool WriteMicrodump(pid_t crashing_process, |
const void* blob, |
size_t blob_size, |
const MappingList& mappings, |
- const char* build_fingerprint, |
- const char* product_info) { |
+ const MicrodumpExtraInfo& microdump_extra_info) { |
LinuxPtraceDumper dumper(crashing_process); |
const ExceptionHandler::CrashContext* context = NULL; |
if (blob) { |
@@ -415,8 +424,7 @@ bool WriteMicrodump(pid_t crashing_process, |
dumper.set_crash_signal(context->siginfo.si_signo); |
dumper.set_crash_thread(context->tid); |
} |
- MicrodumpWriter writer(context, mappings, build_fingerprint, product_info, |
- &dumper); |
+ MicrodumpWriter writer(context, mappings, microdump_extra_info, &dumper); |
if (!writer.Init()) |
return false; |
return writer.Dump(); |