Skip to content
Snippets Groups Projects
Commit 9fe9d92b authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Start to wire in tracy support

parent 47f40f03
No related branches found
No related tags found
No related merge requests found
......@@ -2229,30 +2229,16 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>name</key>
<string>darwin64</string>
</map>
<key>windows</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>47c696cd2966c5cc3c8ba6115dd1f886</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/86973/801641/tracy-v0.7.8.563351-windows-563351.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
</map>
<key>windows64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>b649ee6591e67d2341e886b3fc3484a7</string>
<string>773e2803356980515b066dd668fad9cee0d7dfe29bc1b29ed690503aed1dde4970300ab21985c6ac70c91318844d0ae088045034627b0cf1dd7efb5b5c1cd6aa</string>
<key>hash_algorithm</key>
<string>md5</string>
<string>blake2b</string>
<key>url</key>
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/86974/801642/tracy-v0.7.8.563351-windows64-563351.tar.bz2</string>
<string>https://git.alchemyviewer.org/api/v4/projects/201/packages/generic/tracy/v0.9.0.1868/tracy-v0.9.0-windows64-1868.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
......@@ -2263,7 +2249,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>source_type</key>
<string>git</string>
<key>version</key>
<string>v0.7.8.563351</string>
<string>v0.9.0</string>
</map>
<key>tut</key>
<map>
......
......@@ -10,7 +10,6 @@ set(LLCOMMON_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llcommon
${APRUTIL_INCLUDE_DIR}
${APR_INCLUDE_DIR}
${TRACY_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
)
set(LLCOMMON_SYSTEM_INCLUDE_DIRS
......
......@@ -4,23 +4,10 @@ include(Prebuilt)
set(USE_TRACY OFF CACHE BOOL "Use Tracy profiler.")
if (USE_TRACY)
set(TRACY_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/tracy)
# use_prebuilt_binary(tracy)
# See: indra/llcommon/llprofiler.h
# See: indra/llcommon/llprofiler.h
add_definitions(-DLL_PROFILER_CONFIGURATION=3)
use_prebuilt_binary(tracy)
if (WINDOWS)
MESSAGE(STATUS "Including Tracy for Windows: '${TRACY_INCLUDE_DIR}'")
endif (WINDOWS)
if (DARWIN)
MESSAGE(STATUS "Including Tracy for Darwin: '${TRACY_INCLUDE_DIR}'")
endif (DARWIN)
if (LINUX)
MESSAGE(STATUS "Including Tracy for Linux: '${TRACY_INCLUDE_DIR}'")
endif (LINUX)
else (USE_TRACY)
# Tracy.cmake should not set LLCOMMON_INCLUDE_DIRS, let LLCommon.cmake do that
set(TRACY_INCLUDE_DIR "")
......
......@@ -33,6 +33,8 @@ FetchContent_Declare(
meshoptimizer
GIT_REPOSITORY https://git.alchemyviewer.org/alchemy/mirrors/meshoptimizer.git
GIT_TAG v0.18
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
# FetchContent_Declare(
# Catch2
......@@ -43,11 +45,15 @@ FetchContent_Declare(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG 9.1.0
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
FetchContent_Declare(
nlohmann_json
GIT_REPOSITORY https://git.alchemyviewer.org/alchemy/mirrors/modernjson.git
GIT_TAG v3.11.2
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
# #Download the rest of the libraries
......@@ -62,5 +68,19 @@ set(JSON_Install OFF CACHE INTERNAL "")
set(JSON_BuildTests OFF CACHE INTERNAL "")
FetchContent_MakeAvailable(nlohmann_json)
if(USE_TRACY)
FetchContent_Declare (
tracy
GIT_REPOSITORY https://github.com/wolfpld/tracy.git
GIT_TAG v0.9
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
set(TRACY_ON_DEMAND ON)
set(TRACY_ONLY_LOCALHOST ON)
set(TRACY_FIBERS ON)
FetchContent_MakeAvailable (tracy)
endif()
unset(CMAKE_FOLDER)
unset(CMAKE_POSITION_INDEPENDENT_CODE)
......@@ -21,7 +21,6 @@ include_directories(
${LLMATH_INCLUDE_DIRS}
${ZLIBNG_INCLUDE_DIRS}
${URIPARSER_INCLUDE_DIRS}
${TRACY_INCLUDE_DIR}
)
# add_executable(lltreeiterators lltreeiterators.cpp)
......@@ -313,7 +312,7 @@ target_link_libraries(
${URIPARSER_LIBRARIES}
nlohmann_json::nlohmann_json
fmt::fmt
${TRACY_LIBRARY}
TracyClient
${DL_LIBRARY}
${RT_LIBRARY}
)
......
......@@ -28,7 +28,7 @@
#define LL_LINDEN_COMMON_H
#include "llprofiler.h"
#if TRACY_ENABLE && !defined(LL_PROFILER_ENABLE_TRACY_OPENGL) // hooks for memory profiling
#if (TRACY_ENABLE) && LL_PROFILER_ENABLE_TRACY_MEMORY
void *tracy_aligned_malloc(size_t size, size_t alignment);
void tracy_aligned_free(void *memblock);
#define _aligned_malloc(X, Y) tracy_aligned_malloc((X), (Y))
......
......@@ -35,7 +35,7 @@
thread_local bool gProfilerEnabled = false;
#if (TRACY_ENABLE)
#if (TRACY_ENABLE) && LL_PROFILER_ENABLE_TRACY_MEMORY
// Override new/delete for tracy memory profiling
void *operator new(size_t size)
{
......
......@@ -29,11 +29,6 @@
#include "llframetimer.h"
// We don't bother building a stand alone lib; we just need to include the one source file for Tracy support
#if LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_TRACY || LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_TRACY_FAST_TIMER
#include "TracyClient.cpp"
#endif // LL_PROFILER_CONFIGURATION
// Static members
//LLTimer LLFrameTimer::sInternalTimer;
U64 LLFrameTimer::sStartTotalTime = totalTime();
......
......@@ -84,22 +84,23 @@ extern thread_local bool gProfilerEnabled;
// #define TRACY_NO_BROADCAST 1
// #define TRACY_ONLY_LOCALHOST 1
#define TRACY_ONLY_IPV4 1
#include "Tracy.hpp"
#include "tracy/Tracy.hpp"
// Mutually exclusive with detailed memory tracing
#define LL_PROFILER_ENABLE_TRACY_MEMORY 0
#define LL_PROFILER_ENABLE_TRACY_OPENGL 0
#endif
#if LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_TRACY
#define LL_PROFILER_FRAME_END FrameMark
#define LL_PROFILER_FRAME_END FrameMark;
#define LL_PROFILER_SET_THREAD_NAME( name ) tracy::SetThreadName( name ); gProfilerEnabled = true;
#define LL_RECORD_BLOCK_TIME(name) ZoneScoped // Want descriptive names; was: ZoneNamedN( ___tracy_scoped_zone, #name, true );
#define LL_RECORD_BLOCK_TIME(name) ZoneNamedN( ___tracy_scoped_zone, #name, true);
#define LL_PROFILE_ZONE_NAMED(name) ZoneNamedN( ___tracy_scoped_zone, name, true );
#define LL_PROFILE_ZONE_NAMED_COLOR(name,color) ZoneNamedNC( ___tracy_scopped_zone, name, color, true ) // RGB
#define LL_PROFILE_ZONE_SCOPED ZoneScoped
#define LL_PROFILE_ZONE_NAMED_COLOR(name,color) ZoneNamedNC( ___tracy_scopped_zone, name, color, true ); // RGB
#define LL_PROFILE_ZONE_SCOPED ZoneScoped;
#define LL_PROFILE_ZONE_NUM( val ) ZoneValue( val )
#define LL_PROFILE_ZONE_TEXT( text, size ) ZoneText( text, size )
#define LL_PROFILE_ZONE_NUM( val ) ZoneValue( val );
#define LL_PROFILE_ZONE_TEXT( text, size ) ZoneText( text, size );
#define LL_PROFILE_ZONE_ERR(name) LL_PROFILE_ZONE_NAMED_COLOR( name, 0XFF0000 ) // RGB yellow
#define LL_PROFILE_ZONE_INFO(name) LL_PROFILE_ZONE_NAMED_COLOR( name, 0X00FFFF ) // RGB cyan
......@@ -125,15 +126,15 @@ extern thread_local bool gProfilerEnabled;
#define LL_PROFILE_FREE(ptr) (void)(ptr);
#endif
#if LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_TRACY_FAST_TIMER
#define LL_PROFILER_FRAME_END FrameMark
#define LL_PROFILER_FRAME_END FrameMark;
#define LL_PROFILER_SET_THREAD_NAME( name ) tracy::SetThreadName( name ); gProfilerEnabled = true;
#define LL_RECORD_BLOCK_TIME(name) ZoneNamedN(___tracy_scoped_zone, #name, true); const LLTrace::BlockTimer& LL_GLUE_TOKENS(block_time_recorder, __LINE__)(LLTrace::timeThisBlock(name)); (void)LL_GLUE_TOKENS(block_time_recorder, __LINE__);
#define LL_PROFILE_ZONE_NAMED(name) ZoneNamedN( ___tracy_scoped_zone, #name, true );
#define LL_PROFILE_ZONE_NAMED_COLOR(name,color) ZoneNamedNC( ___tracy_scopped_zone, name, color, true ) // RGB
#define LL_PROFILE_ZONE_SCOPED ZoneScoped
#define LL_PROFILE_ZONE_NAMED(name) ZoneNamedN( ___tracy_scoped_zone, name, true );
#define LL_PROFILE_ZONE_NAMED_COLOR(name,color) ZoneNamedNC( ___tracy_scopped_zone, name, color, true ); // RGB
#define LL_PROFILE_ZONE_SCOPED ZoneScoped;
#define LL_PROFILE_ZONE_NUM( val ) ZoneValue( val )
#define LL_PROFILE_ZONE_TEXT( text, size ) ZoneText( text, size )
#define LL_PROFILE_ZONE_NUM( val ) ZoneValue( val );
#define LL_PROFILE_ZONE_TEXT( text, size ) ZoneText( text, size );
#define LL_PROFILE_ZONE_ERR(name) LL_PROFILE_ZONE_NAMED_COLOR( name, 0XFF0000 ) // RGB yellow
#define LL_PROFILE_ZONE_INFO(name) LL_PROFILE_ZONE_NAMED_COLOR( name, 0X00FFFF ) // RGB cyan
......
......@@ -48,11 +48,11 @@
#define LL_PROFILER_CATEGORY_ENABLE_DRAWPOOL 1
#define LL_PROFILER_CATEGORY_ENABLE_ENVIRONMENT 1
#define LL_PROFILER_CATEGORY_ENABLE_FACE 1
#define LL_PROFILER_CATEGORY_ENABLE_LLSD 1
#define LL_PROFILER_CATEGORY_ENABLE_LLSD 0
#define LL_PROFILER_CATEGORY_ENABLE_LOGGING 1
#define LL_PROFILER_CATEGORY_ENABLE_MATERIAL 1
#define LL_PROFILER_CATEGORY_ENABLE_MEDIA 1
#define LL_PROFILER_CATEGORY_ENABLE_MEMORY 1
#define LL_PROFILER_CATEGORY_ENABLE_MEMORY 0
#define LL_PROFILER_CATEGORY_ENABLE_NETWORK 1
#define LL_PROFILER_CATEGORY_ENABLE_OCTREE 1
#define LL_PROFILER_CATEGORY_ENABLE_PIPELINE 1
......@@ -61,12 +61,12 @@
#define LL_PROFILER_CATEGORY_ENABLE_STATS 1
#define LL_PROFILER_CATEGORY_ENABLE_STRING 1
#define LL_PROFILER_CATEGORY_ENABLE_TEXTURE 1
#define LL_PROFILER_CATEGORY_ENABLE_THREAD 1
#define LL_PROFILER_CATEGORY_ENABLE_THREAD 0
#define LL_PROFILER_CATEGORY_ENABLE_UI 1
#define LL_PROFILER_CATEGORY_ENABLE_VIEWER 1
#define LL_PROFILER_CATEGORY_ENABLE_VERTEX 1
#define LL_PROFILER_CATEGORY_ENABLE_VOLUME 1
#define LL_PROFILER_CATEGORY_ENABLE_WIN32 1
#define LL_PROFILER_CATEGORY_ENABLE_WIN32 0
#if LL_PROFILER_CATEGORY_ENABLE_APP
#define LL_PROFILE_ZONE_NAMED_CATEGORY_APP LL_PROFILE_ZONE_NAMED
......
......@@ -54,7 +54,7 @@ class HttpThread final : public RefCounted
void run()
{ // THREAD CONTEXT
LL_PROFILER_SET_THREAD_NAME("HTTP Service");
// Take out additional reference for the at_exit handler
addRef();
boost::this_thread::at_thread_exit(boost::bind(&HttpThread::at_exit, this));
......
......@@ -106,7 +106,6 @@ include_directories(
${FREEALUT_INCLUDE_DIRS}
"${LIBS_PREBUILT_DIR}/include/collada/1.4"
${LLAPPEARANCE_INCLUDE_DIRS}
${TRACY_INCLUDE_DIR}
${DISCORD_INCLUDE_DIRS}
)
......@@ -2239,7 +2238,7 @@ target_link_libraries(${VIEWER_BINARY_NAME}
${LLPHYSICS_LIBRARIES}
${LLPHYSICSEXTENSIONS_LIBRARIES}
${LLAPPEARANCE_LIBRARIES}
${TRACY_LIBRARY}
TracyClient
${MINIZIP_LIBRARIES}
${DISCORD_LIBRARIES}
meshoptimizer
......@@ -2336,7 +2335,7 @@ if (DARWIN)
set(MACOSX_BUNDLE_BUNDLE_NAME "Alchemy")
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}")
set(MACOSX_BUNDLE_BUNDLE_VERSION "${VIEWER_SHORT_VERSION}")
set(MACOSX_BUNDLE_COPYRIGHT "Copyright (C) 2013-2021 Alchemy Development Group")
set(MACOSX_BUNDLE_COPYRIGHT "Copyright (C) 2013-2023 Alchemy Development Group")
set(MACOSX_BUNDLE_NSMAIN_NIB_FILE "Alchemy.nib")
set(MACOSX_BUNDLE_NSPRINCIPAL_CLASS "LLApplication")
......
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