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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/cpu.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #if defined(TOOLKIT_GTK) 7 #if defined(TOOLKIT_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/at_exit.h" 14 #include "base/at_exit.h"
15 #include "base/bind.h" 15 #include "base/bind.h"
16 #include "base/command_line.h" 16 #include "base/command_line.h"
17 #include "base/cpu.h"
17 #include "base/debug/trace_event.h" 18 #include "base/debug/trace_event.h"
18 #include "base/file_path.h" 19 #include "base/file_path.h"
19 #include "base/file_util.h" 20 #include "base/file_util.h"
20 #include "base/metrics/field_trial.h" 21 #include "base/metrics/field_trial.h"
21 #include "base/metrics/histogram.h" 22 #include "base/metrics/histogram.h"
22 #include "base/path_service.h" 23 #include "base/path_service.h"
23 #include "base/prefs/json_pref_store.h" 24 #include "base/prefs/json_pref_store.h"
24 #include "base/process_info.h" 25 #include "base/process_info.h"
25 #include "base/process_util.h" 26 #include "base/process_util.h"
26 #include "base/run_loop.h" 27 #include "base/run_loop.h"
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
964 } 965 }
965 966
966 int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { 967 int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
967 // Android updates the metrics service dynamically depending on whether the 968 // Android updates the metrics service dynamically depending on whether the
968 // application is in the foreground or not. Do not start here. 969 // application is in the foreground or not. Do not start here.
969 #if !defined(OS_ANDROID) 970 #if !defined(OS_ANDROID)
970 // Now that the file thread has been started, start recording. 971 // Now that the file thread has been started, start recording.
971 StartMetricsRecording(); 972 StartMetricsRecording();
972 #endif 973 #endif
973 974
975 #if defined(ARCH_CPU_X86_FAMILY)
apatrick_chromium 2013/01/25 19:06:30 Consider extracting this code to a function define
976 base::CPU cpu;
977 int arch = 0;
978 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
979 if (cpu.has_sse2()) arch = 2;
980 if (cpu.has_sse3()) arch = 3;
981 if (cpu.has_ssse3()) arch = 4;
982 if (cpu.has_sse41()) arch = 5;
983 if (cpu.has_sse42()) arch = 6;
984 if (cpu.has_avx()) arch = 7;
985 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
986 #endif // defined(ARCH_CPU_X86_FAMILY)
987
974 // Create watchdog thread after creating all other threads because it will 988 // Create watchdog thread after creating all other threads because it will
975 // watch the other threads and they must be running. 989 // watch the other threads and they must be running.
976 browser_process_->watchdog_thread(); 990 browser_process_->watchdog_thread();
977 991
978 // Do any initializating in the browser process that requires all threads 992 // Do any initializating in the browser process that requires all threads
979 // running. 993 // running.
980 browser_process_->PreMainMessageLoopRun(); 994 browser_process_->PreMainMessageLoopRun();
981 995
982 // Record last shutdown time into a histogram. 996 // Record last shutdown time into a histogram.
983 browser_shutdown::ReadLastShutdownInfo(); 997 browser_shutdown::ReadLastShutdownInfo();
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
1643 if (base::win::GetVersion() <= base::win::VERSION_XP) 1657 if (base::win::GetVersion() <= base::win::VERSION_XP)
1644 uma_name += "_XP"; 1658 uma_name += "_XP";
1645 1659
1646 uma_name += "_PreRead_"; 1660 uma_name += "_PreRead_";
1647 uma_name += pre_read_percentage; 1661 uma_name += pre_read_percentage;
1648 AddPreReadHistogramTime(uma_name.c_str(), time); 1662 AddPreReadHistogramTime(uma_name.c_str(), time);
1649 } 1663 }
1650 #endif 1664 #endif
1651 #endif 1665 #endif
1652 } 1666 }
OLDNEW
« 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