diff options
| author | Richard Linden <none@none> | 2012-11-19 19:06:36 -0800 |
|---|---|---|
| committer | Richard Linden <none@none> | 2012-11-19 19:06:36 -0800 |
| commit | c0224cc47a2994956f20e8f65177b60cc709e434 (patch) | |
| tree | 01d305fff69ca9cec713631d04aa76a4a33c79ca /indra/llcommon/lltrace.cpp | |
| parent | 2d1a903d39a971775436ba4e1dfb7f630226c15c (diff) | |
| parent | 6db6cb39f41e921e75970d1570a74cf35d353a35 (diff) | |
merge with viewer-development
Diffstat (limited to 'indra/llcommon/lltrace.cpp')
| -rw-r--r-- | indra/llcommon/lltrace.cpp | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/indra/llcommon/lltrace.cpp b/indra/llcommon/lltrace.cpp new file mode 100644 index 0000000000..e11e39a1a2 --- /dev/null +++ b/indra/llcommon/lltrace.cpp @@ -0,0 +1,70 @@ +/** + * @file lltrace.cpp + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include "lltrace.h" +#include "lltracerecording.h" +#include "lltracethreadrecorder.h" +#include "llfasttimer.h" + +static bool sInitialized; + +namespace LLTrace +{ + +static MasterThreadRecorder* gMasterThreadRecorder = NULL; + +void init() +{ + gMasterThreadRecorder = new MasterThreadRecorder(); + sInitialized = true; +} + +bool isInitialized() +{ + return sInitialized; +} + +void cleanup() +{ + delete gMasterThreadRecorder; + gMasterThreadRecorder = NULL; +} + +MasterThreadRecorder& getMasterThreadRecorder() +{ + llassert(gMasterThreadRecorder != NULL); + return *gMasterThreadRecorder; +} + +LLThreadLocalPointer<ThreadRecorder>& get_thread_recorder() +{ + static LLThreadLocalPointer<ThreadRecorder> s_thread_recorder; + return s_thread_recorder; +} + +} + |
