Skip to content
Snippets Groups Projects
Commit 2d65e629 authored by Bryan O'Sullivan's avatar Bryan O'Sullivan
Browse files

Convert all C++ files to Unix line endings

parent 5a46b592
No related branches found
No related tags found
No related merge requests found
/** /**
* @file llfasttimer.h * @file llfasttimer.h
* @brief Declaration of a fast timer. * @brief Declaration of a fast timer.
* *
* $LicenseInfo:firstyear=2004&license=viewergpl$ * $LicenseInfo:firstyear=2004&license=viewergpl$
* *
* Copyright (c) 2004-2009, Linden Research, Inc. * Copyright (c) 2004-2009, Linden Research, Inc.
* *
* Second Life Viewer Source Code * Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab * The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0 * to you under the terms of the GNU General Public License, version 2.0
...@@ -13,17 +13,17 @@ ...@@ -13,17 +13,17 @@
* ("Other License"), formally executed by you and Linden Lab. Terms of * ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or * the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* *
* There are special exceptions to the terms and conditions of the GPL as * There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception * it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or * in the file doc/FLOSS-exception.txt in this software distribution, or
* online at * online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception * http://secondlifegrid.net/programs/open_source/licensing/flossexception
* *
* By copying, modifying or distributing this software, you acknowledge * By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above, * that you have read and understood your obligations described above,
* and agree to abide by those obligations. * and agree to abide by those obligations.
* *
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE. * COMPLETENESS OR PERFORMANCE.
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
inline U32 get_cpu_clock_count_32() inline U32 get_cpu_clock_count_32()
{ {
U32 ret_val; U32 ret_val;
__asm __asm
{ {
_emit 0x0f _emit 0x0f
_emit 0x31 _emit 0x31
...@@ -85,7 +85,7 @@ inline U32 get_cpu_clock_count_32() ...@@ -85,7 +85,7 @@ inline U32 get_cpu_clock_count_32()
inline U64 get_cpu_clock_count_64() inline U64 get_cpu_clock_count_64()
{ {
U64 ret_val; U64 ret_val;
__asm __asm
{ {
_emit 0x0f _emit 0x0f
_emit 0x31 _emit 0x31
...@@ -99,21 +99,21 @@ inline U64 get_cpu_clock_count_64() ...@@ -99,21 +99,21 @@ inline U64 get_cpu_clock_count_64()
#else #else
#define LL_INLINE #define LL_INLINE
#endif #endif
#if (LL_LINUX || LL_SOLARIS || LL_DARWIN) && (defined(__i386__) || defined(__amd64__)) #if (LL_LINUX || LL_SOLARIS || LL_DARWIN) && (defined(__i386__) || defined(__amd64__))
inline U32 get_cpu_clock_count_32() inline U32 get_cpu_clock_count_32()
{ {
U64 x; U64 x;
__asm__ volatile (".byte 0x0f, 0x31": "=A"(x)); __asm__ volatile (".byte 0x0f, 0x31": "=A"(x));
return (U32)x >> 8; return (U32)x >> 8;
} }
inline U32 get_cpu_clock_count_64() inline U32 get_cpu_clock_count_64()
{ {
U64 x; U64 x;
__asm__ volatile (".byte 0x0f, 0x31": "=A"(x)); __asm__ volatile (".byte 0x0f, 0x31": "=A"(x));
return x >> 8; return x >> 8;
} }
#endif #endif
#if ( LL_DARWIN && !(defined(__i386__) || defined(__amd64__))) || (LL_SOLARIS && defined(__sparc__)) #if ( LL_DARWIN && !(defined(__i386__) || defined(__amd64__))) || (LL_SOLARIS && defined(__sparc__))
...@@ -128,7 +128,7 @@ inline U32 get_cpu_clock_count_32() ...@@ -128,7 +128,7 @@ inline U32 get_cpu_clock_count_32()
} }
inline U32 get_cpu_clock_count_64() inline U32 get_cpu_clock_count_64()
{ {
return get_clock_count(); return get_clock_count();
} }
#endif #endif
...@@ -158,7 +158,7 @@ class LL_COMMON_API LLFastTimer ...@@ -158,7 +158,7 @@ class LL_COMMON_API LLFastTimer
}; };
// stores a "named" timer instance to be reused via multiple LLFastTimer stack instances // stores a "named" timer instance to be reused via multiple LLFastTimer stack instances
class LL_COMMON_API NamedTimer class LL_COMMON_API NamedTimer
: public LLInstanceTracker<NamedTimer> : public LLInstanceTracker<NamedTimer>
{ {
friend class DeclareTimer; friend class DeclareTimer;
...@@ -193,7 +193,7 @@ class LL_COMMON_API LLFastTimer ...@@ -193,7 +193,7 @@ class LL_COMMON_API LLFastTimer
FrameState& getFrameState() const; FrameState& getFrameState() const;
private: private:
friend class LLFastTimer; friend class LLFastTimer;
friend class NamedTimerFactory; friend class NamedTimerFactory;
...@@ -204,14 +204,14 @@ class LL_COMMON_API LLFastTimer ...@@ -204,14 +204,14 @@ class LL_COMMON_API LLFastTimer
// recursive call to gather total time from children // recursive call to gather total time from children
static void accumulateTimings(); static void accumulateTimings();
// updates cumulative times and hierarchy, // updates cumulative times and hierarchy,
// can be called multiple times in a frame, at any point // can be called multiple times in a frame, at any point
static void processTimes(); static void processTimes();
static void buildHierarchy(); static void buildHierarchy();
static void resetFrame(); static void resetFrame();
static void reset(); static void reset();
// //
// members // members
// //
...@@ -247,7 +247,7 @@ class LL_COMMON_API LLFastTimer ...@@ -247,7 +247,7 @@ class LL_COMMON_API LLFastTimer
private: private:
NamedTimer& mTimer; NamedTimer& mTimer;
FrameState* mFrameState; FrameState* mFrameState;
}; };
public: public:
...@@ -267,7 +267,7 @@ class LL_COMMON_API LLFastTimer ...@@ -267,7 +267,7 @@ class LL_COMMON_API LLFastTimer
frame_state->mCalls++; frame_state->mCalls++;
// keep current parent as long as it is active when we are // keep current parent as long as it is active when we are
frame_state->mMoveUpTree |= (frame_state->mParent->mActiveCount == 0); frame_state->mMoveUpTree |= (frame_state->mParent->mActiveCount == 0);
LLFastTimer::CurTimerData* cur_timer_data = &LLFastTimer::sCurTimerData; LLFastTimer::CurTimerData* cur_timer_data = &LLFastTimer::sCurTimerData;
mLastTimerData = *cur_timer_data; mLastTimerData = *cur_timer_data;
cur_timer_data->mCurTimer = this; cur_timer_data->mCurTimer = this;
...@@ -305,7 +305,7 @@ class LL_COMMON_API LLFastTimer ...@@ -305,7 +305,7 @@ class LL_COMMON_API LLFastTimer
U64 timer_end = get_cpu_clock_count_64(); U64 timer_end = get_cpu_clock_count_64();
sTimerCycles += timer_end - timer_start; sTimerCycles += timer_end - timer_start;
sTimerCalls++; sTimerCalls++;
#endif #endif
} }
public: public:
...@@ -321,13 +321,13 @@ class LL_COMMON_API LLFastTimer ...@@ -321,13 +321,13 @@ class LL_COMMON_API LLFastTimer
typedef std::vector<FrameState> info_list_t; typedef std::vector<FrameState> info_list_t;
static info_list_t& getFrameStateList(); static info_list_t& getFrameStateList();
// call this once a frame to reset timers // call this once a frame to reset timers
static void nextFrame(); static void nextFrame();
// dumps current cumulative frame stats to log // dumps current cumulative frame stats to log
// call nextFrame() to reset timers // call nextFrame() to reset timers
static void dumpCurTimes(); static void dumpCurTimes();
// call this to reset timer hierarchy, averages, etc. // call this to reset timer hierarchy, averages, etc.
static void reset(); static void reset();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment