summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
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);
}
}