summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorpalange@pdp47.lindenlab.com <palange@pdp47.lindenlab.com>2010-06-02 15:24:59 -0700
committerpalange@pdp47.lindenlab.com <palange@pdp47.lindenlab.com>2010-06-02 15:24:59 -0700
commit71f39136795609700a6eb46aad7b0f1397a860d0 (patch)
tree678315ab934a55b7d432bc22af7b68088d3ae88b /indra/llcommon
parent8b9a0a9576ba4002208f56373443701944027c0c (diff)
EXT-3780 FIX Fixed CPU MHz to be MHz on all platforms.
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llprocessor.cpp8
-rw-r--r--indra/llcommon/llsys.cpp2
-rw-r--r--indra/llcommon/tests/llprocessor_test.cpp2
3 files changed, 6 insertions, 6 deletions
diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp
index 44a8c8d059..98c9eabcd6 100644
--- a/indra/llcommon/llprocessor.cpp
+++ b/indra/llcommon/llprocessor.cpp
@@ -289,7 +289,7 @@ public:
out << "// CPU General Information" << std::endl;
out << "//////////////////////////" << std::endl;
out << "Processor Name: " << getCPUBrandName() << std::endl;
- out << "Frequency: " << getCPUFrequency() / (F64)1000000 << " MHz" << std::endl;
+ out << "Frequency: " << getCPUFrequency() << " MHz" << std::endl;
out << "Vendor: " << getInfo(eVendor, "Unknown").asString() << std::endl;
out << "Family: " << getCPUFamilyName() << " (" << getInfo(eFamily, 0) << ")" << std::endl;
out << "Extended family: " << getInfo(eExtendedFamily, 0) << std::endl;
@@ -460,8 +460,8 @@ static F64 calculate_cpu_frequency(U32 measure_msecs)
F64 frequency = (F64)dif / (((F64)timedif) / freq);
// At last we just return the frequency that is also stored in the call
- // member var uqwFrequency
- return frequency;
+ // member var uqwFrequency - converted to MHz
+ return frequency / (F64)1000000;
}
// Windows implementation
@@ -596,7 +596,7 @@ public:
{
getCPUIDInfo();
uint64_t frequency = getSysctlInt64("hw.cpufrequency");
- setInfo(eFrequency, (F64)frequency);
+ setInfo(eFrequency, (F64)frequency / (F64)1000000);
}
virtual ~LLProcessorInfoDarwinImpl() {}
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index 86f2736d5a..d41d0c8a3f 100644
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -517,7 +517,7 @@ LLCPUInfo::LLCPUInfo()
mHasSSE = proc.hasSSE();
mHasSSE2 = proc.hasSSE2();
mHasAltivec = proc.hasAltivec();
- mCPUMHz = (F64)(proc.getCPUFrequency()/1000000.0);
+ mCPUMHz = (F64)proc.getCPUFrequency();
mFamily = proc.getCPUFamilyName();
mCPUString = "Unknown";
diff --git a/indra/llcommon/tests/llprocessor_test.cpp b/indra/llcommon/tests/llprocessor_test.cpp
index 83b235cae5..a9e312b70b 100644
--- a/indra/llcommon/tests/llprocessor_test.cpp
+++ b/indra/llcommon/tests/llprocessor_test.cpp
@@ -62,6 +62,6 @@ namespace tut
ensure_not_equals("Unknown Brand name", brand, "Unknown");
ensure_not_equals("Unknown Family name", family, "Unknown");
- ensure_not_equals("Undetected Frequency", freq, LLSD(0).asReal());
+ ensure("Reasonable CPU Frequency > 100 && < 10000", freq > 100 && freq < 10000);
}
}