Parse additional line introduced in the microdump format and containing the GPU infromation in the following format:

G GL_VERSION|GL_VENDOR|GL_RENDERER.

The GPU version, vendor and renderer are extracted during microdump parsing and populated in the appropriate fields in the SystemInfo struct.

This is to match the changes introduced in crrev.com/1343713002 and crrev.com/1334473003

BUG=chromium:536769
R=primiano@chromium.org

Review URL: https://codereview.chromium.org/1678463002 .
This commit is contained in:
Maria Mandlis 2016-02-11 10:04:04 -08:00
parent a8f79b0fde
commit df280bb631
11 changed files with 56 additions and 1 deletions

View File

@ -44,7 +44,7 @@ namespace google_breakpad {
struct SystemInfo { struct SystemInfo {
public: public:
SystemInfo() : os(), os_short(), os_version(), cpu(), cpu_info(), 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. // Resets the SystemInfo object to its default values.
void Clear() { void Clear() {
@ -54,6 +54,9 @@ struct SystemInfo {
cpu.clear(); cpu.clear();
cpu_info.clear(); cpu_info.clear();
cpu_count = 0; cpu_count = 0;
gl_version.clear();
gl_vendor.clear();
gl_renderer.clear();
} }
// A string identifying the operating system, such as "Windows NT", // 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 // The number of processors in the system. Will be greater than one for
// multi-core systems. // multi-core systems.
int cpu_count; int cpu_count;
// The GPU information. Currently only populated in microdumps.
string gl_version;
string gl_vendor;
string gl_renderer;
}; };
} // namespace google_breakpad } // namespace google_breakpad

View File

@ -54,11 +54,13 @@ static const char kMicrodumpBegin[] = "-----BEGIN BREAKPAD MICRODUMP-----";
static const char kMicrodumpEnd[] = "-----END BREAKPAD MICRODUMP-----"; static const char kMicrodumpEnd[] = "-----END BREAKPAD MICRODUMP-----";
static const char kOsKey[] = ": O "; static const char kOsKey[] = ": O ";
static const char kCpuKey[] = ": C "; static const char kCpuKey[] = ": C ";
static const char kGpuKey[] = ": G ";
static const char kMmapKey[] = ": M "; static const char kMmapKey[] = ": M ";
static const char kStackKey[] = ": S "; static const char kStackKey[] = ": S ";
static const char kStackFirstLineKey[] = ": S 0 "; static const char kStackFirstLineKey[] = ": S 0 ";
static const char kArmArchitecture[] = "arm"; static const char kArmArchitecture[] = "arm";
static const char kArm64Architecture[] = "arm64"; static const char kArm64Architecture[] = "arm64";
static const char kGpuUnknown[] = "UNKNOWN";
template<typename T> template<typename T>
T HexStrToL(const string& str) { T HexStrToL(const string& str) {
@ -292,6 +294,14 @@ Microdump::Microdump(const string& contents)
} else { } else {
std::cerr << "Unsupported architecture: " << arch << std::endl; 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) { } else if ((pos = line.find(kMmapKey)) != string::npos) {
string mmap_line(line, pos + strlen(kMmapKey)); string mmap_line(line, pos + strlen(kMmapKey));
std::istringstream mmap_tokens(mmap_line); std::istringstream mmap_tokens(mmap_line);

View File

@ -159,6 +159,10 @@ TEST_F(MicrodumpProcessorTest, TestProcessArm) {
ASSERT_EQ(6U, state.modules()->module_count()); ASSERT_EQ(6U, state.modules()->module_count());
ASSERT_EQ("arm", state.system_info()->cpu); 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("OS VERSION INFO", state.system_info()->os_version);
ASSERT_EQ(8U, state.threads()->at(0)->frames()->size()); ASSERT_EQ(8U, state.threads()->at(0)->frames()->size());
ASSERT_EQ("MicrodumpWriterTest_Setup_Test::TestBody", ASSERT_EQ("MicrodumpWriterTest_Setup_Test::TestBody",

View File

@ -803,6 +803,20 @@ void PrintProcessState(const ProcessState& process_state,
process_state.system_info()->cpu_count != 1 ? "s" : ""); process_state.system_info()->cpu_count != 1 ? "s" : "");
printf("\n"); 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. // Print crash information.
if (process_state.crashed()) { if (process_state.crashed()) {
printf("Crash reason: %s\n", process_state.crash_reason().c_str()); 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. // Print OS and CPU information.
// OS|{OS Name}|{OS Version} // OS|{OS Name}|{OS Version}
// CPU|{CPU Name}|{CPU Info}|{Number of CPUs} // CPU|{CPU Name}|{CPU Info}|{Number of CPUs}
// GPU|{GPU version}|{GPU vendor}|{GPU renderer}
printf("OS%c%s%c%s\n", kOutputSeparator, printf("OS%c%s%c%s\n", kOutputSeparator,
StripSeparator(process_state.system_info()->os).c_str(), StripSeparator(process_state.system_info()->os).c_str(),
kOutputSeparator, kOutputSeparator,
@ -876,6 +891,12 @@ void PrintProcessStateMachineReadable(const ProcessState& process_state) {
StripSeparator(process_state.system_info()->cpu_info).c_str(), StripSeparator(process_state.system_info()->cpu_info).c_str(),
kOutputSeparator, kOutputSeparator,
process_state.system_info()->cpu_count); 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(); int requesting_thread = process_state.requesting_thread();

View File

@ -1,5 +1,6 @@
W/google-breakpad( 3745): -----BEGIN BREAKPAD MICRODUMP----- W/google-breakpad( 3745): -----BEGIN BREAKPAD MICRODUMP-----
W/google-breakpad( 3745): O A arm 02 armv7l OS VERSION INFO 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 0 FFEA68C0 FFEA6000 00002000
W/google-breakpad( 3745): S FFEA6000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080020000A000002CA705F728000000000000000A000000000000000000000028000000 W/google-breakpad( 3745): S FFEA6000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080020000A000002CA705F728000000000000000A000000000000000000000028000000
W/google-breakpad( 3745): S FFEA6180 2168EAFFC59104F77C67EAFF7C62EAFF4062EAFF1E71B3AA040000001E71B3AA4062EAFF020000007C62EAFFD062EAFFE867EAFFFAFFFFFF8263EAFFC9A404F700000000000000000000000000000000000000008363EAFF000000005462EAFFFFFFFFFF7C67EAFF1E71B3AA00000000000000003B62EAFF800000000600000000000000000000003C62EAFF06000000000000001B71B3AA000000005C62EAFF0000000000000000000000004462EAFF80000000D4ED06F7000000000000000000000000000000000000000000000000000000000000000000000000E467EAFF00000000000000000000000000000000000000000000000000000000C862EAFF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008263EAFF06000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 W/google-breakpad( 3745): S FFEA6180 2168EAFFC59104F77C67EAFF7C62EAFF4062EAFF1E71B3AA040000001E71B3AA4062EAFF020000007C62EAFFD062EAFFE867EAFFFAFFFFFF8263EAFFC9A404F700000000000000000000000000000000000000008363EAFF000000005462EAFFFFFFFFFF7C67EAFF1E71B3AA00000000000000003B62EAFF800000000600000000000000000000003C62EAFF06000000000000001B71B3AA000000005C62EAFF0000000000000000000000004462EAFF80000000D4ED06F7000000000000000000000000000000000000000000000000000000000000000000000000E467EAFF00000000000000000000000000000000000000000000000000000000C862EAFF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008263EAFF06000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

View File

@ -3,6 +3,10 @@ Operating system: Android
CPU: arm CPU: arm
2 CPUs 2 CPUs
GPU: OpenGL ES 3.0 V@104.0 AU@ (GIT@Id3510ff6dc)
Qualcomm
Adreno (TM) 330
Crash reason: Crash reason:
Crash address: 0x0 Crash address: 0x0
Process uptime: not available Process uptime: not available

View File

@ -3,6 +3,8 @@ Operating system: Android
CPU: arm64 CPU: arm64
2 CPUs 2 CPUs
GPU: UNKNOWN
Crash reason: Crash reason:
Crash address: 0x0 Crash address: 0x0
Process uptime: not available Process uptime: not available

View File

@ -1,5 +1,6 @@
OS|Android|OS VERSION INFO OS|Android|OS VERSION INFO
CPU|arm||2 CPU|arm||2
GPU|OpenGL ES 3.0 V@104.0 AU@ (GIT@Id3510ff6dc)|Qualcomm|Adreno (TM) 330
Crash||0x0|0 Crash||0x0|0
Module|breakpad_unittests||breakpad_unittests|DA7778FB66018A4E9B4110ED06E730D00|0xaaacd000|0xaab48fff|0 Module|breakpad_unittests||breakpad_unittests|DA7778FB66018A4E9B4110ED06E730D00|0xaaacd000|0xaab48fff|0
Module|libnetd_client.so||libnetd_client.so|56B149396A4DAF176E26B4A85DA87BF30|0xf6fca000|0xf6fcdfff|0 Module|libnetd_client.so||libnetd_client.so|56B149396A4DAF176E26B4A85DA87BF30|0xf6fca000|0xf6fcdfff|0

View File

@ -1,5 +1,6 @@
OS|Android|OS 64 VERSION INFO OS|Android|OS 64 VERSION INFO
CPU|arm64||2 CPU|arm64||2
GPU|||
Crash||0x0|0 Crash||0x0|0
Module|breakpad_unittests||breakpad_unittests|D6D1FEC9A15DE7F38A236898871A2E770|0x555f608000|0x555f6c7fff|0 Module|breakpad_unittests||breakpad_unittests|D6D1FEC9A15DE7F38A236898871A2E770|0x555f608000|0x555f6c7fff|0
Module|libnetd_client.so||libnetd_client.so|7735F44BA6D7C27FD5C3636A43369B7C0|0x7f801f6000|0x7f80208fff|0 Module|libnetd_client.so||libnetd_client.so|7735F44BA6D7C27FD5C3636A43369B7C0|0x7f801f6000|0x7f80208fff|0

View File

@ -1,5 +1,6 @@
OS|Windows NT|5.1.2600 Service Pack 2 OS|Windows NT|5.1.2600 Service Pack 2
CPU|x86|GenuineIntel family 6 model 13 stepping 8|1 CPU|x86|GenuineIntel family 6 model 13 stepping 8|1
GPU|||
Crash|EXCEPTION_ACCESS_VIOLATION_WRITE|0x45|0 Crash|EXCEPTION_ACCESS_VIOLATION_WRITE|0x45|0
Module|test_app.exe||test_app.pdb|5A9832E5287241C1838ED98914E9B7FF1|0x00400000|0x0042cfff|1 Module|test_app.exe||test_app.pdb|5A9832E5287241C1838ED98914E9B7FF1|0x00400000|0x0042cfff|1
Module|dbghelp.dll|5.1.2600.2180|dbghelp.pdb|39559573E21B46F28E286923BE9E6A761|0x59a60000|0x59b00fff|0 Module|dbghelp.dll|5.1.2600.2180|dbghelp.pdb|39559573E21B46F28E286923BE9E6A761|0x59a60000|0x59b00fff|0

View File

@ -4,6 +4,8 @@ CPU: x86
GenuineIntel family 6 model 13 stepping 8 GenuineIntel family 6 model 13 stepping 8
1 CPU 1 CPU
GPU: UNKNOWN
Crash reason: EXCEPTION_ACCESS_VIOLATION_WRITE Crash reason: EXCEPTION_ACCESS_VIOLATION_WRITE
Crash address: 0x45 Crash address: 0x45
Process uptime: 0 seconds Process uptime: 0 seconds