diff options
-rw-r--r-- | src/google_breakpad/processor/system_info.h | 10 | ||||
-rw-r--r-- | src/processor/microdump.cc | 10 | ||||
-rw-r--r-- | src/processor/microdump_processor_unittest.cc | 4 | ||||
-rw-r--r-- | src/processor/stackwalk_common.cc | 21 | ||||
-rw-r--r-- | src/processor/testdata/microdump-arm.dmp | 1 | ||||
-rw-r--r-- | src/processor/testdata/microdump.stackwalk-arm.out | 4 | ||||
-rw-r--r-- | src/processor/testdata/microdump.stackwalk-arm64.out | 2 | ||||
-rw-r--r-- | src/processor/testdata/microdump.stackwalk.machine_readable-arm.out | 1 | ||||
-rw-r--r-- | src/processor/testdata/microdump.stackwalk.machine_readable-arm64.out | 1 | ||||
-rw-r--r-- | src/processor/testdata/minidump2.stackwalk.machine_readable.out | 1 | ||||
-rw-r--r-- | src/processor/testdata/minidump2.stackwalk.out | 2 |
11 files changed, 56 insertions, 1 deletions
diff --git a/src/google_breakpad/processor/system_info.h b/src/google_breakpad/processor/system_info.h index 9583d9e8..8d2f60be 100644 --- a/src/google_breakpad/processor/system_info.h +++ b/src/google_breakpad/processor/system_info.h @@ -44,7 +44,7 @@ namespace google_breakpad { struct SystemInfo { public: SystemInfo() : os(), os_short(), os_version(), cpu(), cpu_info(), - cpu_count(0) {} + cpu_count(0), gl_version(), gl_vendor(), gl_renderer() {} // Resets the SystemInfo object to its default values. void Clear() { @@ -54,6 +54,9 @@ struct SystemInfo { cpu.clear(); cpu_info.clear(); cpu_count = 0; + gl_version.clear(); + gl_vendor.clear(); + gl_renderer.clear(); } // A string identifying the operating system, such as "Windows NT", @@ -91,6 +94,11 @@ struct SystemInfo { // The number of processors in the system. Will be greater than one for // multi-core systems. int cpu_count; + + // The GPU information. Currently only populated in microdumps. + string gl_version; + string gl_vendor; + string gl_renderer; }; } // namespace google_breakpad diff --git a/src/processor/microdump.cc b/src/processor/microdump.cc index 6a51a997..e276743f 100644 --- a/src/processor/microdump.cc +++ b/src/processor/microdump.cc @@ -54,11 +54,13 @@ static const char kMicrodumpBegin[] = "-----BEGIN BREAKPAD MICRODUMP-----"; static const char kMicrodumpEnd[] = "-----END BREAKPAD MICRODUMP-----"; static const char kOsKey[] = ": O "; static const char kCpuKey[] = ": C "; +static const char kGpuKey[] = ": G "; static const char kMmapKey[] = ": M "; static const char kStackKey[] = ": S "; static const char kStackFirstLineKey[] = ": S 0 "; static const char kArmArchitecture[] = "arm"; static const char kArm64Architecture[] = "arm64"; +static const char kGpuUnknown[] = "UNKNOWN"; template<typename T> T HexStrToL(const string& str) { @@ -292,6 +294,14 @@ Microdump::Microdump(const string& contents) } else { std::cerr << "Unsupported architecture: " << arch << std::endl; } + } else if ((pos = line.find(kGpuKey)) != string::npos) { + string gpu_str(line, pos + strlen(kGpuKey)); + if (strcmp(gpu_str.c_str(), kGpuUnknown) != 0) { + std::istringstream gpu_tokens(gpu_str); + std::getline(gpu_tokens, system_info_->gl_version, '|'); + std::getline(gpu_tokens, system_info_->gl_vendor, '|'); + std::getline(gpu_tokens, system_info_->gl_renderer, '|'); + } } else if ((pos = line.find(kMmapKey)) != string::npos) { string mmap_line(line, pos + strlen(kMmapKey)); std::istringstream mmap_tokens(mmap_line); diff --git a/src/processor/microdump_processor_unittest.cc b/src/processor/microdump_processor_unittest.cc index e667c386..650e3b10 100644 --- a/src/processor/microdump_processor_unittest.cc +++ b/src/processor/microdump_processor_unittest.cc @@ -159,6 +159,10 @@ TEST_F(MicrodumpProcessorTest, TestProcessArm) { ASSERT_EQ(6U, state.modules()->module_count()); ASSERT_EQ("arm", state.system_info()->cpu); + ASSERT_EQ("OpenGL ES 3.0 V@104.0 AU@ (GIT@Id3510ff6dc)", + state.system_info()->gl_version); + ASSERT_EQ("Qualcomm", state.system_info()->gl_vendor); + ASSERT_EQ("Adreno (TM) 330", state.system_info()->gl_renderer); ASSERT_EQ("OS VERSION INFO", state.system_info()->os_version); ASSERT_EQ(8U, state.threads()->at(0)->frames()->size()); ASSERT_EQ("MicrodumpWriterTest_Setup_Test::TestBody", diff --git a/src/processor/stackwalk_common.cc b/src/processor/stackwalk_common.cc index 20734fe0..58ba6bda 100644 --- a/src/processor/stackwalk_common.cc +++ b/src/processor/stackwalk_common.cc @@ -803,6 +803,20 @@ void PrintProcessState(const ProcessState& process_state, process_state.system_info()->cpu_count != 1 ? "s" : ""); printf("\n"); + // Print GPU information + string gl_version = process_state.system_info()->gl_version; + string gl_vendor = process_state.system_info()->gl_vendor; + string gl_renderer = process_state.system_info()->gl_renderer; + printf("GPU:"); + if (!gl_version.empty() || !gl_vendor.empty() || !gl_renderer.empty()) { + printf(" %s\n", gl_version.c_str()); + printf(" %s\n", gl_vendor.c_str()); + printf(" %s\n", gl_renderer.c_str()); + } else { + printf(" UNKNOWN\n"); + } + printf("\n"); + // Print crash information. if (process_state.crashed()) { printf("Crash reason: %s\n", process_state.crash_reason().c_str()); @@ -865,6 +879,7 @@ void PrintProcessStateMachineReadable(const ProcessState& process_state) { // Print OS and CPU information. // OS|{OS Name}|{OS Version} // CPU|{CPU Name}|{CPU Info}|{Number of CPUs} + // GPU|{GPU version}|{GPU vendor}|{GPU renderer} printf("OS%c%s%c%s\n", kOutputSeparator, StripSeparator(process_state.system_info()->os).c_str(), kOutputSeparator, @@ -876,6 +891,12 @@ void PrintProcessStateMachineReadable(const ProcessState& process_state) { StripSeparator(process_state.system_info()->cpu_info).c_str(), kOutputSeparator, process_state.system_info()->cpu_count); + printf("GPU%c%s%c%s%c%s\n", kOutputSeparator, + StripSeparator(process_state.system_info()->gl_version).c_str(), + kOutputSeparator, + StripSeparator(process_state.system_info()->gl_vendor).c_str(), + kOutputSeparator, + StripSeparator(process_state.system_info()->gl_renderer).c_str()); int requesting_thread = process_state.requesting_thread(); diff --git a/src/processor/testdata/microdump-arm.dmp b/src/processor/testdata/microdump-arm.dmp index 5f52e419..cd409d37 100644 --- a/src/processor/testdata/microdump-arm.dmp +++ b/src/processor/testdata/microdump-arm.dmp @@ -1,5 +1,6 @@ W/google-breakpad( 3745): -----BEGIN BREAKPAD MICRODUMP----- W/google-breakpad( 3745): O A arm 02 armv7l OS VERSION INFO +W/google-breakpad( 3745): G OpenGL ES 3.0 V@104.0 AU@ (GIT@Id3510ff6dc)|Qualcomm|Adreno (TM) 330 W/google-breakpad( 3745): S 0 FFEA68C0 FFEA6000 00002000 W/google-breakpad( 3745): S FFEA6000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080020000A000002CA705F728000000000000000A000000000000000000000028000000 W/google-breakpad( 3745): S FFEA6180 2168EAFFC59104F77C67EAFF7C62EAFF4062EAFF1E71B3AA040000001E71B3AA4062EAFF020000007C62EAFFD062EAFFE867EAFFFAFFFFFF8263EAFFC9A404F700000000000000000000000000000000000000008363EAFF000000005462EAFFFFFFFFFF7C67EAFF1E71B3AA00000000000000003B62EAFF800000000600000000000000000000003C62EAFF06000000000000001B71B3AA000000005C62EAFF0000000000000000000000004462EAFF80000000D4ED06F7000000000000000000000000000000000000000000000000000000000000000000000000E467EAFF00000000000000000000000000000000000000000000000000000000C862EAFF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008263EAFF06000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 diff --git a/src/processor/testdata/microdump.stackwalk-arm.out b/src/processor/testdata/microdump.stackwalk-arm.out index 2b82dab9..ae018d37 100644 --- a/src/processor/testdata/microdump.stackwalk-arm.out +++ b/src/processor/testdata/microdump.stackwalk-arm.out @@ -3,6 +3,10 @@ Operating system: Android CPU: arm 2 CPUs +GPU: OpenGL ES 3.0 V@104.0 AU@ (GIT@Id3510ff6dc) + Qualcomm + Adreno (TM) 330 + Crash reason: Crash address: 0x0 Process uptime: not available diff --git a/src/processor/testdata/microdump.stackwalk-arm64.out b/src/processor/testdata/microdump.stackwalk-arm64.out index 2676d024..e6ed4243 100644 --- a/src/processor/testdata/microdump.stackwalk-arm64.out +++ b/src/processor/testdata/microdump.stackwalk-arm64.out @@ -3,6 +3,8 @@ Operating system: Android CPU: arm64 2 CPUs +GPU: UNKNOWN + Crash reason: Crash address: 0x0 Process uptime: not available diff --git a/src/processor/testdata/microdump.stackwalk.machine_readable-arm.out b/src/processor/testdata/microdump.stackwalk.machine_readable-arm.out index 8193ed0c..869fc4d8 100644 --- a/src/processor/testdata/microdump.stackwalk.machine_readable-arm.out +++ b/src/processor/testdata/microdump.stackwalk.machine_readable-arm.out @@ -1,5 +1,6 @@ OS|Android|OS VERSION INFO CPU|arm||2 +GPU|OpenGL ES 3.0 V@104.0 AU@ (GIT@Id3510ff6dc)|Qualcomm|Adreno (TM) 330 Crash||0x0|0 Module|breakpad_unittests||breakpad_unittests|DA7778FB66018A4E9B4110ED06E730D00|0xaaacd000|0xaab48fff|0 Module|libnetd_client.so||libnetd_client.so|56B149396A4DAF176E26B4A85DA87BF30|0xf6fca000|0xf6fcdfff|0 diff --git a/src/processor/testdata/microdump.stackwalk.machine_readable-arm64.out b/src/processor/testdata/microdump.stackwalk.machine_readable-arm64.out index 4a26ecf5..7734dda5 100644 --- a/src/processor/testdata/microdump.stackwalk.machine_readable-arm64.out +++ b/src/processor/testdata/microdump.stackwalk.machine_readable-arm64.out @@ -1,5 +1,6 @@ OS|Android|OS 64 VERSION INFO CPU|arm64||2 +GPU||| Crash||0x0|0 Module|breakpad_unittests||breakpad_unittests|D6D1FEC9A15DE7F38A236898871A2E770|0x555f608000|0x555f6c7fff|0 Module|libnetd_client.so||libnetd_client.so|7735F44BA6D7C27FD5C3636A43369B7C0|0x7f801f6000|0x7f80208fff|0 diff --git a/src/processor/testdata/minidump2.stackwalk.machine_readable.out b/src/processor/testdata/minidump2.stackwalk.machine_readable.out index 60f8af4c..c976555d 100644 --- a/src/processor/testdata/minidump2.stackwalk.machine_readable.out +++ b/src/processor/testdata/minidump2.stackwalk.machine_readable.out @@ -1,5 +1,6 @@ OS|Windows NT|5.1.2600 Service Pack 2 CPU|x86|GenuineIntel family 6 model 13 stepping 8|1 +GPU||| Crash|EXCEPTION_ACCESS_VIOLATION_WRITE|0x45|0 Module|test_app.exe||test_app.pdb|5A9832E5287241C1838ED98914E9B7FF1|0x00400000|0x0042cfff|1 Module|dbghelp.dll|5.1.2600.2180|dbghelp.pdb|39559573E21B46F28E286923BE9E6A761|0x59a60000|0x59b00fff|0 diff --git a/src/processor/testdata/minidump2.stackwalk.out b/src/processor/testdata/minidump2.stackwalk.out index 784c7e57..d04234ab 100644 --- a/src/processor/testdata/minidump2.stackwalk.out +++ b/src/processor/testdata/minidump2.stackwalk.out @@ -4,6 +4,8 @@ CPU: x86 GenuineIntel family 6 model 13 stepping 8 1 CPU +GPU: UNKNOWN + Crash reason: EXCEPTION_ACCESS_VIOLATION_WRITE Crash address: 0x45 Process uptime: 0 seconds |