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

Unified Diff: src/client/linux/microdump_writer/microdump_writer.cc

Issue 1288313002: [microdump] Fix hw architecture indication in build fingerprint line (Closed) Base URL: http://google-breakpad.googlecode.com/svn/trunk
Patch Set: Add test 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/client/linux/microdump_writer/microdump_writer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 247387e202d660bfee768615eafc2768a9b40f5e..d54d490958a0d96e763d37fef307986710e46c60 100644
--- a/src/client/linux/microdump_writer/microdump_writer.cc
+++ b/src/client/linux/microdump_writer/microdump_writer.cc
@@ -166,8 +166,9 @@ class MicrodumpWriter {
const char kOSId[] = "L";
#endif
-// We cannot depend on uts.machine. On multiarch devices it always returns the
-// primary arch, not the one that match the executable being run.
+// Dump the runtime architecture. On multiarch devices it might not match the
+// hw architecture (the one returned by uname()), for instance in the case of
+// a 32-bit app running on a aarch64 device.
#if defined(__aarch64__)
const char kArch[] = "arm64";
#elif defined(__ARMEL__)
@@ -189,21 +190,24 @@ class MicrodumpWriter {
LogAppend(" ");
LogAppend(n_cpus);
LogAppend(" ");
+
+ // Dump the HW architecture (e.g., armv7l, aarch64).
+ struct utsname uts;
+ const bool has_uts_info = (uname(&uts) == 0);
+ const char* hwArch = has_uts_info ? uts.machine : "unknown_hw_arch";
+ LogAppend(hwArch);
+ LogAppend(" ");
+
// 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_);
+ } else if (has_uts_info) {
+ LogAppend(uts.release);
+ LogAppend(" ");
+ LogAppend(uts.version);
} else {
- struct utsname uts;
- if (uname(&uts) == 0) {
- LogAppend(uts.machine);
- LogAppend(" ");
- LogAppend(uts.release);
- LogAppend(" ");
- LogAppend(uts.version);
- } else {
- LogAppend("no build fingerprint available");
- }
+ LogAppend("no build fingerprint available");
}
LogCommitLine();
}
« no previous file with comments | « no previous file | src/client/linux/microdump_writer/microdump_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698