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

Unified Diff: content/browser/gpu/gpu_process_host.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: 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: content/browser/gpu/gpu_process_host.cc
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 86aee41875f0bcfe786c2eef36d392a214c1122b..0a853cdf4524a7132cff225234e9bbbd3348a699 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/command_line.h"
+#include "base/cpu.h"
#include "base/debug/trace_event.h"
#include "base/memory/ref_counted.h"
#include "base/metrics/histogram.h"
@@ -270,6 +271,28 @@ GpuProcessHost* GpuProcessHost::Get(GpuProcessKind kind,
int host_id;
host_id = ++last_host_id;
+#if defined(ARCH_CPU_X86_FAMILY)
+ base::CPU cpu;
+ int arch = 0;
+ if (cpu.has_sse())
+ arch = 1;
apatrick_chromium 2013/01/25 19:06:30 nit: use an enum and comment that it must not be r
+ 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);
+#endif // defined(ARCH_CPU_X86_FAMILY)
+
UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessLaunchCause",
cause,
CAUSE_FOR_GPU_LAUNCH_MAX_ENUM);
« 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