diff options
-rw-r--r-- | autobuild.xml | 16 | ||||
-rw-r--r-- | indra/cmake/Tracy.cmake | 16 | ||||
-rw-r--r-- | indra/llcommon/CMakeLists.txt | 4 | ||||
-rw-r--r-- | indra/llcommon/llprofiler.cpp | 30 | ||||
-rw-r--r-- | indra/llcommon/llprofiler.h | 6 | ||||
-rw-r--r-- | indra/newview/CMakeLists.txt | 6 | ||||
-rwxr-xr-x | indra/newview/viewer_manifest.py | 5 |
7 files changed, 67 insertions, 16 deletions
diff --git a/autobuild.xml b/autobuild.xml index b90d94865a..c39a4cd9de 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -2371,11 +2371,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> <key>archive</key> <map> <key>hash</key> - <string>a901a14066daf8c8796c8d2914917129427fd80b</string> + <string>226225ec049826c35adc5e897e0398ed64d4bedb</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/3p-tracy/releases/download/v0.10.0%2Br1/tracy-v0.10.0.9845715133-darwin64-9845715133.tar.zst</string> + <string>https://github.com/secondlife/3p-tracy/releases/download/v0.11.0%2Br1/tracy-v0.11.0.10376230034-darwin64-10376230034.tar.zst</string> </map> <key>name</key> <string>darwin64</string> @@ -2385,11 +2385,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> <key>archive</key> <map> <key>hash</key> - <string>ca5fc66e3431278f20286261ffe85192bbd9a2ca</string> + <string>8c5429d1a1486f40cf7e5e88a232222d1fa4f78e</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/3p-tracy/releases/download/v0.10.0%2Br1/tracy-v0.10.0.9845715133-windows64-9845715133.tar.zst</string> + <string>https://github.com/secondlife/3p-tracy/releases/download/v0.11.0%2Br1/tracy-v0.11.0.10376230034-windows64-10376230034.tar.zst</string> </map> <key>name</key> <string>windows64</string> @@ -2399,11 +2399,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> <key>archive</key> <map> <key>hash</key> - <string>e6f53d513c238ad599b75a8b5f94b8b0d1315438</string> + <string>ed0664a009aba1dcf1246d845839f524e857162e</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/3p-tracy/releases/download/v0.10.0%2Br1/tracy-v0.10.0.9845715133-linux64-9845715133.tar.zst</string> + <string>https://github.com/secondlife/3p-tracy/releases/download/v0.11.0%2Br1/tracy-v0.11.0.10376230034-linux64-10376230034.tar.zst</string> </map> <key>name</key> <string>linux64</string> @@ -2414,9 +2414,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> <key>license_file</key> <string>LICENSES/tracy_license.txt</string> <key>copyright</key> - <string>Copyright (c) 2017-2022, Bartosz Taudul (wolf@nereid.pl)</string> + <string>Copyright (c) 2017-2024, Bartosz Taudul (wolf@nereid.pl)</string> <key>version</key> - <string>v0.10.0.9845715133</string> + <string>v0.11.0.10376230034</string> <key>name</key> <string>tracy</string> <key>canonical_repo</key> diff --git a/indra/cmake/Tracy.cmake b/indra/cmake/Tracy.cmake index 32c02edb93..bd3c13b06a 100644 --- a/indra/cmake/Tracy.cmake +++ b/indra/cmake/Tracy.cmake @@ -4,14 +4,26 @@ include(Prebuilt) include_guard() add_library( ll::tracy INTERFACE IMPORTED ) -set(USE_TRACY OFF CACHE BOOL "Use Tracy profiler.") +option(USE_TRACY "Use Tracy profiler." OFF) if (USE_TRACY) + option(USE_TRACY_ON_DEMAND "Use Tracy profiler." ON) + option(USE_TRACY_LOCAL_ONLY "Use Tracy profiler." OFF) + use_system_binary(tracy) use_prebuilt_binary(tracy) target_include_directories( ll::tracy SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/tracy) - target_link_libraries( ll::tracy INTERFACE TracyClient ) + + target_compile_definitions(ll::tracy INTERFACE -DTRACY_ENABLE=1 -DTRACY_ONLY_IPV4=1) + + if (USE_TRACY_ON_DEMAND) + target_compile_definitions(ll::tracy INTERFACE -DTRACY_ON_DEMAND=1) + endif () + + if (USE_TRACY_LOCAL_ONLY) + target_compile_definitions(ll::tracy INTERFACE -DTRACY_NO_BROADCAST=1 -DTRACY_ONLY_LOCALHOST=1) + endif () # See: indra/llcommon/llprofiler.h add_compile_definitions(LL_PROFILER_CONFIGURATION=3) diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 8e43627a5f..165bfd52d5 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -267,6 +267,10 @@ if (DARWIN) list(APPEND llcommon_SOURCE_FILES llsys_objc.mm) endif (DARWIN) +if (USE_TRACY) + list(APPEND llcommon_SOURCE_FILES llprofiler.cpp) +endif () + list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES}) add_library (llcommon ${llcommon_SOURCE_FILES}) diff --git a/indra/llcommon/llprofiler.cpp b/indra/llcommon/llprofiler.cpp new file mode 100644 index 0000000000..bdddabf977 --- /dev/null +++ b/indra/llcommon/llprofiler.cpp @@ -0,0 +1,30 @@ +/** +* @file llprofiler.cpp +* @brief Implementation of llprofiler +* @author Rye Cogtail +* +* $LicenseInfo:firstyear=2024&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2024, 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 "TracyClient.cpp" diff --git a/indra/llcommon/llprofiler.h b/indra/llcommon/llprofiler.h index 732436cc4f..b7d0522336 100644 --- a/indra/llcommon/llprofiler.h +++ b/indra/llcommon/llprofiler.h @@ -78,12 +78,6 @@ extern thread_local bool gProfilerEnabled; #if defined(LL_PROFILER_CONFIGURATION) && (LL_PROFILER_CONFIGURATION > LL_PROFILER_CONFIG_NONE) #if LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_TRACY || LL_PROFILER_CONFIGURATION == LL_PROFILER_CONFIG_TRACY_FAST_TIMER - #define TRACY_ENABLE 1 -// Normally these would be enabled but we want to be able to build any viewer with Tracy enabled and run the Tracy server on another machine -// They must be undefined in order to work across multiple machines -// #define TRACY_NO_BROADCAST 1 -// #define TRACY_ONLY_LOCALHOST 1 - #define TRACY_ONLY_IPV4 1 #include "tracy/Tracy.hpp" // Enable OpenGL profiling diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index fbaf4e559f..7a9f3a46b5 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1776,6 +1776,7 @@ if (WINDOWS) --artwork=${ARTWORK_DIR} "--bugsplat=${BUGSPLAT_DB}" "--openal=${USE_OPENAL}" + "--tracy=${USE_TRACY}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=$<CONFIG> "--channel=${VIEWER_CHANNEL}" @@ -1836,6 +1837,7 @@ if (WINDOWS) --artwork=${ARTWORK_DIR} "--bugsplat=${BUGSPLAT_DB}" "--openal=${USE_OPENAL}" + "--tracy=${USE_TRACY}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=$<CONFIG> "--channel=${VIEWER_CHANNEL}" @@ -1985,6 +1987,7 @@ if (LINUX) --artwork=${ARTWORK_DIR} "--bugsplat=${BUGSPLAT_DB}" "--openal=${USE_OPENAL}" + "--tracy=${USE_TRACY}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} "--channel=${VIEWER_CHANNEL}" @@ -2012,6 +2015,7 @@ if (LINUX) --artwork=${ARTWORK_DIR} "--bugsplat=${BUGSPLAT_DB}" "--openal=${USE_OPENAL}" + "--tracy=${USE_TRACY}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=${CMAKE_BUILD_TYPE} "--channel=${VIEWER_CHANNEL}" @@ -2087,6 +2091,7 @@ if (DARWIN) --artwork=${ARTWORK_DIR} "--bugsplat=${BUGSPLAT_DB}" "--openal=${USE_OPENAL}" + "--tracy=${USE_TRACY}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=$<CONFIG> --bundleid=${MACOSX_BUNDLE_GUI_IDENTIFIER} @@ -2121,6 +2126,7 @@ if (DARWIN) --artwork=${ARTWORK_DIR} "--bugsplat=${BUGSPLAT_DB}" "--openal=${USE_OPENAL}" + "--tracy=${USE_TRACY}" --build=${CMAKE_CURRENT_BINARY_DIR} --buildtype=$<CONFIG> "--channel=${VIEWER_CHANNEL}" diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 91a9347449..b2f9654eb3 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -586,6 +586,10 @@ class Windows_x86_64_Manifest(ViewerManifest): self.path("BugSplat64.dll") self.path("BugSplatRc64.dll") + if self.args['tracy'] == 'ON': + with self.prefix(src=os.path.join(pkgdir, 'bin')): + self.path("tracy-profiler.exe") + self.path(src="licenses-win32.txt", dst="licenses.txt") self.path("featuretable.txt") self.path("cube.dae") @@ -1372,6 +1376,7 @@ if __name__ == "__main__": dict(name='bugsplat', description="""BugSplat database to which to post crashes, if BugSplat crash reporting is desired""", default=''), dict(name='openal', description="""Indication openal libraries are needed""", default='OFF'), + dict(name='tracy', description="""Indication tracy profiler is enabled""", default='OFF'), ] try: main(extra=extra_arguments) |