summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorsimonjam@chromium.org <simonjam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-18 11:13:28 +0000
committersimonjam@chromium.org <simonjam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-18 11:13:28 +0000
commit5c8f89f69d54d7bafdf1910d620459e0a788c781 (patch)
treed64b6de4563d268f2dc7ebe374243eae417f379c /base
parent31d4df856f3bd49eab7799becf1dec8a91855353 (diff)
downloadchromium_src-5c8f89f69d54d7bafdf1910d620459e0a788c781.zip
chromium_src-5c8f89f69d54d7bafdf1910d620459e0a788c781.tar.gz
chromium_src-5c8f89f69d54d7bafdf1910d620459e0a788c781.tar.bz2
Include CPU information in UMA system profile.
This is particularly useful to help determine which CPUs fail to tick monotonically in HighResNow() on Windows. BUG=254211 Review URL: https://chromiumcodereview.appspot.com/17770005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212323 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/cpu.cc4
-rw-r--r--base/cpu.h2
2 files changed, 5 insertions, 1 deletions
diff --git a/base/cpu.cc b/base/cpu.cc
index 4a94af0..1761529 100644
--- a/base/cpu.cc
+++ b/base/cpu.cc
@@ -19,7 +19,8 @@
namespace base {
CPU::CPU()
- : type_(0),
+ : signature_(0),
+ type_(0),
family_(0),
model_(0),
stepping_(0),
@@ -105,6 +106,7 @@ void CPU::Initialize() {
// Interpret CPU feature information.
if (num_ids > 0) {
__cpuid(cpu_info, 1);
+ signature_ = cpu_info[0];
stepping_ = cpu_info[0] & 0xf;
model_ = ((cpu_info[0] >> 4) & 0xf) + ((cpu_info[0] >> 12) & 0xf0);
family_ = (cpu_info[0] >> 8) & 0xf;
diff --git a/base/cpu.h b/base/cpu.h
index 1d45258..509763e 100644
--- a/base/cpu.h
+++ b/base/cpu.h
@@ -31,6 +31,7 @@ class BASE_EXPORT CPU {
// Accessors for CPU information.
const std::string& vendor_name() const { return cpu_vendor_; }
+ int signature() const { return signature_; }
int stepping() const { return stepping_; }
int model() const { return model_; }
int family() const { return family_; }
@@ -55,6 +56,7 @@ class BASE_EXPORT CPU {
// Query the processor for CPUID information.
void Initialize();
+ int signature_; // raw form of type, family, model, and stepping
int type_; // process type
int family_; // family of the processor
int model_; // model of processor