summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2010-12-29 10:03:33 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2010-12-29 10:03:33 -0500
commit28b628ab7b92243a6e40fcdf87f4e2c5b44150e7 (patch)
tree1e15e9602d8dcfc5766587114d822623a14d6a29
parent261ac32dda439fa1fc5708c78168967bf4d484e6 (diff)
allow run-time query of which timer function is being used
-rwxr-xr-x[-rw-r--r--]indra/llcommon/llfasttimer_class.cpp26
-rwxr-xr-xindra/llcommon/llfasttimer_class.h3
-rw-r--r--indra/newview/llappviewer.cpp2
3 files changed, 14 insertions, 17 deletions
diff --git a/indra/llcommon/llfasttimer_class.cpp b/indra/llcommon/llfasttimer_class.cpp
index 0828635881..bd594b06cf 100644..100755
--- a/indra/llcommon/llfasttimer_class.cpp
+++ b/indra/llcommon/llfasttimer_class.cpp
@@ -860,6 +860,9 @@ U64 LLFastTimer::getCPUClockCount64()
}
return ret_val;
}
+
+std::string LLFastTimer::sClockType = "rdtsc";
+
#else
//LL_COMMON_API U64 get_clock_count(); // in lltimer.cpp
// These use QueryPerformanceCounter, which is arguably fine and also works on amd architectures.
@@ -872,6 +875,8 @@ U64 LLFastTimer::getCPUClockCount64()
{
return get_clock_count();
}
+
+std::string LLFastTimer::sClockType = "QueryPerformanceCounter";
#endif
#endif
@@ -904,6 +909,9 @@ U32 LLFastTimer::getCPUClockCount32()
{
return (U32)(LLFastTimer::getCPUClockCount64() >> 8);
}
+
+std::string LLFastTimer::sClockType = "clock_gettime";
+
#endif // (LL_LINUX || LL_SOLARIS) && !(defined(__i386__) || defined(__amd64__))
@@ -923,23 +931,7 @@ U64 LLFastTimer::getCPUClockCount64()
__asm__ volatile (".byte 0x0f, 0x31": "=A"(x));
return x;
}
-#endif
-
-
-#if ( LL_DARWIN && !(defined(__i386__) || defined(__amd64__)))
-//
-// Mac PPC (deprecated) implementation of CPU clock
-//
-// Just use gettimeofday implementation for now
-U32 LLFastTimer::getCPUClockCount32()
-{
- return (U32)(get_clock_count()>>8);
-}
-
-U64 LLFastTimer::getCPUClockCount64()
-{
- return get_clock_count();
-}
+std::string LLFastTimer::sClockType = "rdtsc";
#endif
diff --git a/indra/llcommon/llfasttimer_class.h b/indra/llcommon/llfasttimer_class.h
index 038a2d246a..827747f0c6 100755
--- a/indra/llcommon/llfasttimer_class.h
+++ b/indra/llcommon/llfasttimer_class.h
@@ -180,8 +180,10 @@ public:
sTimerCycles += timer_end - timer_start;
#endif
#if DEBUG_FAST_TIMER_THREADS
+#if !LL_RELEASE
assert_main_thread();
#endif
+#endif
}
LL_FORCE_INLINE ~LLFastTimer()
@@ -251,6 +253,7 @@ public:
U32 mChildTime;
};
static CurTimerData sCurTimerData;
+ static std::string sClockType;
private:
static U32 getCPUClockCount32();
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index ea2348ea25..872f59a75d 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2741,6 +2741,8 @@ void LLAppViewer::writeSystemInfo()
LL_INFOS("SystemInfo") << "OS: " << getOSInfo().getOSStringSimple() << LL_ENDL;
LL_INFOS("SystemInfo") << "OS info: " << getOSInfo() << LL_ENDL;
+ LL_INFOS("SystemInfo") << "Timers: " << LLFastTimer::sClockType << LL_ENDL;
+
writeDebugInfo(); // Save out debug_info.log early, in case of crash.
}