summaryrefslogtreecommitdiff
path: root/indra/llcommon/llprocessor.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-04-19 12:49:15 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-04-19 12:49:15 +0100
commit7462911bddd9b5e4033d7108ffc1b6716068f489 (patch)
tree67292df525379194c71a3fa0822430e9d6aaa0a3 /indra/llcommon/llprocessor.cpp
parent3f10caafc07b0d1a60d2b943684e87dec265f5bc (diff)
Change Linux fasttimer implementation back to RDTSC - using a reliable syscall was REALLY chewing CPU time. Sigh. I didn't realize how incredibly often this gets called. So, back to the assembly.
But be more careful with CPU clock count on linux, so the fasttimer values are much more accurate than they were the last time we were with RDTSC, in absolute terms - back in the right order of magnitude anyway. Also change many instances of Mhz to MHz. Also some minor comment fixes.
Diffstat (limited to 'indra/llcommon/llprocessor.cpp')
-rw-r--r--indra/llcommon/llprocessor.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp
index 8a4a4a8f9a..f6ab55a6b5 100644
--- a/indra/llcommon/llprocessor.cpp
+++ b/indra/llcommon/llprocessor.cpp
@@ -60,6 +60,10 @@
# include <windows.h>
#endif
+#if LL_LINUX
+#include "llsys.h"
+#endif // LL_LINUX
+
#if !LL_DARWIN && !LL_SOLARIS
#ifdef PROCESSOR_FREQUENCY_MEASURE_AVAILABLE
@@ -116,6 +120,11 @@ CProcessor::CProcessor()
////////////////////////////////////////////////////////////////////////////
F64 CProcessor::GetCPUFrequency(unsigned int uiMeasureMSecs)
{
+#if LL_LINUX
+ // use the shinier LLCPUInfo interface
+ return 1000000.0F * gSysCPU.getMHz();
+#endif
+
#ifndef PROCESSOR_FREQUENCY_MEASURE_AVAILABLE
return 0;
#else
@@ -781,7 +790,7 @@ bool CProcessor::AnalyzeAMDProcessor()
case 5: // Family = 5: K5 / K6 processor family
switch (CPUInfo.uiModel)
{
- case 0: // Model = 0: K5 SSA 5 (Pentium Rating *ggg* 75, 90 and 100 Mhz)
+ case 0: // Model = 0: K5 SSA 5 (Pentium Rating *ggg* 75, 90 and 100 MHz)
strcpy(CPUInfo.strModel, "AMD K5 SSA5 (PR75, PR90, PR100)"); /* Flawfinder: ignore */
strncat(strCPUName, "AMD K5 SSA5 (PR75, PR90, PR100)", sizeof(strCPUName) - strlen(strCPUName) -1); /* Flawfinder: ignore */
break;