Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesfAnet committed Feb 29, 2024
2 parents c6d4e83 + ea0471f commit a6c7beb
Show file tree
Hide file tree
Showing 107 changed files with 12,487 additions and 5,146 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/latex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Fix stupidity
run: |
cp AUTHORS AUTHORS.
cp LICENSE LICENSE.
- name: Compile LaTeX
uses: xu-cheng/latex-action@v2
uses: xu-cheng/latex-action@v3
with:
working_directory: manual
root_file: tracy.tex
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: manual
path: manual/tracy.pdf
41 changes: 41 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: linux

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-22.04
container: archlinux:base-devel
steps:
- uses: actions/checkout@v4
- name: Install linux libraries
run: pacman -Syu --noconfirm && pacman -S --noconfirm --needed freetype2 capstone tbb debuginfod wayland dbus libxkbcommon libglvnd meson
- name: Profiler GUI
run: make -j`nproc` -C profiler/build/unix debug release
- name: Update utility
run: make -j`nproc` -C update/build/unix debug release
- name: Capture utility
run: make -j`nproc` -C capture/build/unix debug release
- name: Csvexport utility
run: make -j`nproc` -C csvexport/build/unix debug release
- name: Import-chrome utility
run: make -j`nproc` -C import-chrome/build/unix debug release
- name: Import-fuchsia utility
run: make -j`nproc` -C import-fuchsia/build/unix debug release
- name: Library
run: make -j`nproc` -C library/unix debug release
- name: Library (meson)
run: meson setup -Dprefix=$PWD/install build && meson compile -C build && meson install -C build
- name: Test application
run: |
make -j`nproc` -C test
make -j`nproc` -C test clean
make -j`nproc` -C test TRACYFLAGS=-DTRACY_ON_DEMAND
make -j`nproc` -C test clean
make -j`nproc` -C test TRACYFLAGS="-DTRACY_DELAYED_INIT -DTRACY_MANUAL_LIFETIME"
make -C test -B ../public/TracyClient.o DEFINES='-DTRACY_DEMANGLE'
22 changes: 9 additions & 13 deletions .github/workflows/gcc.yml → .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: gcc
name: macos

on:
push:
Expand All @@ -9,20 +9,11 @@ on:
jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macOS-latest]

runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- name: Install linux libraries
if: ${{ matrix.os == 'ubuntu-22.04' }}
run: sudo apt-get update && sudo apt-get -y install libdbus-1-dev libcapstone-dev libtbb-dev libdebuginfod-dev libxkbcommon-dev libegl-dev libwayland-dev
- uses: actions/checkout@v4
- name: Install macos libraries
if: ${{ matrix.os == 'macOS-latest' }}
run: brew install capstone tbb pkg-config glfw
run: brew install capstone tbb pkg-config glfw meson
- name: Profiler GUI
run: make -j`nproc` -C profiler/build/unix debug release
- name: Update utility
Expand All @@ -33,12 +24,17 @@ jobs:
run: make -j`nproc` -C csvexport/build/unix debug release
- name: Import-chrome utility
run: make -j`nproc` -C import-chrome/build/unix debug release
- name: Import-fuchsia utility
run: make -j`nproc` -C import-fuchsia/build/unix debug release
- name: Library
run: make -j`nproc` -C library/unix debug release
- name: Library (meson)
run: meson setup -Dprefix=$PWD/install build && meson compile -C build && meson install -C build
- name: Test application
run: |
make -j`nproc` -C test
make -j`nproc` -C test clean
make -j`nproc` -C test TRACYFLAGS=-DTRACY_ON_DEMAND
make -j`nproc` -C test clean
make -j`nproc` -C test TRACYFLAGS="-DTRACY_DELAYED_INIT -DTRACY_MANUAL_LIFETIME"
make -C test -B ../public/TracyClient.o DEFINES='-DTRACY_DEMANGLE'
14 changes: 9 additions & 5 deletions .github/workflows/msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
runs-on: windows-2022

steps:
- uses: actions/checkout@v2
- uses: microsoft/setup-msbuild@v1.0.2
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v2
- name: Integrate vcpkg
run: vcpkg integrate install
- name: Profiler GUI Debug
Expand All @@ -36,6 +36,10 @@ jobs:
run: msbuild .\import-chrome\build\win32\import-chrome.vcxproj /property:Configuration=Debug /property:Platform=x64
- name: Import-chrome utility Release
run: msbuild .\import-chrome\build\win32\import-chrome.vcxproj /property:Configuration=Release /property:Platform=x64
- name: Import-fuchsia utility Debug
run: msbuild .\import-fuchsia\build\win32\import-fuchsia.vcxproj /property:Configuration=Debug /property:Platform=x64
- name: Import-fuchsia utility Release
run: msbuild .\import-fuchsia\build\win32\import-fuchsia.vcxproj /property:Configuration=Release /property:Platform=x64
- name: Library
run: msbuild .\library\win32\TracyProfiler.vcxproj /property:Configuration=Release /property:Platform=x64
- name: Package binaries
Expand All @@ -50,7 +54,7 @@ jobs:
copy library\win32\x64\Release\TracyProfiler.dll bin\dev
copy library\win32\x64\Release\TracyProfiler.lib bin\dev
7z a Tracy.7z bin
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
path: Tracy.7z

Expand All @@ -62,8 +66,8 @@ jobs:
VCPKG_ROOT: ''

steps:
- uses: actions/checkout@v2
- uses: microsoft/setup-msbuild@v1.0.2
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v2
- name: Install vcpkg dependencies
run: vcpkg/install_vcpkg_dependencies.bat
- name: Profiler GUI Release
Expand Down
24 changes: 19 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
cmake_minimum_required(VERSION 3.10)

project(Tracy LANGUAGES CXX)
# Run version helper script
include(version.cmake)

set(TRACY_VERSION_MAJOR ${major})
set(TRACY_VERSION_MINOR ${minor})
set(TRACY_VERSION_PATCH ${patch})
set(TRACY_VERSION_STRING "${TRACY_VERSION_MAJOR}.${TRACY_VERSION_MINOR}.${TRACY_VERSION_PATCH}")

project(Tracy LANGUAGES CXX VERSION ${TRACY_VERSION_STRING})

if(${BUILD_SHARED_LIBS})
set(DEFAULT_STATIC OFF)
Expand Down Expand Up @@ -56,7 +64,7 @@ endmacro()

set_option(TRACY_ENABLE "Enable profiling" ON)
set_option(TRACY_ON_DEMAND "On-demand profiling" OFF)
set_option(TRACY_CALLSTACK "Enfore callstack collection for tracy regions" OFF)
set_option(TRACY_CALLSTACK "Enforce callstack collection for tracy regions" OFF)
set_option(TRACY_NO_CALLSTACK "Disable all callstack related functionality" OFF)
set_option(TRACY_NO_CALLSTACK_INLINES "Disables the inline functions in callstacks" OFF)
set_option(TRACY_ONLY_LOCALHOST "Only listen on the localhost interface" OFF)
Expand All @@ -70,11 +78,15 @@ set_option(TRACY_NO_VERIFY "Disable zone validation for C API" OFF)
set_option(TRACY_NO_VSYNC_CAPTURE "Disable capture of hardware Vsync events" OFF)
set_option(TRACY_NO_FRAME_IMAGE "Disable the frame image support and its thread" OFF)
set_option(TRACY_NO_SYSTEM_TRACING "Disable systrace sampling" OFF)
set_option(TRACY_PATCHABLE_NOPSLEDS "Enable nopsleds for efficient patching by system-level tools (e.g. rr)" OFF)
set_option(TRACY_DELAYED_INIT "Enable delayed initialization of the library (init on first call)" OFF)
set_option(TRACY_MANUAL_LIFETIME "Enable the manual lifetime management of the profile" OFF)
set_option(TRACY_FIBERS "Enable fibers support" OFF)
set_option(TRACY_NO_CRASH_HANDLER "Disable crash handling" OFF)
set_option(TRACY_TIMER_FALLBACK "Use lower resolution timers" OFF)
set_option(TRACY_LIBUNWIND_BACKTRACE "Use libunwind backtracing where supported" OFF)
set_option(TRACY_SYMBOL_OFFLINE_RESOLVE "Instead of full runtime symbol resolution, only resolve the image path and offset to enable offline symbol resolution" OFF)
set_option(TRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT "Enable libbacktrace to support dynamically loaded elfs in symbol resolution resolution after the first symbol resolve operation" OFF)

if(NOT TRACY_STATIC)
target_compile_definitions(TracyClient PRIVATE TRACY_EXPORTS)
Expand All @@ -84,6 +96,8 @@ endif()
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)

set_target_properties(TracyClient PROPERTIES VERSION ${PROJECT_VERSION})

set(tracy_includes
${TRACY_PUBLIC_DIR}/tracy/TracyC.h
${TRACY_PUBLIC_DIR}/tracy/Tracy.hpp
Expand Down Expand Up @@ -146,10 +160,10 @@ install(FILES ${common_includes}
install(EXPORT TracyConfig
NAMESPACE Tracy::
FILE TracyTargets.cmake
DESTINATION share/Tracy)
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Tracy)
include(CMakePackageConfigHelpers)
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/TracyConfig.cmake"
INSTALL_DESTINATION share/Tracy)
INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Tracy)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/TracyConfig.cmake
DESTINATION share/Tracy)
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Tracy)
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Tracy Profiler (https://github.com/wolfpld/tracy) is licensed under the
3-clause BSD license.

Copyright (c) 2017-2023, Bartosz Taudul <[email protected]>
Copyright (c) 2017-2024, Bartosz Taudul <[email protected]>
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
97 changes: 94 additions & 3 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,90 @@ Note: There is no guarantee that version mismatched client and server will
be able to talk with each other. Network protocol breakages won't be listed
here.

v0.x.x (xxxx-xx-xx)
-------------------
vx.xx.x (xxxx-xx-xx)
--------------------

- Support for pre-0.9 traces has been dropped.
- Various Meson fixes.
- Proper way of loading Vulkan calibrated timestamps extension.
- Fixed C API support for GPU tracing when on demand mode is enabled.
- Added a way to resynchronize CPU and GPU timestamps.
- Using calibrated contexts should always be preferred.
- Each synchronization event requires a sync of CPU and GPU, which is
something you always want to avoid.
- This is not exposed as an easy-to-use API available through the GPU
wrappers.
- Added TracyIsStarted macro to check if the profiler has been started.
Using this functionality only makes sense in the manual lifetime mode,
and will always return true in any other mode of operation.
- Added basic QNX support.
- Zmmword is now recognized as an assemble size directive.
- Libunwind can be used for call stack capture on Linux if you build with
the TRACY_LIBUNWIND_BACKTRACE define.
- Preloading symbols for all modules on Windows, which is always performed
on program init, and which can be quite slow, may now be omitted through
the TRACY_NO_DBGHELP_INIT_LOAD define. In this mode, symbols will be
loaded as needed.
- Validation of discontinuous frames has been disabled in on-demand mode.
It's quite likely to connect in the middle of a discontinuous frame,
which resulted in frame end event for a frame that hasn't been started.
- Symbols can be now resolved offline on Windows and Linux.
- Enabled with the TRACY_SYMBOL_OFFLINE_RESOLVE define or env variable.
- The update utility has two additional options:
- -r, which enables resolving symbol and patching stack frames in the
trace.
- -p, which you can use to modify the paths used for symbol resolution.
- Some functionality will be missing if this mode is used. For example,
symbol statistics are unavailable.
- Resolving symbol names on Linux will now use image cache to reduce the
number of dladdr() calls.
- Compiling with the TRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT define will
enable support for run-time updating of known elf ranges in libbacktrace
on Linux. Previously, shared objects dlopened() after libbacktrace init
would not be visible during symbol resolution.
- Zone group count in the Find zone window is now explicitly displayed.
- Instrumentation statistics now display in how many threads each source
location has appeared in.
- Added import tool for fuchsia traces.
- https://fuchsia.dev/fuchsia-src/reference/tracing/trace-format
- Added checks for overflow of source locations.
- As a reminder, Tracy only allows to have 64K unique source locations,
split in half between static and dynamic locations.
- Runtime checks are active during capture and will stop a trace that
goes beyond the limit.
- Load-time checks will stop any broken trace file from loading.
- Opening the source code view that has no associated address in code
(i.e., from the list of instrumented zones, or from the find zone
window) will now search the list of symbols for a function name match.
- In many cases this will result in displaying the full disassembly view
where previously you would only see the source code.
- Matching is performed by string comparisons, which in rare cases may
result in showing false data.
- Press ctrl key while opening source view to keep the old behavior.
- If more than one matching symbol is found (e.g., if two classes have
methods with the same name, or if a template is instantiated in multiple
places in code), it is not possible to tell which of the code locations
the source location corresponds to and only the source code will be
displayed.
- Added TracyNoop macro, which inserts a reference to Tracy's object file
into your application. Use it if you want to use Tracy in sampling mode,
without any manual instrumentation (so no references of your own exist)
and link Tracy as a static library. Linkers will only include library code
if code references it, and this doesn't work as intended with Tracy, as it
ignores global constructors that have side effects.
- ZoneText and ZoneName macros now have a printf-like variant, denoted with
a 'F' postfix.
- The 'tracy_shared_libs' Meson option was removed. Use interface provided
by Meson to set the library type instead.
- Dropped the 'tracy_' prefix from Meson options. The `tracy_enable` option
remains as it was, as it can be inherited from parent projects.
- Fixed display of active / inactive allocations in memory call tree.
- Instrumentation statistics can be now sorted by source location.
- Added option to hide external code frames in call stack view.


v0.10.0 (2023-10-16)
--------------------

- Missed frames region of on-demand captures will be now ignored when
calculating trace time span, zone percentages, etc.
Expand All @@ -25,7 +107,7 @@ v0.x.x (xxxx-xx-xx)
been heavily parallelized.
- The impact is especially visible with traces containing large amounts
of data. The framerate improvement in such cases can be ~30x.
- Consequently, the profiler GUI will now produce all-core spikes when
- Consequently, the profiler GUI will now produce multi-core spikes when
rendering frames. This may have impact on the profiled application's
performance, if both the application and the profiler GUI are running
on the same machine. If this is a problem, you may consider the capture
Expand All @@ -41,6 +123,15 @@ v0.x.x (xxxx-xx-xx)
- Fixed compatibility problems with FreeBSD.
- Added support for dynamically loaded Vulkan symbols.
- Trace description or filename is now displayed on the window title bar.
- The csvexport utility will now export thread id data.
- Improved compatibility with MSVC projects not defining NOMINMAX.
- Improved compatibility with Linux setups targeting musl as libc.
- Thread safety of Vulkan instrumentation has been reviewed.
- D3D11 and D3D12 instrumentation was rewritten.
- Added support for efficient profiling when running under rr, the record-
replaying debugger. This is enabled with TRACY_PATCHABLE_NOPSLEDS define.
- History of viewed symbols is now preserved and you can go back to
previously displayed entries.


v0.9.1 (2023-02-26)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### A real time, nanosecond resolution, remote telemetry, hybrid frame and sampling profiler for games and other applications.

Tracy supports profiling CPU (Direct support is provided for C, C++, and Lua integration. At the same time, third-party bindings to many other languages exist on the internet, such as Rust, Zig, C#, OCaml, Odin, etc.), GPU (All major graphic APIs: OpenGL, Vulkan, Direct3D 11/12, OpenCL.), memory allocations, locks, context switches, automatically attribute screenshots to captured frames, and much more.
Tracy supports profiling CPU (Direct support is provided for C, C++, and Lua integration. At the same time, third-party bindings to many other languages exist on the internet, such as [Rust](https://github.com/nagisa/rust_tracy_client), [Zig](https://github.com/nektro/zig-tracy), [C#](https://github.com/clibequilibrium/Tracy-CSharp), [OCaml](https://github.com/imandra-ai/ocaml-tracy), [Odin](https://github.com/oskarnp/odin-tracy), etc.), GPU (All major graphic APIs: OpenGL, Vulkan, Direct3D 11/12, OpenCL.), memory allocations, locks, context switches, automatically attribute screenshots to captured frames, and much more.

- [Documentation](https://github.com/wolfpld/tracy/releases/latest/download/tracy.pdf) for usage and build process instructions
- [Releases](https://github.com/wolfpld/tracy/releases) containing the documentation (`tracy.pdf`) and compiled Windows x64 binaries (`Tracy-<version>.7z`) as assets
Expand Down
4 changes: 3 additions & 1 deletion csvexport/src/csvexport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ int main(int argc, char** argv)
if (args.unwrap)
{
columns = {
"name", "src_file", "src_line", "ns_since_start", "exec_time_ns"
"name", "src_file", "src_line", "ns_since_start", "exec_time_ns", "thread"
};
}
else
Expand Down Expand Up @@ -301,6 +301,7 @@ int main(int argc, char** argv)
int i = 0;
for (const auto& zone_thread_data : zone_data.zones) {
const auto zone_event = zone_thread_data.Zone();
const auto tId = zone_thread_data.Thread();
const auto start = zone_event->Start();
const auto end = zone_event->End();

Expand All @@ -311,6 +312,7 @@ int main(int argc, char** argv)
timespan -= GetZoneChildTimeFast(worker, *zone_event);
}
values[4] = std::to_string(timespan);
values[5] = std::to_string(tId);

std::string row = join(values, args.separator);
printf("%s\n", row.data());
Expand Down
Loading

0 comments on commit a6c7beb

Please sign in to comment.