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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 12049058: Adds AVX detection to CPU and records a histogram of Intel uArch Support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moving the check to chrome_browser_main.cc Created 7 years, 11 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 | « base/cpu.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 76ba3818c253fb48aa7df828bd0979c34dd5b034..df935796200683fee616554ce1815df758fdbe3c 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -14,6 +14,7 @@
#include "base/at_exit.h"
#include "base/bind.h"
#include "base/command_line.h"
+#include "base/cpu.h"
#include "base/debug/trace_event.h"
#include "base/file_path.h"
#include "base/file_util.h"
@@ -971,6 +972,19 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
StartMetricsRecording();
#endif
+#if defined(ARCH_CPU_X86_FAMILY)
apatrick_chromium 2013/01/25 19:06:30 Consider extracting this code to a function define
+ base::CPU cpu;
+ int arch = 0;
+ if (cpu.has_sse()) arch = 1;
apatrick_chromium 2013/01/25 19:06:30 style nit: Drop body to its own line. Also can yo
+ if (cpu.has_sse2()) arch = 2;
+ if (cpu.has_sse3()) arch = 3;
+ if (cpu.has_ssse3()) arch = 4;
+ if (cpu.has_sse41()) arch = 5;
+ if (cpu.has_sse42()) arch = 6;
+ if (cpu.has_avx()) arch = 7;
+ UMA_HISTOGRAM_ENUMERATION("Platform.IntelMaxuArchSupport", arch, 8);
apatrick_chromium 2013/01/25 19:06:30 A search for "Intel Maxu Arch" yields nothing. Wha
whunt 2013/01/30 23:53:11 uArch is a very common (at least at Intel...) abbr
+#endif // defined(ARCH_CPU_X86_FAMILY)
+
// Create watchdog thread after creating all other threads because it will
// watch the other threads and they must be running.
browser_process_->watchdog_thread();
« no previous file with comments | « base/cpu.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698