Compare commits
2 Commits
slomp/pin-
...
wayland-re
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74cd6a711e | ||
|
|
a28c115c5c |
@@ -1,35 +0,0 @@
|
||||
# Empirical format config, based on observed style guide
|
||||
# Use this only as an help to fit the surrounding code style - don't reformat whole files at once
|
||||
---
|
||||
BasedOnStyle: Microsoft
|
||||
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
|
||||
AllowShortLoopsOnASingleLine: true
|
||||
AllowShortCaseLabelsOnASingleLine: true
|
||||
AllowShortFunctionsOnASingleLine: All
|
||||
# AllowShortEnumsOnASingleLine: true # Broken for some reason, even in last versions of clang-format... So don't use it or it may change formating in the future.
|
||||
AllowShortLambdasOnASingleLine: All
|
||||
BreakConstructorInitializers: BeforeComma
|
||||
BreakStringLiterals: false
|
||||
SpaceAfterTemplateKeyword: false
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
# Allman seems to break lambda formatting for some reason with `ColumnLimit: 0`. See https://github.com/llvm/llvm-project/issues/50275
|
||||
# Even though it is supposed to have been fixed, issue still remains in 20.1.8. (and is very much present in 18.x which is the one shipped by VS2022 and VSCord clangd as of 2025-07-27)
|
||||
# Things work fine with `BasedOnStyle: Microsoft` so use that instead
|
||||
#BreakBeforeBraces: Allman
|
||||
ColumnLimit: 0
|
||||
# We'd like to use LeftWithLastLine but it's only available in >=19.x
|
||||
#AlignEscapedNewlines: LeftWithLastLine
|
||||
AlignEscapedNewlines: Left
|
||||
FixNamespaceComments: false
|
||||
IndentPPDirectives: AfterHash
|
||||
IndentAccessModifiers: false
|
||||
AccessModifierOffset: -4
|
||||
LambdaBodyIndentation: OuterScope
|
||||
PPIndentWidth: 2
|
||||
IndentWidth: 4
|
||||
PointerAlignment: Left
|
||||
SpaceBeforeParens: Never
|
||||
SpacesInParentheses: true
|
||||
TabWidth: 4
|
||||
AlignTrailingComments:
|
||||
Kind: Leave
|
||||
@@ -20,28 +20,24 @@ Checks:
|
||||
-google-readability-namespace-comments,
|
||||
-misc-confusable-identifiers,
|
||||
-misc-no-recursion,
|
||||
-misc-use-anonymous-namespace,
|
||||
-misc-use-internal-linkage,
|
||||
-modernize-avoid-c-arrays,
|
||||
-modernize-deprecated-headers,
|
||||
-modernize-use-default-member-init,
|
||||
-modernize-use-designated-initializers,
|
||||
-modernize-use-trailing-return-type,
|
||||
-performance-no-int-to-ptr,
|
||||
-readability-braces-around-statements,
|
||||
-readability-else-after-return,
|
||||
-readability-function-cognitive-complexity,
|
||||
-readability-function-size,
|
||||
-readability-identifier-length,
|
||||
-readability-implicit-bool-conversion,
|
||||
-readability-isolate-declaration,
|
||||
-readability-magic-numbers,
|
||||
-readability-math-missing-parentheses,
|
||||
-readability-qualified-auto,
|
||||
-readability-uppercase-literal-suffix
|
||||
'
|
||||
WarningsAsErrors: ''
|
||||
HeaderFilterRegex: ''
|
||||
AnalyzeTemporaryDtors: false
|
||||
FormatStyle: none
|
||||
CheckOptions:
|
||||
llvm-else-after-return.WarnOnConditionVariables: 'false'
|
||||
|
||||
35
.github/actions/test-tracy/action.yml
vendored
@@ -1,35 +0,0 @@
|
||||
name: 'Test Tracy'
|
||||
description: 'Build the Tracy test application with various cmake flag combinations'
|
||||
|
||||
inputs:
|
||||
extra_cmake_flags:
|
||||
description: 'Additional cmake flags appended to each configure command (e.g. cross-compilation flags)'
|
||||
required: false
|
||||
default: ''
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Test application
|
||||
shell: bash
|
||||
run: |
|
||||
# test compilation with different flags
|
||||
# we clean the build folder to reset cached variables between runs
|
||||
cmake -B tests/tracy/build -S tests/tracy -DCMAKE_BUILD_TYPE=Release ${{ inputs.extra_cmake_flags }}
|
||||
cmake --build tests/tracy/build --parallel
|
||||
cmake -E rm -rf tests/tracy/build
|
||||
|
||||
# same with TRACY_ON_DEMAND
|
||||
cmake -B tests/tracy/build -S tests/tracy -DCMAKE_BUILD_TYPE=Release -DTRACY_ON_DEMAND=ON ${{ inputs.extra_cmake_flags }}
|
||||
cmake --build tests/tracy/build --parallel
|
||||
cmake -E rm -rf tests/tracy/build
|
||||
|
||||
# same with TRACY_MANUAL_LIFETIME
|
||||
cmake -B tests/tracy/build -S tests/tracy -DCMAKE_BUILD_TYPE=Release -DTRACY_MANUAL_LIFETIME=ON ${{ inputs.extra_cmake_flags }}
|
||||
cmake --build tests/tracy/build --parallel
|
||||
cmake -E rm -rf tests/tracy/build
|
||||
|
||||
# same with TRACY_DEMANGLE
|
||||
cmake -B tests/tracy/build -S tests/tracy -DCMAKE_BUILD_TYPE=Release -DTRACY_DEMANGLE=ON ${{ inputs.extra_cmake_flags }}
|
||||
cmake --build tests/tracy/build --parallel
|
||||
cmake -E rm -rf tests/tracy/build
|
||||
49
.github/workflows/android.yml
vendored
@@ -1,49 +0,0 @@
|
||||
name: android
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: android-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm-cache
|
||||
|
||||
jobs:
|
||||
build-android:
|
||||
runs-on: ubuntu-latest
|
||||
container: archlinux:base-devel
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: pacman -Syu --noconfirm && pacman -S --noconfirm --needed cmake git ninja nodejs unzip
|
||||
- name: Setup NDK
|
||||
uses: nttld/setup-ndk@v1
|
||||
id: setup-ndk
|
||||
with:
|
||||
ndk-version: r29
|
||||
- run: echo "ANDROID_NDK_ROOT=${{ steps.setup-ndk.outputs.ndk-path }}" >> $GITHUB_ENV
|
||||
- name: Trust git repo
|
||||
run: git config --global --add safe.directory '*'
|
||||
- uses: actions/checkout@v4
|
||||
- name: Cache CPM packages
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.CPM_SOURCE_CACHE }}
|
||||
key: ${{ runner.os }}-cpm-${{ hashFiles('**/vendor.cmake', '**/CMakeLists.txt') }}
|
||||
restore-keys: ${{ runner.os }}-cpm-
|
||||
- name: Library v7
|
||||
run: |
|
||||
cmake -B build-v7 -DCMAKE_BUILD_TYPE=Release -DTRACY_ENABLE=ON -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a
|
||||
cmake --build build-v7
|
||||
- name: Library v8
|
||||
run: |
|
||||
cmake -B build-v8 -DCMAKE_BUILD_TYPE=Release -DTRACY_ENABLE=ON -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a
|
||||
cmake --build build-v8
|
||||
61
.github/workflows/appimage.yml
vendored
@@ -1,61 +0,0 @@
|
||||
name: appimage
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: appimage-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm-cache
|
||||
PANDOC_CACHE_DIR: ${{ github.workspace }}/pandoc-cache
|
||||
|
||||
jobs:
|
||||
build-appimage:
|
||||
runs-on: ubuntu-latest
|
||||
container: ubuntu:24.04
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
build-essential cmake ninja-build meson pkg-config git ca-certificates \
|
||||
curl file desktop-file-utils nodejs patchelf \
|
||||
libegl-dev libxkbcommon-dev libdbus-1-dev libssl-dev \
|
||||
libffi-dev libexpat1-dev wayland-protocols
|
||||
- name: Trust git repo
|
||||
run: git config --global --add safe.directory '*'
|
||||
- uses: actions/checkout@v4
|
||||
- name: Cache CPM packages
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.CPM_SOURCE_CACHE }}
|
||||
key: ${{ runner.os }}-cpm-${{ hashFiles('**/vendor.cmake', '**/CMakeLists.txt') }}
|
||||
restore-keys: ${{ runner.os }}-cpm-
|
||||
- name: Cache pandoc
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.PANDOC_CACHE_DIR }}
|
||||
key: ${{ runner.os }}-pandoc-${{ hashFiles('cmake/manual.cmake') }}
|
||||
- name: Cache wayland
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: profiler/build-appimage/wayland
|
||||
key: ${{ runner.os }}-wayland-${{ hashFiles('profiler/appimage/build.sh') }}
|
||||
- name: Build AppImage
|
||||
run: profiler/appimage/build.sh
|
||||
env:
|
||||
GIT_REV: ${{ github.sha }}
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: appimage
|
||||
path: profiler/build-appimage/tracy-profiler-x86_64.AppImage
|
||||
83
.github/workflows/emscripten.yml
vendored
@@ -1,83 +0,0 @@
|
||||
name: emscripten
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: emscripten-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm-cache
|
||||
PANDOC_CACHE_DIR: ${{ github.workspace }}/pandoc-cache
|
||||
|
||||
jobs:
|
||||
build-emscripten:
|
||||
runs-on: ubuntu-latest
|
||||
container: archlinux:base-devel
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: pacman -Syu --noconfirm && pacman -S --noconfirm --needed cmake git unzip python ninja zstd nodejs
|
||||
- name: Setup emscripten
|
||||
uses: emscripten-core/setup-emsdk@v16
|
||||
with:
|
||||
version: 6.0.9
|
||||
- name: Trust git repo
|
||||
run: git config --global --add safe.directory '*'
|
||||
- uses: actions/checkout@v4
|
||||
- name: Cache CPM packages
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.CPM_SOURCE_CACHE }}
|
||||
key: ${{ runner.os }}-cpm-${{ hashFiles('**/vendor.cmake', '**/CMakeLists.txt') }}
|
||||
restore-keys: ${{ runner.os }}-cpm-
|
||||
- name: Cache pandoc
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.PANDOC_CACHE_DIR }}
|
||||
key: ${{ runner.os }}-pandoc-${{ hashFiles('cmake/manual.cmake') }}
|
||||
- name: Profiler GUI
|
||||
run: |
|
||||
cmake -G Ninja -B profiler/build -S profiler -DCMAKE_BUILD_TYPE=MinSizeRel -DGIT_REV=${{ github.sha }} -DCMAKE_TOOLCHAIN_FILE=${{env.EMSDK}}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
|
||||
cmake --build profiler/build --parallel
|
||||
- name: Compress artifacts
|
||||
run: |
|
||||
zstd -18 profiler/build/tracy-profiler.js profiler/build/tracy-profiler.wasm
|
||||
gzip -9 profiler/build/tracy-profiler.js profiler/build/tracy-profiler.wasm
|
||||
- name: Find Artifacts
|
||||
id: find_artifacts
|
||||
run: |
|
||||
mkdir -p bin
|
||||
cp profiler/build/index.html bin
|
||||
cp profiler/build/favicon.svg bin
|
||||
cp profiler/build/embed.tracy bin
|
||||
cp profiler/build/tracy-profiler.js.gz bin
|
||||
cp profiler/build/tracy-profiler.js.zst bin
|
||||
cp profiler/build/tracy-profiler.wasm.gz bin
|
||||
cp profiler/build/tracy-profiler.wasm.zst bin
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: emscripten
|
||||
path: bin
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build-emscripten
|
||||
if: github.ref == 'refs/heads/master'
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: wlixcc/SFTP-Deploy-Action@v1.2.4
|
||||
with:
|
||||
username: ${{ secrets.USERNAME }}
|
||||
server: ${{ secrets.SERVER }}
|
||||
port: ${{ secrets.PORT }}
|
||||
ssh_private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
local_path: './emscripten/*'
|
||||
remote_path: ${{ secrets.REMOTE_PATH }}
|
||||
sftp_only: true
|
||||
21
.github/workflows/latex.yml
vendored
@@ -5,29 +5,24 @@ on:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: latex-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build-manual:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v2
|
||||
- name: Fix stupidity
|
||||
run: |
|
||||
cp AUTHORS AUTHORS.
|
||||
cp LICENSE LICENSE.
|
||||
- name: Compile LaTeX
|
||||
uses: xu-cheng/latex-action@v3
|
||||
uses: xu-cheng/latex-action@v2
|
||||
with:
|
||||
working_directory: manual
|
||||
root_file: tracy.tex
|
||||
- uses: actions/upload-artifact@v4
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: manual
|
||||
path: manual/tracy.pdf
|
||||
|
||||
79
.github/workflows/linux-cli.yml
vendored
@@ -1,79 +0,0 @@
|
||||
name: linux-cli
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: linux-cli-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm-cache
|
||||
|
||||
jobs:
|
||||
build-linux-cli:
|
||||
runs-on: ubuntu-latest
|
||||
container: ubuntu:24.04
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
build-essential cmake git ca-certificates curl nodejs
|
||||
- name: Trust git repo
|
||||
run: git config --global --add safe.directory '*'
|
||||
- uses: actions/checkout@v4
|
||||
- name: Cache CPM packages
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.CPM_SOURCE_CACHE }}
|
||||
key: ${{ runner.os }}-cpm-${{ hashFiles('**/vendor.cmake', '**/CMakeLists.txt') }}
|
||||
restore-keys: ${{ runner.os }}-cpm-
|
||||
- name: Build update
|
||||
run: |
|
||||
cmake -B update/build -S update -DCMAKE_BUILD_TYPE=Release -DNO_ISA_EXTENSIONS=ON -DGIT_REV=${{ github.sha }}
|
||||
cmake --build update/build --parallel
|
||||
- name: Build capture
|
||||
run: |
|
||||
cmake -B capture/build -S capture -DCMAKE_BUILD_TYPE=Release -DNO_ISA_EXTENSIONS=ON -DGIT_REV=${{ github.sha }}
|
||||
cmake --build capture/build --parallel
|
||||
- name: Build csvexport
|
||||
run: |
|
||||
cmake -B csvexport/build -S csvexport -DCMAKE_BUILD_TYPE=Release -DNO_ISA_EXTENSIONS=ON -DGIT_REV=${{ github.sha }}
|
||||
cmake --build csvexport/build --parallel
|
||||
- name: Build import
|
||||
run: |
|
||||
cmake -B import/build -S import -DCMAKE_BUILD_TYPE=Release -DNO_ISA_EXTENSIONS=ON -DGIT_REV=${{ github.sha }}
|
||||
cmake --build import/build --parallel
|
||||
- name: Build merge
|
||||
run: |
|
||||
cmake -B merge/build -S merge -DCMAKE_BUILD_TYPE=Release -DNO_ISA_EXTENSIONS=ON -DGIT_REV=${{ github.sha }}
|
||||
cmake --build merge/build --parallel
|
||||
- name: Build monitor
|
||||
run: |
|
||||
cmake -B monitor/build -S monitor -DCMAKE_BUILD_TYPE=Release -DNO_ISA_EXTENSIONS=ON -DGIT_REV=${{ github.sha }}
|
||||
cmake --build monitor/build --parallel
|
||||
- name: Stage release files
|
||||
run: |
|
||||
mkdir -p linux-cli
|
||||
cp update/build/tracy-update linux-cli/
|
||||
cp capture/build/tracy-capture linux-cli/
|
||||
cp capture/build/tracy-capture-daemon linux-cli/
|
||||
cp csvexport/build/tracy-csvexport linux-cli/
|
||||
cp import/build/tracy-import-chrome linux-cli/
|
||||
cp import/build/tracy-import-fuchsia linux-cli/
|
||||
cp merge/build/tracy-merge linux-cli/
|
||||
cp monitor/build/tracy-monitor linux-cli/
|
||||
strip linux-cli/tracy-*
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: linux-cli
|
||||
path: linux-cli
|
||||
119
.github/workflows/linux.yml
vendored
@@ -5,110 +5,37 @@ on:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: linux-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm-cache
|
||||
PANDOC_CACHE_DIR: ${{ github.workspace }}/pandoc-cache
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
runs-on: ubuntu-latest
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-22.04
|
||||
container: archlinux:base-devel
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: pacman -Syu --noconfirm && pacman -S --noconfirm --needed freetype2 debuginfod wayland dbus libxkbcommon libglvnd meson cmake git wayland-protocols nodejs lua clang sdl3_image python-jinja
|
||||
- name: Trust git repo
|
||||
run: git config --global --add safe.directory '*'
|
||||
- uses: actions/checkout@v4
|
||||
- name: Cache CPM packages
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.CPM_SOURCE_CACHE }}
|
||||
key: ${{ runner.os }}-cpm-${{ hashFiles('**/vendor.cmake', '**/CMakeLists.txt') }}
|
||||
restore-keys: ${{ runner.os }}-cpm-
|
||||
- name: Cache pandoc
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.PANDOC_CACHE_DIR }}
|
||||
key: ${{ runner.os }}-pandoc-${{ hashFiles('cmake/manual.cmake') }}
|
||||
- name: Determine build parallelism
|
||||
run: |
|
||||
if [ "${ACT:-}" != "true" ] && [ "${FORGEJO_ACTIONS:-}" != "true" ]; then
|
||||
echo "CMAKE_PARALLEL=--parallel 2" >> "$GITHUB_ENV"
|
||||
else
|
||||
echo "CMAKE_PARALLEL=--parallel" >> "$GITHUB_ENV"
|
||||
fi
|
||||
- name: Dyna example / clang
|
||||
run: |
|
||||
CC=clang CXX=clang++ cmake -B examples/dyna/build-clang -S examples/dyna -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build examples/dyna/build-clang $CMAKE_PARALLEL
|
||||
- name: Dyna example / gcc
|
||||
run: |
|
||||
CC=gcc CXX=g++ cmake -B examples/dyna/build-gcc -S examples/dyna -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build examples/dyna/build-gcc $CMAKE_PARALLEL
|
||||
- uses: actions/checkout@v2
|
||||
- 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: |
|
||||
cmake -B profiler/build -S profiler -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
||||
cmake --build profiler/build $CMAKE_PARALLEL
|
||||
run: make -j`nproc` -C profiler/build/unix debug release
|
||||
- name: Update utility
|
||||
run: |
|
||||
cmake -B update/build -S update -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
||||
cmake --build update/build $CMAKE_PARALLEL
|
||||
run: make -j`nproc` -C update/build/unix debug release
|
||||
- name: Capture utility
|
||||
run: |
|
||||
cmake -B capture/build -S capture -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
||||
cmake --build capture/build $CMAKE_PARALLEL
|
||||
run: make -j`nproc` -C capture/build/unix debug release
|
||||
- name: Csvexport utility
|
||||
run: |
|
||||
cmake -B csvexport/build -S csvexport -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
||||
cmake --build csvexport/build $CMAKE_PARALLEL
|
||||
- name: Import utilities
|
||||
run: |
|
||||
cmake -B import/build -S import -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
||||
cmake --build import/build $CMAKE_PARALLEL
|
||||
- name: Merge utility
|
||||
run: |
|
||||
cmake -B merge/build -S merge -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
||||
cmake --build merge/build $CMAKE_PARALLEL
|
||||
- name: Monitor utility
|
||||
run: |
|
||||
cmake -B monitor/build -S monitor -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
||||
cmake --build monitor/build $CMAKE_PARALLEL
|
||||
- name: Library (cmake)
|
||||
run: |
|
||||
cmake -B build -DCMAKE_BUILD_TYPE=Release -DTRACY_ENABLE=ON
|
||||
cmake --build build $CMAKE_PARALLEL
|
||||
env:
|
||||
CMAKE_INSTALL_PREFIX: ${{ github.workspace }}/bin
|
||||
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=$GITHUB_WORKSPACE/bin/lib -Dtracy_enable=true build-meson
|
||||
meson compile -C build-meson
|
||||
run: meson setup -Dprefix=$PWD/install build && meson compile -C build && meson install -C build
|
||||
- name: Test application
|
||||
uses: ./.github/actions/test-tracy
|
||||
- name: Find Artifacts
|
||||
id: find_artifacts
|
||||
run: |
|
||||
mkdir -p bin
|
||||
cp profiler/build/tracy-profiler bin
|
||||
cp update/build/tracy-update bin
|
||||
cp capture/build/tracy-capture bin
|
||||
cp capture/build/tracy-capture-daemon bin
|
||||
cp csvexport/build/tracy-csvexport bin
|
||||
cp import/build/tracy-import-chrome bin
|
||||
cp import/build/tracy-import-fuchsia bin
|
||||
cp merge/build/tracy-merge bin
|
||||
cp monitor/build/tracy-monitor bin
|
||||
strip bin/tracy-*
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: arch-linux
|
||||
path: bin
|
||||
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'
|
||||
|
||||
102
.github/workflows/macos.yml
vendored
@@ -5,82 +5,36 @@ on:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: macos-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm-cache
|
||||
PANDOC_CACHE_DIR: ${{ github.workspace }}/pandoc-cache
|
||||
|
||||
jobs:
|
||||
build-macos:
|
||||
runs-on: macos-latest
|
||||
build:
|
||||
|
||||
runs-on: macOS-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Cache CPM packages
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.CPM_SOURCE_CACHE }}
|
||||
key: ${{ runner.os }}-cpm-${{ hashFiles('**/vendor.cmake', '**/CMakeLists.txt') }}
|
||||
restore-keys: ${{ runner.os }}-cpm-
|
||||
- name: Cache pandoc
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.PANDOC_CACHE_DIR }}
|
||||
key: ${{ runner.os }}-pandoc-${{ hashFiles('cmake/manual.cmake') }}
|
||||
- name: Install dependencies
|
||||
run: brew install pkg-config meson
|
||||
- name: Trust git repo
|
||||
run: git config --global --add safe.directory '*'
|
||||
- name: Build library
|
||||
run: meson setup -Dtracy_enable=true build && meson compile -C build
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install macos libraries
|
||||
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
|
||||
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
|
||||
uses: ./.github/actions/test-tracy
|
||||
- name: Build profiler
|
||||
run: |
|
||||
cmake -B profiler/build -S profiler -DCMAKE_BUILD_TYPE=Release -DBUNDLE=ON -DGIT_REV=${{ github.sha }}
|
||||
cmake --build profiler/build --parallel 2 --config Release
|
||||
- name: Build update
|
||||
run: |
|
||||
cmake -B update/build -S update -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
||||
cmake --build update/build --parallel --config Release
|
||||
- name: Build capture
|
||||
run: |
|
||||
cmake -B capture/build -S capture -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
||||
cmake --build capture/build --parallel --config Release
|
||||
- name: Build csvexport
|
||||
run: |
|
||||
cmake -B csvexport/build -S csvexport -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
||||
cmake --build csvexport/build --parallel --config Release
|
||||
- name: Build import
|
||||
run: |
|
||||
cmake -B import/build -S import -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
||||
cmake --build import/build --parallel --config Release
|
||||
- name: Build merge
|
||||
run: |
|
||||
cmake -B merge/build -S merge -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
||||
cmake --build merge/build --parallel --config Release
|
||||
- name: Package artifacts
|
||||
run: |
|
||||
mkdir -p bin
|
||||
cp -r profiler/build/tracy-profiler.app bin
|
||||
cp update/build/tracy-update bin
|
||||
cp capture/build/tracy-capture bin
|
||||
cp capture/build/tracy-capture-daemon bin
|
||||
cp csvexport/build/tracy-csvexport bin
|
||||
cp import/build/tracy-import-chrome bin
|
||||
cp import/build/tracy-import-fuchsia bin
|
||||
cp merge/build/tracy-merge bin
|
||||
strip bin/tracy-profiler.app/Contents/MacOS/tracy-profiler
|
||||
strip bin/tracy-update bin/tracy-capture bin/tracy-capture-daemon bin/tracy-csvexport bin/tracy-import-chrome bin/tracy-import-fuchsia bin/tracy-merge
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: macos
|
||||
path: bin
|
||||
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'
|
||||
|
||||
68
.github/workflows/mingw.yml
vendored
@@ -1,68 +0,0 @@
|
||||
name: build-mingw
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: mingw-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm-cache
|
||||
|
||||
jobs:
|
||||
build-mingw:
|
||||
runs-on: ubuntu-latest
|
||||
container: archlinux:base-devel
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pacman -Syu --noconfirm
|
||||
pacman -S --noconfirm --needed mingw-w64-gcc cmake git nodejs meson
|
||||
- name: Trust git repo
|
||||
run: git config --global --add safe.directory '*'
|
||||
- uses: actions/checkout@v4
|
||||
- name: Cache CPM packages
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.CPM_SOURCE_CACHE }}
|
||||
key: ${{ runner.os }}-cpm-${{ hashFiles('**/vendor.cmake', '**/CMakeLists.txt') }}
|
||||
restore-keys: ${{ runner.os }}-cpm-
|
||||
- name: Build TracyClient
|
||||
run: |
|
||||
cmake -B build -DCMAKE_BUILD_TYPE=Release -DTRACY_ENABLE=ON \
|
||||
-DCMAKE_SYSTEM_NAME=Windows \
|
||||
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc \
|
||||
-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++
|
||||
cmake --build build
|
||||
- name: Library (meson)
|
||||
run: |
|
||||
cat > mingw-cross.txt << 'EOF'
|
||||
[binaries]
|
||||
c = '/usr/bin/x86_64-w64-mingw32-gcc'
|
||||
cpp = '/usr/bin/x86_64-w64-mingw32-g++'
|
||||
ar = '/usr/bin/x86_64-w64-mingw32-ar'
|
||||
strip = '/usr/bin/x86_64-w64-mingw32-strip'
|
||||
|
||||
[host_machine]
|
||||
system = 'windows'
|
||||
cpu_family = 'x86_64'
|
||||
cpu = 'x86_64'
|
||||
endian = 'little'
|
||||
EOF
|
||||
meson setup build-meson --cross-file mingw-cross.txt -Ddefault_library=static -Dtracy_enable=true
|
||||
meson compile -C build-meson
|
||||
- name: Test application
|
||||
uses: ./.github/actions/test-tracy
|
||||
with:
|
||||
extra_cmake_flags: >-
|
||||
-DCMAKE_SYSTEM_NAME=Windows
|
||||
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc
|
||||
-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++
|
||||
76
.github/workflows/msvc.yml
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
name: MSVC
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build-with-vcpkg-integration:
|
||||
|
||||
runs-on: windows-2022
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: microsoft/setup-msbuild@v1.0.2
|
||||
- name: Integrate vcpkg
|
||||
run: vcpkg integrate install
|
||||
- name: Profiler GUI Debug
|
||||
run: msbuild .\profiler\build\win32\Tracy.vcxproj /property:Configuration=Debug /property:Platform=x64
|
||||
- name: Profiler GUI Release
|
||||
run: msbuild .\profiler\build\win32\Tracy.vcxproj /property:Configuration=Release /property:Platform=x64
|
||||
- name: Update utility Debug
|
||||
run: msbuild .\update\build\win32\update.vcxproj /property:Configuration=Debug /property:Platform=x64
|
||||
- name: Update utility Release
|
||||
run: msbuild .\update\build\win32\update.vcxproj /property:Configuration=Release /property:Platform=x64
|
||||
- name: Capture utility Debug
|
||||
run: msbuild .\capture\build\win32\capture.vcxproj /property:Configuration=Debug /property:Platform=x64
|
||||
- name: Capture utility Release
|
||||
run: msbuild .\capture\build\win32\capture.vcxproj /property:Configuration=Release /property:Platform=x64
|
||||
- name: Csvexport utility Debug
|
||||
run: msbuild .\csvexport\build\win32\csvexport.vcxproj /property:Configuration=Debug /property:Platform=x64
|
||||
- name: Csvexport utility Release
|
||||
run: msbuild .\csvexport\build\win32\csvexport.vcxproj /property:Configuration=Release /property:Platform=x64
|
||||
- name: Import-chrome utility Debug
|
||||
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
|
||||
run: |
|
||||
mkdir bin
|
||||
mkdir bin\dev
|
||||
copy profiler\build\win32\x64\Release\Tracy.exe bin
|
||||
copy update\build\win32\x64\Release\update.exe bin
|
||||
copy capture\build\win32\x64\Release\capture.exe bin
|
||||
copy import-chrome\build\win32\x64\Release\import-chrome.exe bin
|
||||
copy csvexport\build\win32\x64\Release\csvexport.exe bin
|
||||
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
|
||||
with:
|
||||
path: Tracy.7z
|
||||
|
||||
build-without-vcpkg-integration:
|
||||
|
||||
runs-on: windows-2022
|
||||
|
||||
env:
|
||||
VCPKG_ROOT: ''
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: microsoft/setup-msbuild@v1.0.2
|
||||
- name: Install vcpkg dependencies
|
||||
run: vcpkg/install_vcpkg_dependencies.bat
|
||||
- name: Profiler GUI Release
|
||||
run: msbuild .\profiler\build\win32\Tracy.vcxproj /property:Configuration=Release /property:Platform=x64
|
||||
- name: Capture utility Release
|
||||
run: msbuild .\capture\build\win32\capture.vcxproj /property:Configuration=Release /property:Platform=x64
|
||||
65
.github/workflows/release.yml
vendored
@@ -1,65 +0,0 @@
|
||||
name: release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: release-${{ github.event.release.tag_name }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
release-build-windows:
|
||||
uses: ./.github/workflows/windows.yml
|
||||
|
||||
release-build-macos:
|
||||
uses: ./.github/workflows/macos.yml
|
||||
|
||||
release-build-manual:
|
||||
uses: ./.github/workflows/latex.yml
|
||||
|
||||
release-build-appimage:
|
||||
uses: ./.github/workflows/appimage.yml
|
||||
|
||||
release-build-linux-cli:
|
||||
uses: ./.github/workflows/linux-cli.yml
|
||||
|
||||
attach-to-release:
|
||||
needs: [release-build-windows, release-build-macos, release-build-manual, release-build-appimage, release-build-linux-cli]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
- name: Create versioned Windows zip
|
||||
run: |
|
||||
VERSION="${{ github.event.release.tag_name }}"
|
||||
VERSION_NO_V="${VERSION#v}"
|
||||
cd windows
|
||||
zip -r ../windows-$VERSION_NO_V.zip .
|
||||
- name: Create versioned macOS zip
|
||||
run: |
|
||||
VERSION="${{ github.event.release.tag_name }}"
|
||||
VERSION_NO_V="${VERSION#v}"
|
||||
cd macos
|
||||
chmod +x tracy-* tracy-profiler.app/Contents/MacOS/*
|
||||
zip -r ../macos-$VERSION_NO_V.zip .
|
||||
- name: Create versioned Linux zip
|
||||
run: |
|
||||
VERSION="${{ github.event.release.tag_name }}"
|
||||
VERSION_NO_V="${VERSION#v}"
|
||||
mkdir linux
|
||||
cp appimage/* linux/
|
||||
cp linux-cli/* linux/
|
||||
cd linux
|
||||
zip -r ../linux-$VERSION_NO_V.zip .
|
||||
- uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: |
|
||||
windows-*.zip
|
||||
macos-*.zip
|
||||
linux-*.zip
|
||||
manual/tracy.pdf
|
||||
93
.github/workflows/windows.yml
vendored
@@ -1,93 +0,0 @@
|
||||
name: windows
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: windows-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm-cache
|
||||
PANDOC_CACHE_DIR: ${{ github.workspace }}/pandoc-cache
|
||||
|
||||
jobs:
|
||||
build-windows:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Cache CPM packages
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.CPM_SOURCE_CACHE }}
|
||||
key: ${{ runner.os }}-cpm-${{ hashFiles('**/vendor.cmake', '**/CMakeLists.txt') }}
|
||||
restore-keys: ${{ runner.os }}-cpm-
|
||||
- name: Cache pandoc
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.PANDOC_CACHE_DIR }}
|
||||
key: ${{ runner.os }}-pandoc-${{ hashFiles('cmake/manual.cmake') }}
|
||||
- uses: microsoft/setup-msbuild@v2
|
||||
- name: Trust git repo
|
||||
run: git config --global --add safe.directory '*'
|
||||
- name: Install meson
|
||||
run: python -m pip install --upgrade meson
|
||||
- name: Library (meson)
|
||||
env:
|
||||
CCACHE_DISABLE: '1'
|
||||
run: |
|
||||
$vs = & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
|
||||
foreach ($line in & cmd /c "`"$vs\VC\Auxiliary\Build\vcvarsall.bat`" x64 && set") {
|
||||
if ($line -match '^([^=]+)=(.*)$') { [Environment]::SetEnvironmentVariable($matches[1], $matches[2], 'Process') }
|
||||
}
|
||||
meson setup -Dtracy_enable=true build-meson
|
||||
meson compile -C build-meson
|
||||
- name: Test application
|
||||
uses: ./.github/actions/test-tracy
|
||||
- name: Build profiler
|
||||
run: |
|
||||
cmake -B profiler/build -S profiler -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
||||
cmake --build profiler/build --parallel 2 --config Release
|
||||
- name: Build update
|
||||
run: |
|
||||
cmake -B update/build -S update -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
||||
cmake --build update/build --parallel --config Release
|
||||
- name: Build capture
|
||||
run: |
|
||||
cmake -B capture/build -S capture -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
||||
cmake --build capture/build --parallel --config Release
|
||||
- name: Build csvexport
|
||||
run: |
|
||||
cmake -B csvexport/build -S csvexport -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
||||
cmake --build csvexport/build --parallel --config Release
|
||||
- name: Build import
|
||||
run: |
|
||||
cmake -B import/build -S import -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
||||
cmake --build import/build --parallel --config Release
|
||||
- name: Build merge
|
||||
run: |
|
||||
cmake -B merge/build -S merge -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
||||
cmake --build merge/build --parallel --config Release
|
||||
- name: Package artifacts
|
||||
run: |
|
||||
mkdir bin
|
||||
copy profiler\build\Release\tracy-profiler.exe bin
|
||||
copy update\build\Release\tracy-update.exe bin
|
||||
copy capture\build\Release\tracy-capture.exe bin
|
||||
copy capture\build\Release\tracy-capture-daemon.exe bin
|
||||
copy csvexport\build\Release\tracy-csvexport.exe bin
|
||||
copy import\build\Release\tracy-import-chrome.exe bin
|
||||
copy import\build\Release\tracy-import-fuchsia.exe bin
|
||||
copy merge\build\Release\tracy-merge.exe bin
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: windows
|
||||
path: bin
|
||||
33
.gitignore
vendored
@@ -1,12 +1,22 @@
|
||||
.vs
|
||||
*.opendb
|
||||
*.db
|
||||
*.vcxproj.user
|
||||
x64
|
||||
Release
|
||||
Debug
|
||||
_build
|
||||
_compiler
|
||||
tools/*
|
||||
*.d
|
||||
*.o
|
||||
*.so
|
||||
*.swp
|
||||
*.obj
|
||||
imgui.ini
|
||||
test/tracy_test
|
||||
test/tracy_test.exe
|
||||
*/build/unix/*-*
|
||||
manual/t*.aux
|
||||
manual/t*.log
|
||||
manual/t*.out
|
||||
@@ -15,19 +25,22 @@ manual/t*.synctex.gz
|
||||
manual/t*.toc
|
||||
manual/t*.bbl
|
||||
manual/t*.blg
|
||||
manual/t*.fdb_latexmk
|
||||
manual/t*.fls
|
||||
manual/tracy.md
|
||||
profiler/build-appimage
|
||||
profiler/build/win32/packages
|
||||
profiler/build/win32/Tracy.aps
|
||||
# include the vcpkg install script but not the files it produces
|
||||
vcpkg/*
|
||||
!vcpkg/install_vcpkg_dependencies.bat
|
||||
/vcpkg_installed
|
||||
.deps/
|
||||
.dirstamp
|
||||
.vscode/
|
||||
|
||||
/_*/**
|
||||
/**/__pycache__/**
|
||||
extra/vswhere.exe
|
||||
extra/tracy-build
|
||||
.cache
|
||||
.uv-cache/
|
||||
.venv/
|
||||
/.cache
|
||||
compile_commands.json
|
||||
examples/ToyPathTracer/Windows/TestCpu
|
||||
examples/ToyPathTracer/Windows/x64
|
||||
*.user
|
||||
profiler/build/wasm/Tracy-release.*
|
||||
profiler/build/wasm/Tracy-debug.*
|
||||
profiler/build/wasm/embed.tracy
|
||||
|
||||
2
.mailmap
@@ -1,2 +0,0 @@
|
||||
<wolf@nereid.pl> <wolf.pld@gmail.com>
|
||||
<wolf@nereid.pl> <bartosz.taudul@game-lion.com>
|
||||
@@ -1,28 +0,0 @@
|
||||
# Working rules
|
||||
|
||||
## Permissions and scope
|
||||
|
||||
- Answer questions; execute state changes only when explicitly instructed. Anything that changes state (files, git history, services, external systems) requires an explicit instruction in the current conversation. Never infer permission from context, momentum, or a previously similar instruction.
|
||||
- Do exactly what was named. If you discover the same defect in a sibling, report it — do not fix it.
|
||||
|
||||
## Code
|
||||
|
||||
- Follow the style conventions already present in the repository — observe the files you touch and their related ones (siblings in the same layer, neighbors with the same role) before writing, and deviate only when told.
|
||||
- Comments carry only what is not inferable from the code and is not already stated in the commit message, e.g. contracts, platform divergences. No narration of what the code does.
|
||||
- Do not follow architectural precedent merely because it exists. Follow it when it is valid; when it is invalid — copy-pasted logic, a wrong home for shared code, a workaround that outlived its reason — propose the improvement instead.
|
||||
- Do not assume a library behaves identically across platforms and standard-library implementations; verify behavior on the toolchains the code actually ships with.
|
||||
|
||||
## Verification
|
||||
|
||||
- Prove behavior, not just compilation: build the affected targets and run the changed path, including the failure paths. Label compile-only claims as such.
|
||||
- Test non-trivial new logic before committing it; the first run of new code is where environment and API assumptions break.
|
||||
- State verification limits explicitly (what could not be exercised, and why).
|
||||
|
||||
## Commits
|
||||
|
||||
- Subject: one line, imperative, capitalized, ends with a period — like `Bump LZ4 to 1.10.0.`, `Use the system wayland-protocols package.`.
|
||||
- Body: only genuine rationale, mechanism, or constraints; skip it when the change is self-evident from the diff. Never recap decision processes or alternatives considered.
|
||||
- One logical change per commit. Never bundle unrelated edits.
|
||||
- The rationale, mechanism, non-obvious constraints — belong in the commit message, not in code comments.
|
||||
- Explain a pattern once, at its first occurrence; repeat occurrences at other sites state only what they do.
|
||||
- No process narration ("this commit", "as discussed"), no references to the conversation.
|
||||
@@ -1,329 +0,0 @@
|
||||
---
|
||||
name: tracy-gui-verify
|
||||
description: Build and drive the Tracy Profiler GUI headlessly via two routes: the emscripten (web) GUI in a headless browser with an instrumented harness, or the native GUI under X11. Use when developing or testing the profiler GUI.
|
||||
---
|
||||
|
||||
# Test the Tracy GUI headlessly
|
||||
|
||||
Two routes run the profiler GUI on a display-less machine. Pick one per test goal:
|
||||
|
||||
| | Route A — Web (emscripten) | Route B — Native (X11) |
|
||||
|---|---|---|
|
||||
|Display|Browser; no X11/Wayland/DISPLAY — the browser is the display server|Xvfb (virtual X server) + openbox (window manager)|
|
||||
|Input|Puppeteer mouse/keyboard|xdotool mouse/keyboard|
|
||||
|Ground truth|Instrumented harness (`debug_snapshot`/`debug_clear`) — app-side mouse/ID state|Screenshot diffs (PIL `ImageChops`) — no harness|
|
||||
|Can test|Loaded-trace GUI: toolbar, panels, targeting, DPI scaling|Live TCP connection to a client, native file dialogs (save/open), X11/GLFW input|
|
||||
|Cannot test|Live client (browser cannot open a TCP server), native file dialogs|No known GUI-level gap; verification precision is lower (no hit-test oracle)|
|
||||
|Prereqs|emsdk (`$EMSDK_DIR`, default `~/emsdk`), CPM cache|Xvfb, openbox, xdotool, ImageMagick (`import`), mesa swrast|
|
||||
|
||||
# Route A — Web GUI (emscripten, headless browser)
|
||||
|
||||
Build the emscripten profiler GUI into an instrumented temporary workspace, serve it, and drive it with the browser tool. The harness exports `debug_snapshot`/`debug_clear`, exposing the app-side mouse/ID state — the ground truth for targeting and verification, not screenshots.
|
||||
|
||||
Constants marked M are workstation-dependent — re-verify them. Everything else is stable; do not re-derive it.
|
||||
|
||||
## Setup
|
||||
|
||||
```sh
|
||||
sh <this-skill-dir>/setup.sh # workspace=/tmp/tracy-protocol
|
||||
# or: TRACY_WEB_WS=/elsewhere TRACY_WEB_REPO=<repo> sh setup.sh
|
||||
```
|
||||
|
||||
`<this-skill-dir>` is the project-scoped `.omp/skills/tracy-gui-verify/` under the active project root — not a fixed home directory. If multiple copies exist (one per project that has used this skill), use the copy inside the repo being tested; `TRACY_WEB_REPO` controls which repo is copied into the workspace.
|
||||
|
||||
The script does: fresh source copy (excludes `.git` and build dirs) → applies `harness.patch` (adds `debug_snapshot`/`debug_clear` exports + event/frame recording to the emscripten backend, in the COPY only) → configures → builds Release with the emsdk at `$EMSDK_DIR` (default `~/emsdk`) and the CPM cache at `~/.cache/cpm`.
|
||||
|
||||
**Pitfall:** if the workspace is deleted while a `tracy-web` server is running, stop the hub process first — a stale server keeps the *deleted* cwd and silently returns empty responses while the port still accepts connections.
|
||||
|
||||
**Pitfall:** a `tracy-web` that died in an earlier session leaves the daemon in `failed` state: `stop` only reports the old failure, and `start` keeps returning "Daemon tracy-web has unacknowledged completion notifications" while the port stays free. Drain the daemon with `hub op=logs name=tracy-web` (the log also shows the cause), then relaunch with `hub op=restart name=tracy-web` (retained spec). If the port is NOT free, a stale process owns it — often one serving an earlier (now-stale) build directory: the new `httpd.py` dies on the bind and your requests silently hit the old directory. Check `ss -tlnp | grep 8000` and kill the owner. After any start/restart, verify the server is actually serving: `curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:8000/index.html` must return 200 — the daemon message is not proof of a server.
|
||||
|
||||
**After editing the GUI in the repo:** copy the changed files into `$WS/src/` (same relative path), re-run `cmake --build $WS/build -j$(nproc)`, reload the page. If a change touches `profiler/src/BackendEmscripten.cpp` or `profiler/CMakeLists.txt`, the harness patch may no longer apply — re-apply it manually (keep the `Dbg*` harness section, the `DbgPushEvent`/`DbgPushFrame` calls in the mouse callbacks + `NewFrame`, and the two `debug_*` exports in `-sEXPORTED_FUNCTIONS`).
|
||||
|
||||
## Serve + open + ready
|
||||
|
||||
Server (long-running → `hub`):
|
||||
|
||||
```
|
||||
hub op=start name=tracy-web application=python3 args=["$WS/build/httpd.py"]
|
||||
cwd=$WS/build ready={port:8000} persist=true
|
||||
```
|
||||
|
||||
`httpd.py` sends the COOP/COEP headers required for pthreads/SharedArrayBuffer — use it, not a bare http.server.
|
||||
|
||||
Browser:
|
||||
|
||||
```
|
||||
browser open url=http://127.0.0.1:8000/index.html viewport={width:1600,height:900}
|
||||
```
|
||||
|
||||
**Ready signal** (in a `run` cell; `run` code executes in Node scope — page JS goes through `tab.evaluate`):
|
||||
|
||||
```js
|
||||
let title = null;
|
||||
for (let i = 0; i < 360; i++) {
|
||||
title = await tab.evaluate(() => document.title);
|
||||
if (/ - Tracy Profiler/.test(title)) break;
|
||||
await new Promise(r => setTimeout(r, 250));
|
||||
}
|
||||
```
|
||||
|
||||
Title is `Tracy Profiler X.Y.Z` until the preloaded `embed.tracy` (DarkRL capture) finishes loading, then `<trace> (embed.tracy) - Tracy Profiler X.Y.Z` (`profiler/src/main.cpp` `SetWindowTitleCallback`). Wait ~1.5 s after, then confirm the app loop lives: `snap().frames.at(-1).tick > 0`.
|
||||
|
||||
## Harness API (ground truth)
|
||||
|
||||
```js
|
||||
const snap = () => tab.evaluate(() => JSON.parse(Module.ccall('debug_snapshot','string',[],[])));
|
||||
const clear = () => tab.evaluate(() => Module.ccall('debug_clear','void',[],[]));
|
||||
```
|
||||
|
||||
`snap()` → `{ dpr, innerW, innerH, bufW, bufH, rectL, rectT, rectW, rectH, title, cursor, frames:[…64], events:[…64] }` (newest last).
|
||||
|
||||
- `frames[]`: one sample **per rAF tick, including idle ticks**. `tick` = main-loop count (always advances), `f` = `ImGui::GetFrameCount()` (advances only when a frame actually renders — the idle gate, §Idle), `mx/my` = app mouse position, `md[3]` = mouse button states, `q` = pending input events, `wa` = `tracy::s_wasActive` at tick start, `hi`/`ai` = ImGui `HoveredId`/`ActiveId`.
|
||||
- `events[]`: raw callback data as the app received it. `type` 0=move 1=down 2=up 3=enter 4=leave 5=wheel; `tx/ty` = Emscripten int `targetX/Y`; `ax/ay` = position passed to ImGui (`-1` for non-move); `t` = DOMHighResTimeStamp.
|
||||
|
||||
## Coordinate mapping
|
||||
|
||||
```
|
||||
appX = floor( trunc(cssX - rectL) * dpr ) // device px, what ImGui hit-tests
|
||||
cssX = appX / dpr // inverse for targeting
|
||||
screenshot_px = cssX * dpr
|
||||
```
|
||||
|
||||
Chain: DOM `clientX` → Emscripten `targetX = int(clientX - (rect.left|0))` (`src/lib/libhtml5.js`, `EmscriptenMouseEvent.targetX` is an `int`) → Tracy `AddMousePosEvent(targetX * dpr, …)` (`BackendEmscripten.cpp`) → ImGui `ImFloor` (`imgui.cpp` `AddMousePosEvent`). Canvas fills the viewport, so `rectL/rectT` are 0 (re-read anyway).
|
||||
|
||||
**M: `dpr` on this workstation's headless browser is 1.25** (canvas buffer 2000×1125 for a 1600×900 viewport; screenshots are captured at device px). Never assume 1. App positions come in multiples of `dpr`; verify targeting within ±1 px via `frames[].mx/my`.
|
||||
|
||||
## Click protocol
|
||||
|
||||
Click = move, press, refresh through the hold, release, verify — all against rendered frames. The idle gate (§Idle) renders only 3 frames per wake, and a hold with no mouse events at all refreshes nothing, so a fixed-wait down/up from a cold idle can be swallowed (both events received, zero frames rendered) or released after the wake budget expires. Issuing mouse moves while the button is down keeps the budget alive: a same-coord re-move is delivered (verified: it reaches the canvas handler, wakes the app, and a same-coord hold click straddles cleanly) and is the safest refresh — zero hover drift; a ±`dx` px wiggle works too, but must stay inside the hit area:
|
||||
|
||||
```js
|
||||
async function click(cssX, cssY, holdMs = 400) {
|
||||
await page.mouse.move(cssX, cssY); // 1. ALWAYS move first
|
||||
await new Promise(r => setTimeout(r, 150)); // 2. >= 1 rendered frame
|
||||
const pre = await snap();
|
||||
const pf = pre.frames.at(-1);
|
||||
await clear();
|
||||
await page.mouse.down(); // 3. press
|
||||
let df = null, hiDuring = null;
|
||||
const t0 = Date.now();
|
||||
while (Date.now() - t0 < holdMs) {
|
||||
await new Promise(r => setTimeout(r, 70));
|
||||
await page.mouse.move(cssX, cssY); // 4. same-coord re-move refreshes the wake budget
|
||||
const f = (await snap()).frames.at(-1);
|
||||
if (f.md[0] === 1) { df ??= f.f; hiDuring = f.hi; }
|
||||
}
|
||||
await page.mouse.up(); // 5. release
|
||||
let uf = null;
|
||||
for (let i = 0; i < 40; i++) {
|
||||
await new Promise(r => setTimeout(r, 40));
|
||||
const f = (await snap()).frames.at(-1);
|
||||
if (f.md[0] === 0) { uf = f.f; break; }
|
||||
}
|
||||
await new Promise(r => setTimeout(r, 400));
|
||||
const s = await snap();
|
||||
const d = s.dpr, ex = Math.floor(Math.trunc(cssX - s.rectL) * d), ey = Math.floor(Math.trunc(cssY - s.rectT) * d);
|
||||
return { hoverID: pf.hi, hiDuring, appPos: [pf.mx, pf.my], expected: [ex, ey],
|
||||
straddle: { df, uf },
|
||||
ok: df !== null && uf !== null && uf > df && hiDuring === pf.hi &&
|
||||
Math.abs(pf.mx - ex) <= 1 && Math.abs(pf.my - ey) <= 1 };
|
||||
}
|
||||
```
|
||||
|
||||
Rules:
|
||||
|
||||
1. **Move before every click.** The emscripten mousemove handler is the only thing that sets the app mouse position; mousedown/mouseup only queue button state. Fresh page position is invalid (`-FLT_MAX`) — a click without a prior move activates nothing.
|
||||
2. **Press and release must each render** in separate frames with the item hovered (ImGui's `PressedOnClickRelease` — doc table at `imgui_widgets.cpp:489-497`; input trickling, `ConfigInputTrickleEventQueue`, defers a same-frame release). The same-coord refresh is what guarantees rendered frames across the hold from a cold idle.
|
||||
3. **Verify every click:** `ok: true` (position landed, press and release each rendered, hover held — `hiDuring === hoverID`), plus a screenshot diff as supplementary visual confirmation. Non-ImGui targets (timeline zone bars) have `hi = 0` by design — for those verify by screenshot, not hover.
|
||||
4. **Double-click trap:** two same-position clicks <300 ms apart = double-click (`MouseDoubleClickTime = 0.3 s`) → zoom/thread-info actions fire. Wait ≥350 ms between repeated clicks at one spot.
|
||||
5. **Drag:** move → down → (move + wait 70 ms)×n → up. **Wheel:** `page.mouse.wheel({ deltaY: ±500 })` after positioning. **Keys:** `page.keyboard.type(..., { delay: 50 })` after focusing the input by click; `page.keyboard.press('Enter')`.
|
||||
6. **Danger:** toolbar device x 10–32 (css 8–26) = red power button (leftmost toolbar icon, hover ID 3313137574), closes the trace view (back to "Get started"). Never click it unless intended.
|
||||
|
||||
## Idle and power saving
|
||||
|
||||
`main.cpp DrawContents` keeps an `activeFrames = 3` budget refreshed on any input event (`tracy::s_wasActive`), a connected client, view animation, or a queued input; exhausted → `sleep 16 ms` with **no `ImGui::NewFrame` and no GL draw** (canvas keeps the last frame). Expect ~97 % of ticks to skip rendering while idle.
|
||||
|
||||
- Clicks from a cold idle land only via the click protocol's hold refresh (§Click protocol) — a fixed-wait down/up can be swallowed by the idle gate (both events received, zero frames rendered). **Before interacting, assert `tick`/`f` is advancing**; a stalled main loop (initial trace parse, hidden tab) renders nothing and drops everything. During the initial load the cursor style is `wait`.
|
||||
- `focusLostLimit` (reduce render rate on focus loss) is desktop-only; it does not exist in the emscripten path.
|
||||
- `canvas.style.cursor` is **not** a hover oracle: this ImGui build sets the Hand cursor only in `TextLink`, not on buttons.
|
||||
|
||||
## Targeting
|
||||
|
||||
Screenshots never resolve targeting. Full-page shots arrive downscaled JPEG (1024 px wide for a 2000-px device buffer; the factor varies), and `page.screenshot({ clip })` returns a PNG at device scale — a W×H CSS clip returns W·dpr × H·dpr px (CSS = clip offset + px/dpr). Icon buttons are 15–25 device px wide, so visual estimates carry ±20 px error, enough to hit the neighboring button or a gap. Target from the app's own hit-testing — sweep the row and click the run's center:
|
||||
|
||||
```js
|
||||
async function sweepRow(dpr, cssY, devFrom, devTo, step = 4) {
|
||||
const ranges = []; let cur = null;
|
||||
for (let dev = devFrom; dev <= devTo; dev += step) {
|
||||
await page.mouse.move(dev / dpr, cssY);
|
||||
await new Promise(r => setTimeout(r, 50));
|
||||
const s = await snap();
|
||||
const hi = s.frames[s.frames.length - 1].hi;
|
||||
if (cur && hi === cur.id) cur.end = dev;
|
||||
else { if (cur) ranges.push(cur); cur = { id: hi, start: dev, end: dev }; }
|
||||
}
|
||||
ranges.push(cur);
|
||||
return ranges.filter(r => r.id !== 0 && r.end - r.start >= 4);
|
||||
}
|
||||
```
|
||||
|
||||
- Same non-zero `hi` across consecutive steps = one widget; `hi = 0` = gap. Click the run's center: `click((r.start + r.end) / 2 / dpr, cssY)`.
|
||||
- **Layout is state-dependent:** docked panels (Statistics, Flame, …) resize the main window and shift the toolbar — **re-sweep after any state change.**
|
||||
- **Close popups before sweeping:** while a popup is open, hovers outside the popup can read `hi = 0` even over live widgets (verified with ZoomPopup over the toolbar). Clicking a % option in ZoomPopup does not close the popup — click an empty area first.
|
||||
- Hover IDs are stable across sessions (label hashes) — the map below holds for the default state (fresh load, no panels, 1600×900, dpr 1.25).
|
||||
- Zoomed region shots (for correlating IDs with icons): `page.screenshot({clip})` returns a Buffer — write it with Node `fs`, then `read` the file:
|
||||
|
||||
```js
|
||||
const fs = require('fs');
|
||||
const buf = await page.screenshot({ clip: { x: 0, y: 0, width: 720, height: 28 } });
|
||||
fs.writeFileSync('/tmp/toolbar-zoom.png', buf);
|
||||
```
|
||||
|
||||
### Toolbar map — default state (device px; css = device/1.25; row y css 15)
|
||||
|
||||
| device x | hover ID | function |
|
||||
|---|---|---|
|
||||
| 10–32 | 3313137574 | ⏻ power (red, leftmost) — **closes the trace view (DANGER)** |
|
||||
| 44–68 | 608241489 | ⚙ Options gear — opens the Options window (clickable; do not confuse with the power button) |
|
||||
| 81–185 | 2246346107 | 💬 Messages panel toggle |
|
||||
| 199–259 | 3177774389 | 🔍 Find zone toggle (search input hover ID 3637961452, css ~x 100–440, y ~90) |
|
||||
| 271–367 | 1419322276 | 📊 Statistics toggle |
|
||||
| 383–451 | 322727105 | 🔥 Flame graph toggle |
|
||||
| 463–551 | 37993378 | 💾 Memory graph toggle |
|
||||
| 567–667 | 2133895361 | ⚖ Compare toggle |
|
||||
| 679–735 | 1808024465 | ⌗ Info (trace information) toggle |
|
||||
| 751–775 | 2535445525 | 🛠 wrench → ToolsPopup (Playback, CPU data, Annotations, Limits, Wait stacks, Frame statistics) |
|
||||
| 791–811 | 3101356487 | 📖 book → User manual toggle |
|
||||
| 827–851 | 2335673581 | 🔍+ → ZoomPopup (50–300 % user scale) |
|
||||
| 864–888 | 1263603982 | ◀ previous frame — focuses the timeline on the previous frame (view range shrinks to the frame's timespan) |
|
||||
| ~890–1010 | 0 | frame set name + count text ("Frames: N") — LMB jumps to a specified frame (custom hit-test, like timeline zones) |
|
||||
| 1012–1036 | 2142681495 | ▶ next frame — focuses the timeline on the next frame (verified: view range 25.82 s → 203.38 ms) |
|
||||
| 1052–1072 | 2961929287 | ▼ frame set selection (switch the active frame set) |
|
||||
|
||||
Button names and functions are documented in the user manual's *Control menu* section (`manual/tracy.md`, generated into the profiler build directory by the build, e.g. `build/profiler/manual/tracy.md`). The web build omits *Connection* (live capture only) and *Tracy Assist* (desktop only).
|
||||
|
||||
## User scale (DPI zoom)
|
||||
|
||||
The 🔍+ button (hover ID 2335673581) — *Display scale* in the user manual — opens a ZoomPopup with 50–300 % steps.
|
||||
In the web build this scales the UI **layout only**: fonts, `Style::ScaleAllSizes`, and window sizes (`main.cpp SetupDPIScale`, `scale = devicePixelRatio × userScale`). The canvas buffer and the mouse→app mapping stay at `devicePixelRatio` (`BackendEmscripten.cpp`) — hit regions become physically larger in the same coordinate space, targeting precision is unchanged, and the standard click protocol works as-is.
|
||||
|
||||
Use it when small buttons are hard to hit or details are hard to read in screenshots. At 200 % every toolbar hit region is roughly 2× (verified: power 16→40 px, gear 25→50 px, Messages 105→190 px wide; row height 24→46 device px). The layout **reflows completely** at any scale — re-sweep after changing it and after setting it back. `userScale` is session-only unless Options → "Save UI scale" is on; a fresh page load starts at 100 %.
|
||||
|
||||
## Limitations
|
||||
|
||||
- A *connected* live-streaming client cannot be tested in the web build (the browser GUI cannot open a TCP server). The embedded-trace GUI is the live-app proxy: real trace data, full GUI — for live-client behavior use Route B.
|
||||
- `embed.tracy` (10 MB) is downloaded from share.nereid.pl at configure time — network needed once per fresh workspace; the file then lives in `$WS/build`.
|
||||
|
||||
## References
|
||||
|
||||
Sources for the behavior the rules above encode — consult them when re-verifying a constant or when a rule fails:
|
||||
|
||||
- `profiler/src/BackendEmscripten.cpp` — emscripten input handlers, canvas/dpr sizing, cursor mapping.
|
||||
- `profiler/src/main.cpp:540-574` — idle gate (`activeFrames` budget).
|
||||
- `profiler/src/profiler/TracyMouse.cpp` — per-frame click state cache.
|
||||
- `profiler/CMakeLists.txt:334-353` — emscripten link options.
|
||||
- ImGui 1.92.9b (vendored copy in the CPM cache, `~/.cache/cpm/imgui/`): `imgui_widgets.cpp:483-545` (click semantics table), `imgui.cpp:11278-11403` (event trickling), `imgui.cpp:1736` (trickle default on), `imgui.cpp:1992-2016` (AddMousePosEvent floor/dedup).
|
||||
- Emscripten 5.0.7: `src/lib/libhtml5.js` (`fillMouseEventData`, `targetX = e.clientX - (rect.left|0)` into HEAP32), `system/include/emscripten/html5.h` (`EmscriptenMouseEvent.targetX` is `int`; `EmscriptenWheelEvent` embeds a `mouse` sub-struct).
|
||||
- Upstream: imgui issue #4921 (new input event API — events spread over multiple frames), PR #2525 (same-frame click/release), issue #1992 (rapid down/up "soft clicks" dropped).
|
||||
|
||||
# Route B — Native GUI (X11, headless)
|
||||
|
||||
Run the native (GLFW) GUI on a virtual X server for what Route A cannot test: a live TCP connection to a client, the native file dialogs (save/open flows), and X11 input semantics. Stack: Xvfb + openbox + xdotool + ImageMagick `import`. Constants marked M were verified on this workstation (1280x800 screen, openbox, profiler window client area at (1,20)); re-verify after any screen/WM change, and always confirm against a screenshot before clicking.
|
||||
|
||||
## Build
|
||||
|
||||
```sh
|
||||
cmake -S profiler -B /tmp/prof-x11 -DCMAKE_BUILD_TYPE=Release -DLEGACY=ON -DGTK_FILESELECTOR=ON
|
||||
cmake --build /tmp/prof-x11 --target tracy-profiler -j$(nproc)
|
||||
```
|
||||
|
||||
- `LEGACY=ON` selects the X11 (GLFW) backend; the Linux default is Wayland.
|
||||
- `GTK_FILESELECTOR=ON` routes NFD through GTK. **Without it** the default Linux NFD uses the XDG desktop portal and fails headless with the notification "File selector is not available".
|
||||
- Verify after building: `ldd /tmp/prof-x11/tracy-profiler | grep -c gtk` ≥ 1.
|
||||
|
||||
## Services
|
||||
|
||||
```
|
||||
hub op=start name=xvfb application=Xvfb args=[":99","-screen","0","1280x800x24"]
|
||||
```
|
||||
|
||||
Ready when `/tmp/.X11-unix/X99` exists — check the socket. (If you add `-nolisten tcp` to the Xvfb args, a TCP port readiness check cannot work; the UNIX socket is then the only listener.) Then:
|
||||
|
||||
```sh
|
||||
DISPLAY=:99 nohup openbox >/dev/null 2>&1 &
|
||||
```
|
||||
|
||||
**openbox is required.** Without a window manager the window lands at an arbitrary position, `xdotool windowactivate` fails ("WM claims not to support _NET_ACTIVE_WINDOW"), and keyboard focus has no owner. Under openbox the profiler window is placed deterministically (M: (1,20), 1278x775 on a 1280x800 screen).
|
||||
|
||||
## Run
|
||||
|
||||
```sh
|
||||
DISPLAY=:99 LIBGL_ALWAYS_SOFTWARE=1 nohup /tmp/prof-x11/tracy-profiler >gui.log 2>&1 &
|
||||
```
|
||||
|
||||
- `LIBGL_ALWAYS_SOFTWARE=1` — no GPU; mesa swrast renders.
|
||||
- Window: `DISPLAY=:99 xdotool search --name "Tracy Profiler"` → `getwindowgeometry` for the origin; `windowactivate --sync` to focus.
|
||||
- Live test client: `tracy-monitor -p $(pgrep -n sleep)` style — attach to a long-lived process; the in-process client listens on 8086 and advertises via UDP (discovery works headless; the client line appears under "Discovered clients").
|
||||
|
||||
## Interaction rules
|
||||
|
||||
1. **Verify every click with a screenshot diff** — `import -window root` before and after, then PIL `ImageChops.difference(a, b).getbbox()`: no (or irrelevant) bbox = the click missed. Expect at least one swallowed click; re-issue it and re-verify.
|
||||
2. Move before click; sleep ≥0.3 s between two clicks at the same spot (ImGui double-click threshold is 0.3 s).
|
||||
3. Keyboard (`xdotool key`) is reliable once openbox owns focus.
|
||||
4. First launch only: an achievements prompt appears bottom-right — click "No" (M: 725,585). The choice persists in the Tracy config; later launches skip it.
|
||||
5. A stale "Client not ready / another server" notification means the client was replaced underneath the GUI — click **Reconnect** (M: 738,574); there is no automatic retry.
|
||||
|
||||
## Coordinates (M: screen px, 1280x800, window at (1,20))
|
||||
|
||||
|Target|Coords|
|
||||
|---|---|
|
||||
|Get started → Connect|101,227|
|
||||
|Get started → wrench (About panel)|317,120|
|
||||
|Connection popup → Save trace…|64,202|
|
||||
|Connection popup → Reconnect|738,574|
|
||||
|GTK save dialog → Save button|1195,773|
|
||||
|GTK overwrite confirmation → Replace|790,482|
|
||||
|Tracy save-confirmation → Save trace|757,540|
|
||||
|
||||
Directly clicked and verified: Connect, Save trace…, GTK Save, Replace, and the save-confirmation button. Derived as the verified window-relative offset translated to the openbox window origin (confirm on first use): wrench, Reconnect, achievements "No".
|
||||
|
||||
The Get-started panel, connection popup, and the two confirmation panels keep fixed offsets inside the profiler window; the GTK dialogs are separate top-level windows sized to the screen. Derive any missing coordinate from a screenshot rather than guessing.
|
||||
|
||||
## Save flow (end-to-end)
|
||||
|
||||
1. Start the client, click **Connect** (the GUI never auto-connects).
|
||||
2. The connection popup opens automatically on connect; click **Save trace…**.
|
||||
3. GTK dialog: the Name entry is focused and the last-used directory is preselected; `xdotool type --delay 30 <name>`; click **Save** (1195,773).
|
||||
4. Existing target file → a separate overwrite-confirmation window appears; click **Replace** (790,482).
|
||||
5. Tracy's own confirmation panel appears (shows the final `Path:`); click its **Save trace** (757,540).
|
||||
6. Verify the file (below).
|
||||
|
||||
## File and connection checks
|
||||
|
||||
- Live connection: `ss -tnp | grep 8086` shows `ESTAB` between `tracy-profiler` and the client process; the window title becomes `<program> @ <date> - Tracy Profiler X.Y.Z`.
|
||||
- Saved `.tracy`: first 4 bytes = `74 72 FD 50`; `tail -c +11 file | zstd -t` → `premature end` means the frame decodes fully (expected — the cut falls past the final frame into trailing metadata); `unsupported format` means a bad offset or a non-trace file.
|
||||
- No `file.tmp` may remain after a completed save; a save killed mid-write leaves the previous file intact (the GUI writes through `SafeFileWrite`, tmp + rename-on-commit).
|
||||
- Video evidence while interacting: `ffmpeg -f x11grab -video_size 1280x800 -i :99 -t N -c:v libx264 out.mp4` (background it; it records the whole interaction).
|
||||
|
||||
## Limitations
|
||||
|
||||
- No debug harness — the screenshot diff is the only oracle; targeting is coordinate-from-screenshot, slower and coarser than Route A's hit-test sweeps.
|
||||
- The verified coordinates are tied to the M constants (1280x800 screen, openbox default theme, 100 % UI scale); re-derive from a screenshot if any of them changes.
|
||||
- The GTK dialogs are separate top-level windows whose layout follows the system GTK theme.
|
||||
|
||||
## Teardown
|
||||
|
||||
```sh
|
||||
pkill -f prof-x11; pkill -f tracy-monitor
|
||||
pkill -f "sleep 600" # the test target from §Run — adjust to what you started
|
||||
pkill openbox
|
||||
# hub op=stop name=xvfb
|
||||
```
|
||||
|
||||
## References
|
||||
|
||||
- `profiler/src/BackendGlfw.cpp` — X11/GLFW input handlers (mouse/keyboard → ImGui).
|
||||
- `profiler/CMakeLists.txt:5-7` — `NO_FILESELECTOR`, `GTK_FILESELECTOR`, `LEGACY` (X11 vs default Wayland) options.
|
||||
- `cmake/vendor.cmake:222-242` — NFD packaging: `NFD_PORTAL` on by default on Linux, the `GTK_FILESELECTOR` switch, the `nfd-xdg-foreign-v2.patch`.
|
||||
- `server/TracySafeFileWrite.hpp` — the GUI save's tmp + rename-on-commit (the invariants in §File and connection checks).
|
||||
- NFD (btzy/nativefiledialog-extended, pinned in `cmake/vendor.cmake`) — the GTK dialog behavior (Name entry focus, last-directory memory, overwrite confirmation).
|
||||
@@ -1,221 +0,0 @@
|
||||
diff -r a/profiler/CMakeLists.txt b/profiler/CMakeLists.txt
|
||||
--- a/profiler/CMakeLists.txt
|
||||
+++ b/profiler/CMakeLists.txt
|
||||
@@ -340,7 +340,7 @@
|
||||
-sMAXIMUM_MEMORY=4gb
|
||||
-sSTACK_SIZE=1048576
|
||||
-sPTHREAD_POOL_SIZE=8
|
||||
- -sEXPORTED_FUNCTIONS=_main,_nativeOpenFile,_tracy_paste_clipboard
|
||||
+ -sEXPORTED_FUNCTIONS=_main,_nativeOpenFile,_tracy_paste_clipboard,_debug_snapshot,_debug_clear
|
||||
-sEXPORTED_RUNTIME_METHODS=ccall
|
||||
-sENVIRONMENT=web,worker
|
||||
--preload-file embed.tracy
|
||||
diff -r a/profiler/src/BackendEmscripten.cpp b/profiler/src/BackendEmscripten.cpp
|
||||
--- a/profiler/src/BackendEmscripten.cpp
|
||||
+++ b/profiler/src/BackendEmscripten.cpp
|
||||
@@ -1,6 +1,8 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
+#include <cstdarg>
|
||||
+#include <algorithm>
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
#include <GLES2/gl2.h>
|
||||
@@ -10,7 +12,146 @@
|
||||
#include "Backend.hpp"
|
||||
#include "RunQueue.hpp"
|
||||
#include "profiler/TracyImGui.hpp"
|
||||
+#include "imgui_internal.h"
|
||||
|
||||
+// ================= DEBUG HARNESS (temporary copy, not for upstream) =================
|
||||
+struct DbgEvent
|
||||
+{
|
||||
+ int type; // 0=move 1=down 2=up 3=enter 4=leave 5=wheel
|
||||
+ int button;
|
||||
+ int targetX;
|
||||
+ int targetY;
|
||||
+ double appX; // what was passed to ImGui (targetX * dpr), -1 if n/a
|
||||
+ double appY;
|
||||
+ double t; // DOMHighResTimeStamp
|
||||
+ int wheelX;
|
||||
+ int wheelY;
|
||||
+};
|
||||
+struct DbgFrame
|
||||
+{
|
||||
+ double t;
|
||||
+ int tick; // emscripten main-loop tick count (rAF)
|
||||
+ int imguiFrame; // ImGui::GetFrameCount()
|
||||
+ float mx, my; // io.MousePos
|
||||
+ int md0, md1, md2;
|
||||
+ int queue; // pending ImGui input events
|
||||
+ int wasActive; // tracy::s_wasActive at tick start
|
||||
+ unsigned hi; // ImGui hovered item ID
|
||||
+ unsigned ai; // ImGui active item ID
|
||||
+};
|
||||
+static DbgEvent s_dbgEvents[512];
|
||||
+static int s_dbgEventHead = 0, s_dbgEventN = 0;
|
||||
+static DbgFrame s_dbgFrames[512];
|
||||
+static int s_dbgFrameHead = 0, s_dbgFrameN = 0;
|
||||
+static int s_dbgTick = 0;
|
||||
+
|
||||
+static void DbgPushEvent( int type, int button, int tx, int ty, double ax, double ay, double t, int wx = 0, int wy = 0 )
|
||||
+{
|
||||
+ auto& e = s_dbgEvents[s_dbgEventHead];
|
||||
+ e.type = type; e.button = button; e.targetX = tx; e.targetY = ty;
|
||||
+ e.appX = ax; e.appY = ay; e.t = t; e.wheelX = wx; e.wheelY = wy;
|
||||
+ s_dbgEventHead = ( s_dbgEventHead + 1 ) % 512;
|
||||
+ if ( s_dbgEventN < 512 ) s_dbgEventN++;
|
||||
+}
|
||||
+
|
||||
+static void DbgPushFrame()
|
||||
+{
|
||||
+ auto& f = s_dbgFrames[s_dbgFrameHead];
|
||||
+ auto& io = ImGui::GetIO();
|
||||
+ f.t = EM_ASM_DOUBLE( { return performance.now(); } );
|
||||
+ f.tick = s_dbgTick;
|
||||
+ f.imguiFrame = ImGui::GetFrameCount();
|
||||
+ f.mx = io.MousePos.x; f.my = io.MousePos.y;
|
||||
+ f.md0 = io.MouseDown[0]; f.md1 = io.MouseDown[1]; f.md2 = io.MouseDown[2];
|
||||
+ auto ctx = ImGui::GetCurrentContext();
|
||||
+ f.queue = ctx ? int( ctx->InputEventsQueue.Size ) : -1;
|
||||
+ f.wasActive = tracy::s_wasActive;
|
||||
+ f.hi = ctx ? ctx->HoveredId : 0;
|
||||
+ f.ai = ctx ? ctx->ActiveId : 0;
|
||||
+ s_dbgFrameHead = ( s_dbgFrameHead + 1 ) % 512;
|
||||
+ if ( s_dbgFrameN < 512 ) s_dbgFrameN++;
|
||||
+}
|
||||
+
|
||||
+extern "C" EMSCRIPTEN_KEEPALIVE void debug_clear()
|
||||
+{
|
||||
+ s_dbgEventHead = s_dbgEventN = s_dbgFrameHead = s_dbgFrameN = 0;
|
||||
+}
|
||||
+
|
||||
+// Escape a C string for embedding in a JSON string literal (", \, control chars).
|
||||
+static void JsonEscape( char* out, size_t outsz, const char* in )
|
||||
+{
|
||||
+ size_t o = 0;
|
||||
+ for( const unsigned char* p = ( const unsigned char* )in; *p; p++ )
|
||||
+ {
|
||||
+ if ( *p == '"' || *p == '\\' )
|
||||
+ {
|
||||
+ if ( o + 2 >= outsz ) break;
|
||||
+ out[o++] = '\\';
|
||||
+ out[o++] = char( *p );
|
||||
+ }
|
||||
+ else if ( *p < 0x20 )
|
||||
+ {
|
||||
+ if ( o + 6 >= outsz ) break;
|
||||
+ o += size_t( snprintf( out + o, outsz - o, "\\u%04x", *p ) );
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if ( o + 1 >= outsz ) break;
|
||||
+ out[o++] = char( *p );
|
||||
+ }
|
||||
+ }
|
||||
+ out[o] = 0;
|
||||
+}
|
||||
+
|
||||
+extern "C" EMSCRIPTEN_KEEPALIVE const char* debug_snapshot()
|
||||
+{
|
||||
+ static char buf[512 * 1024];
|
||||
+ size_t off = 0;
|
||||
+ auto put = [ & ]( const char* fmt, ... )
|
||||
+ {
|
||||
+ if ( off + 1 >= sizeof( buf ) ) return;
|
||||
+ va_list args;
|
||||
+ va_start( args, fmt );
|
||||
+ int n = vsnprintf( buf + off, sizeof( buf ) - off - 1, fmt, args );
|
||||
+ va_end( args );
|
||||
+ if ( n > 0 ) off = std::min( off + size_t( n ), sizeof( buf ) - 1 );
|
||||
+ };
|
||||
+ const auto dpr = EM_ASM_DOUBLE( { return window.devicePixelRatio; } );
|
||||
+ const auto innerW = EM_ASM_INT( { return window.innerWidth; } );
|
||||
+ const auto innerH = EM_ASM_INT( { return window.innerHeight; } );
|
||||
+ const auto bufW = EM_ASM_INT( { return document.getElementById( 'canvas' ).width; } );
|
||||
+ const auto bufH = EM_ASM_INT( { return document.getElementById( 'canvas' ).height; } );
|
||||
+ const auto rectL = EM_ASM_DOUBLE( { var r = document.getElementById( 'canvas' ).getBoundingClientRect(); return r.left; } );
|
||||
+ const auto rectT = EM_ASM_DOUBLE( { var r = document.getElementById( 'canvas' ).getBoundingClientRect(); return r.top; } );
|
||||
+ const auto rectW = EM_ASM_DOUBLE( { var r = document.getElementById( 'canvas' ).getBoundingClientRect(); return r.width; } );
|
||||
+ const auto rectH = EM_ASM_DOUBLE( { var r = document.getElementById( 'canvas' ).getBoundingClientRect(); return r.height; } );
|
||||
+ char title[256];
|
||||
+ EM_ASM( { stringToUTF8( document.title, $0, 256 ); }, title );
|
||||
+ char cursor[64];
|
||||
+ EM_ASM( { stringToUTF8( document.getElementById( 'canvas' ).style.cursor || "", $0, 64 ); }, cursor );
|
||||
+ char title_e[1536];
|
||||
+ char cursor_e[384];
|
||||
+ JsonEscape( title_e, sizeof( title_e ), title );
|
||||
+ JsonEscape( cursor_e, sizeof( cursor_e ), cursor );
|
||||
+ put( "{\"dpr\":%.6f,\"innerW\":%d,\"innerH\":%d,\"bufW\":%d,\"bufH\":%d,\"rectL\":%.3f,\"rectT\":%.3f,\"rectW\":%.3f,\"rectH\":%.3f,\"title\":\"%s\",\"cursor\":\"%s\",\"frames\":[", dpr, innerW, innerH, bufW, bufH, rectL, rectT, rectW, rectH, title_e, cursor_e );
|
||||
+ const int fn = std::min( s_dbgFrameN, 64 );
|
||||
+ for ( int i = 0; i < fn; i++ )
|
||||
+ {
|
||||
+ auto& f = s_dbgFrames[ ( s_dbgFrameHead - fn + i + 512 ) % 512 ];
|
||||
+ put( "%s{\"t\":%.3f,\"tick\":%d,\"f\":%d,\"mx\":%.1f,\"my\":%.1f,\"md\":[%d,%d,%d],\"q\":%d,\"wa\":%d,\"hi\":%u,\"ai\":%u}", i ? "," : "", f.t, f.tick, f.imguiFrame, f.mx, f.my, f.md0, f.md1, f.md2, f.queue, f.wasActive, f.hi, f.ai );
|
||||
+ }
|
||||
+ put( "],\"events\":[");
|
||||
+ const int en = std::min( s_dbgEventN, 64 );
|
||||
+ for ( int i = 0; i < en; i++ )
|
||||
+ {
|
||||
+ auto& e = s_dbgEvents[ ( s_dbgEventHead - en + i + 512 ) % 512 ];
|
||||
+ put( "%s{\"type\":%d,\"btn\":%d,\"tx\":%d,\"ty\":%d,\"ax\":%.3f,\"ay\":%.3f,\"t\":%.3f,\"wx\":%d,\"wy\":%d}", i ? "," : "", e.type, e.button, e.targetX, e.targetY, e.appX, e.appY, e.t, e.wheelX, e.wheelY );
|
||||
+ }
|
||||
+ put( "]}");
|
||||
+ buf[off] = 0;
|
||||
+ return buf;
|
||||
+}
|
||||
+
|
||||
static std::function<void()> s_redraw;
|
||||
static std::function<void(float)> s_scaleChanged;
|
||||
static std::function<int(void)> s_isBusy;
|
||||
@@ -223,32 +364,38 @@
|
||||
emscripten_set_mousedown_callback( "#canvas", nullptr, EM_TRUE, []( int, const EmscriptenMouseEvent* e, void* ) -> EM_BOOL {
|
||||
ImGui::GetIO().AddMouseButtonEvent( e->button == 0 ? 0 : 3 - e->button, true );
|
||||
tracy::s_wasActive = true;
|
||||
+ DbgPushEvent( 1, e->button, e->targetX, e->targetY, -1, -1, e->timestamp );
|
||||
return EM_TRUE;
|
||||
} );
|
||||
emscripten_set_mouseup_callback( "#canvas", nullptr, EM_TRUE, []( int, const EmscriptenMouseEvent* e, void* ) -> EM_BOOL {
|
||||
ImGui::GetIO().AddMouseButtonEvent( e->button == 0 ? 0 : 3 - e->button, false );
|
||||
tracy::s_wasActive = true;
|
||||
+ DbgPushEvent( 2, e->button, e->targetX, e->targetY, -1, -1, e->timestamp );
|
||||
return EM_TRUE;
|
||||
} );
|
||||
emscripten_set_mousemove_callback( "#canvas", nullptr, EM_TRUE, []( int, const EmscriptenMouseEvent* e, void* ) -> EM_BOOL {
|
||||
const auto scale = EM_ASM_DOUBLE( { return window.devicePixelRatio; } );
|
||||
ImGui::GetIO().AddMousePosEvent( e->targetX * scale, e->targetY * scale );
|
||||
tracy::s_wasActive = true;
|
||||
+ DbgPushEvent( 0, -1, e->targetX, e->targetY, e->targetX * scale, e->targetY * scale, e->timestamp );
|
||||
return EM_TRUE;
|
||||
} );
|
||||
- emscripten_set_mouseleave_callback( "#canvas", nullptr, EM_TRUE, []( int, const EmscriptenMouseEvent*, void* ) -> EM_BOOL {
|
||||
+ emscripten_set_mouseleave_callback( "#canvas", nullptr, EM_TRUE, []( int, const EmscriptenMouseEvent* e, void* ) -> EM_BOOL {
|
||||
ImGui::GetIO().AddFocusEvent( false );
|
||||
tracy::s_wasActive = true;
|
||||
+ DbgPushEvent( 4, -1, e->targetX, e->targetY, -1, -1, e->timestamp );
|
||||
return EM_TRUE;
|
||||
} );
|
||||
- emscripten_set_mouseenter_callback( "#canvas", nullptr, EM_TRUE, []( int, const EmscriptenMouseEvent*, void* ) -> EM_BOOL {
|
||||
+ emscripten_set_mouseenter_callback( "#canvas", nullptr, EM_TRUE, []( int, const EmscriptenMouseEvent* e, void* ) -> EM_BOOL {
|
||||
ImGui::GetIO().AddFocusEvent( true );
|
||||
tracy::s_wasActive = true;
|
||||
+ DbgPushEvent( 3, -1, e->targetX, e->targetY, -1, -1, e->timestamp );
|
||||
return EM_TRUE;
|
||||
} );
|
||||
emscripten_set_wheel_callback( "#canvas", nullptr, EM_TRUE, []( int, const EmscriptenWheelEvent* e, void* ) -> EM_BOOL {
|
||||
ImGui::GetIO().AddMouseWheelEvent( e->deltaX * -0.05, e->deltaY * -0.05 );
|
||||
tracy::s_wasActive = true;
|
||||
+ DbgPushEvent( 5, -1, e->mouse.targetX, e->mouse.targetY, -1, -1, e->mouse.timestamp, int( e->deltaX ), int( e->deltaY ) );
|
||||
return EM_TRUE;
|
||||
} );
|
||||
emscripten_set_keydown_callback( EMSCRIPTEN_EVENT_TARGET_WINDOW, nullptr, EM_TRUE, [] ( int, const EmscriptenKeyboardEvent* e, void* ) -> EM_BOOL {
|
||||
@@ -298,6 +445,8 @@
|
||||
|
||||
void Backend::NewFrame( int& w, int& h )
|
||||
{
|
||||
+ s_dbgTick++;
|
||||
+ DbgPushFrame();
|
||||
const auto scale = GetDpiScale();
|
||||
if( scale != s_prevScale )
|
||||
{
|
||||
@@ -1,102 +0,0 @@
|
||||
#!/bin/sh
|
||||
# setup.sh - build the instrumented Tracy web GUI workspace (see SKILL.md).
|
||||
#
|
||||
# Usage:
|
||||
# sh setup.sh
|
||||
# TRACY_WEB_WS=/custom/ws TRACY_WEB_REPO=<repo> sh setup.sh
|
||||
#
|
||||
# Idempotent: reuses an existing source copy and build dir, skips
|
||||
# already-applied harness patch hunks, rebuilds.
|
||||
set -e
|
||||
|
||||
WS="${TRACY_WEB_WS:-/tmp/tracy-protocol}"
|
||||
# The skill is project-scoped: <repo>/.omp/skills/tracy-gui-verify/
|
||||
SKILL_DIR=$(cd "$(dirname "$0")" && pwd)
|
||||
if [ -n "$TRACY_WEB_REPO" ]; then
|
||||
REPO="$TRACY_WEB_REPO"
|
||||
else
|
||||
REPO=$(cd "$SKILL_DIR/../../.." 2>/dev/null && pwd) || REPO=""
|
||||
fi
|
||||
EMSDK="${EMSDK_DIR:-$HOME/emsdk}"
|
||||
|
||||
[ -x "$EMSDK/emsdk" ] || { echo "error: emsdk not found at $EMSDK (set EMSDK_DIR)" >&2; exit 1; }
|
||||
[ -f "$REPO/profiler/CMakeLists.txt" ] || { echo "error: not a Tracy repo: '$REPO' (set TRACY_WEB_REPO)" >&2; exit 1; }
|
||||
|
||||
. "$EMSDK/emsdk_env.sh" >/dev/null 2>&1 || true
|
||||
command -v emcc >/dev/null || { echo "error: emcc not on PATH after emsdk_env.sh" >&2; exit 1; }
|
||||
|
||||
if [ ! -f "$WS/src/profiler/CMakeLists.txt" ]; then
|
||||
echo "[setup] fresh source copy -> $WS/src (from $REPO)"
|
||||
mkdir -p "$WS/src"
|
||||
# -C applies to both archive creation and extraction; exclude all build dirs
|
||||
tar -C "$REPO" \
|
||||
--exclude=.git \
|
||||
--exclude='*/build*' \
|
||||
-cf - . | tar -xf - -C "$WS/src"
|
||||
else
|
||||
echo "[setup] reusing source copy in $WS/src (copy changed repo files into it first)"
|
||||
fi
|
||||
|
||||
# The harness is fully in place iff each patch hunk's signature line is present.
|
||||
# patch --forward skips a whole file once its first hunk is detected as already
|
||||
# applied, so a failed later hunk is invisible in patch's output and exit code —
|
||||
# verify the content instead of trusting either.
|
||||
harness_complete()
|
||||
{
|
||||
grep -q '_debug_snapshot' "$WS/src/profiler/CMakeLists.txt" \
|
||||
&& grep -qF 'EMSCRIPTEN_KEEPALIVE const char* debug_snapshot' "$WS/src/profiler/src/BackendEmscripten.cpp" \
|
||||
&& grep -qF 'DbgPushEvent( 1,' "$WS/src/profiler/src/BackendEmscripten.cpp" \
|
||||
&& grep -qF 's_dbgTick++;' "$WS/src/profiler/src/BackendEmscripten.cpp"
|
||||
}
|
||||
|
||||
echo "[setup] applying instrumentation harness"
|
||||
if harness_complete; then
|
||||
echo "[setup] harness already applied"
|
||||
rm -f "$WS/src/profiler/CMakeLists.txt.rej" "$WS/src/profiler/src/BackendEmscripten.cpp.rej"
|
||||
else
|
||||
rm -f "$WS/src/profiler/CMakeLists.txt.rej" "$WS/src/profiler/src/BackendEmscripten.cpp.rej"
|
||||
patch -p1 -d "$WS/src" --forward --no-backup-if-mismatch < "$SKILL_DIR/harness.patch" \
|
||||
|| {
|
||||
if harness_complete; then
|
||||
# mixed run: some hunks already present (skipped), the rest applied
|
||||
rm -f "$WS/src/profiler/CMakeLists.txt.rej" "$WS/src/profiler/src/BackendEmscripten.cpp.rej"
|
||||
else
|
||||
rej=$(ls "$WS/src/profiler/CMakeLists.txt.rej" "$WS/src/profiler/src/BackendEmscripten.cpp.rej" 2>/dev/null || true)
|
||||
if [ -n "$rej" ]; then
|
||||
kept="The unapplied hunks are kept in:
|
||||
$(printf '%s\n' $rej | sed 's/^/ /')"
|
||||
else
|
||||
kept="No .rej files were produced (fatal patch error); the patch output above is the only evidence."
|
||||
fi
|
||||
cat >&2 <<EOF
|
||||
error: harness patch did not fully apply — $WS/src has drifted from the repo.
|
||||
$kept
|
||||
Do not build from this workspace. Either re-apply the harness by hand
|
||||
(SKILL.md, "After editing the GUI in the repo"), or start fresh:
|
||||
rm -rf $WS && sh <this-skill-dir>/setup.sh
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
fi
|
||||
|
||||
if [ ! -f "$WS/build/CMakeCache.txt" ]; then
|
||||
echo "[setup] configuring"
|
||||
cmake -S "$WS/src/profiler" -B "$WS/build" \
|
||||
-DCMAKE_TOOLCHAIN_FILE="$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCPM_SOURCE_CACHE="$HOME/.cache/cpm"
|
||||
fi
|
||||
|
||||
echo "[setup] building (first full build ~3-5 min, incremental ~30 s)"
|
||||
cmake --build "$WS/build" -j "$(nproc)"
|
||||
|
||||
cat <<EOF
|
||||
[setup] done.
|
||||
workspace : $WS
|
||||
repo : $REPO
|
||||
emcc : $(emcc --version | sed -n 1p)
|
||||
serve : hub op=start name=tracy-web application=python3 args=[$WS/build/httpd.py] cwd=$WS/build ready={port:8000} persist=true
|
||||
open : browser open url=http://127.0.0.1:8000/index.html viewport={width:1600,height:900}
|
||||
ready : document.title matches / - Tracy Profiler/ (see SKILL.md)
|
||||
EOF
|
||||
17
.vscode/c_cpp_properties.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Linux",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**",
|
||||
"/usr/include/freetype2"
|
||||
],
|
||||
"defines": [],
|
||||
"compilerPath": "/usr/bin/clang++",
|
||||
"cStandard": "c11",
|
||||
"cppStandard": "c++17",
|
||||
"intelliSenseMode": "clang-x64"
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
7
.vscode/extensions.json
vendored
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"llvm-vs-code-extensions.vscode-clangd",
|
||||
"vadimcn.vscode-lldb",
|
||||
"ms-vscode.cmake-tools"
|
||||
]
|
||||
}
|
||||
55
.vscode/launch.json
vendored
@@ -1,13 +1,58 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Launch",
|
||||
"name": "Launch Profiler GUI",
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"program": "${command:cmake.launchTargetPath}",
|
||||
"program": "${workspaceFolder}/profiler/build/unix/Tracy-debug",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}"
|
||||
}
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}",
|
||||
"environment": [],
|
||||
"externalConsole": false,
|
||||
"preLaunchTask": "Build Profiler GUI",
|
||||
"console": "internalConsole",
|
||||
"internalConsoleOptions": "neverOpen"
|
||||
},
|
||||
{
|
||||
"name": "Launch capture tool",
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/capture/build/unix/capture-debug",
|
||||
"args": [],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}",
|
||||
"environment": [],
|
||||
"externalConsole": false,
|
||||
"preLaunchTask": "Build capture tool"
|
||||
},
|
||||
{
|
||||
"name": "Launch update tool",
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/update/build/unix/update-debug",
|
||||
"args": [],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}",
|
||||
"environment": [],
|
||||
"externalConsole": false,
|
||||
"preLaunchTask": "Build update tool"
|
||||
},
|
||||
{
|
||||
"name": "Launch test application",
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/test/tracy_test",
|
||||
"args": [],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}/test",
|
||||
"environment": [],
|
||||
"externalConsole": false,
|
||||
"preLaunchTask": "Build test application"
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
20
.vscode/settings.json
vendored
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"cmake.sourceDirectory": [
|
||||
"${workspaceFolder}/profiler",
|
||||
"${workspaceFolder}/capture",
|
||||
"${workspaceFolder}/csvexport",
|
||||
"${workspaceFolder}/import",
|
||||
"${workspaceFolder}/merge",
|
||||
"${workspaceFolder}/update",
|
||||
"${workspaceFolder}/tests/tracy",
|
||||
"${workspaceFolder}",
|
||||
],
|
||||
"cmake.buildDirectory": "${sourceDirectory}/build",
|
||||
"cmake.autoSelectActiveFolder": false,
|
||||
"cmake.options.advanced": {
|
||||
"folder": { "statusBarVisibility": "visible" },
|
||||
"variant": { "statusBarVisibility": "compact" }
|
||||
},
|
||||
"cmake.copyCompileCommands": "${workspaceFolder}/compile_commands.json",
|
||||
"lldb.launch.initCommands": ["command script import ${workspaceRoot}/extra/natvis.py"],
|
||||
}
|
||||
88
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Build Profiler GUI",
|
||||
"type": "shell",
|
||||
"command": "CC=clang CXX=clang++ make debug -C profiler/build/unix -j `nproc`",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"presentation": {
|
||||
"close": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Build capture tool",
|
||||
"type": "shell",
|
||||
"command": "CC=clang CXX=clang++ make debug -C capture/build/unix -j `nproc`",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"presentation": {
|
||||
"close": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Build csvexport tool",
|
||||
"type": "shell",
|
||||
"command": "CC=clang CXX=clang++ make debug -C csvexport/build/unix -j `nproc`",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"presentation": {
|
||||
"close": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Build import-chrome tool",
|
||||
"type": "shell",
|
||||
"command": "CC=clang CXX=clang++ make debug -C import-chrome/build/unix -j `nproc`",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Build update tool",
|
||||
"type": "shell",
|
||||
"command": "CC=clang CXX=clang++ make debug -C update/build/unix -j `nproc`",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"presentation": {
|
||||
"close": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Build client library",
|
||||
"type": "shell",
|
||||
"command": "CC=clang CXX=clang++ make debug -C library/unix -j `nproc`",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"presentation": {
|
||||
"close": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Build test application",
|
||||
"type": "shell",
|
||||
"command": "CC=clang CXX=clang++ make OPTFLAGS=-DTRACY_VERBOSE\\ -fno-omit-frame-pointer\\ -march=native\\ -g -C test -j `nproc`",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"presentation": {
|
||||
"close": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
20
AUTHORS
Normal file
@@ -0,0 +1,20 @@
|
||||
Bartosz Taudul <wolf@nereid.pl>
|
||||
Kamil Klimek <kamil.klimek@sharkbits.com> (initial find zone implementation)
|
||||
Bartosz Szreder <zgredder@gmail.com> (view/worker split)
|
||||
Arvid Gerstmann <dev@arvid-g.de> (compatibility fixes)
|
||||
Rokas Kupstys <rokups@zoho.com> (compatibility fixes, initial CI work, MingW support)
|
||||
Till Rathmann <till.rathmann@gmx.de> (DLL support)
|
||||
Sherief Farouk <sherief.personal@gmail.com> (compatibility fixes)
|
||||
Dedmen Miller <dedmen@dedmen.de> (find zone bug fixes, improvements)
|
||||
Michał Cichoń <michcic@gmail.com> (OSX call stack decoding backport)
|
||||
Thales Sabino <thales@codeplay.com> (OpenCL support)
|
||||
Andrew Depke <andrewdepke@gmail.com> (Direct3D 12 support)
|
||||
Simonas Kazlauskas <git@kazlauskas.me> (OSX CI, external bindings)
|
||||
Jakub Žádník <kubouch@gmail.com> (csvexport utility)
|
||||
Andrey Voroshilov <andrew.voroshilov@gmail.com> (multi-DLL fixes)
|
||||
Benoit Jacob <benoitjacob@google.com> (Android improvements)
|
||||
David Farrel <dafarrel@adobe.com> (Direct3D 11 support)
|
||||
Terence Rokop <rokopt@sharpears.net> (Non-reentrant zones)
|
||||
Lukas Berbuer <lukas.berbuer@gmail.com> (CMake integration)
|
||||
Xavier Bouchoux <xavierb@gmail.com> (sample data in find zone)
|
||||
Balazs Kovacsics <kovab93@gmail.com> (Universal Windows Platform)
|
||||
248
CMakeLists.txt
@@ -1,85 +1,48 @@
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
# Run version helper script
|
||||
include(cmake/version.cmake)
|
||||
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})
|
||||
|
||||
file(GENERATE OUTPUT .gitignore CONTENT "*")
|
||||
|
||||
if(${BUILD_SHARED_LIBS})
|
||||
set(DEFAULT_STATIC OFF)
|
||||
set(DEFAULT_STATIC OFF)
|
||||
else()
|
||||
set(DEFAULT_STATIC ON)
|
||||
set(DEFAULT_STATIC ON)
|
||||
endif()
|
||||
|
||||
option(TRACY_STATIC "Whether to build Tracy as a static library" ${DEFAULT_STATIC})
|
||||
option(TRACY_Fortran "Build Fortran bindings" OFF)
|
||||
option(TRACY_LTO "Enable Link-Time optimization" OFF)
|
||||
|
||||
if(TRACY_Fortran)
|
||||
enable_language(Fortran)
|
||||
set(CMAKE_Fortran_VERSION 2003)
|
||||
endif()
|
||||
|
||||
if(TRACY_LTO OR CMAKE_INTERPROCEDURAL_OPTIMIZATION)
|
||||
include(CheckIPOSupported)
|
||||
check_ipo_supported(RESULT LTO_SUPPORTED)
|
||||
if(NOT LTO_SUPPORTED)
|
||||
message(WARNING "LTO is not supported!")
|
||||
endif()
|
||||
else()
|
||||
set(LTO_SUPPORTED OFF)
|
||||
endif()
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
find_package(rocprofiler-sdk PATHS "/opt/rocm/lib/cmake")
|
||||
|
||||
set(TRACY_PUBLIC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/public)
|
||||
|
||||
if(LTO_SUPPORTED)
|
||||
set(TRACY_VISIBILITY "OBJECT")
|
||||
elseif(TRACY_STATIC)
|
||||
set(TRACY_VISIBILITY "STATIC")
|
||||
if(TRACY_STATIC)
|
||||
set(TRACY_VISIBILITY "STATIC")
|
||||
else()
|
||||
set(TRACY_VISIBILITY "SHARED")
|
||||
set(TRACY_VISIBILITY "SHARED")
|
||||
endif()
|
||||
|
||||
add_library(TracyClient ${TRACY_VISIBILITY} "${TRACY_PUBLIC_DIR}/TracyClient.cpp")
|
||||
target_compile_features(TracyClient PUBLIC cxx_std_11)
|
||||
set_target_properties(TracyClient PROPERTIES INTERPROCEDURAL_OPTIMIZATION ${LTO_SUPPORTED})
|
||||
target_include_directories(TracyClient SYSTEM PUBLIC
|
||||
$<BUILD_INTERFACE:${TRACY_PUBLIC_DIR}>
|
||||
$<INSTALL_INTERFACE:include/tracy>)
|
||||
$<INSTALL_INTERFACE:include>)
|
||||
target_link_libraries(
|
||||
TracyClient
|
||||
PUBLIC
|
||||
Threads::Threads
|
||||
${CMAKE_DL_LIBS}
|
||||
)
|
||||
if(rocprofiler-sdk_FOUND)
|
||||
target_compile_definitions(TracyClient PUBLIC TRACY_ROCPROF)
|
||||
target_link_libraries(TracyClient PUBLIC rocprofiler-sdk::rocprofiler-sdk)
|
||||
endif()
|
||||
|
||||
if(TRACY_Fortran)
|
||||
add_library(TracyClientF90 ${TRACY_VISIBILITY} "${TRACY_PUBLIC_DIR}/TracyClient.F90")
|
||||
target_include_directories(TracyClientF90 PUBLIC
|
||||
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
|
||||
$<INSTALL_INTERFACE:include/tracy>)
|
||||
target_link_libraries(
|
||||
TracyClientF90
|
||||
PUBLIC
|
||||
TracyClient
|
||||
)
|
||||
set_target_properties(TracyClientF90 PROPERTIES Fortran_MODULE_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
INTERPROCEDURAL_OPTIMIZATION ${LTO_SUPPORTED})
|
||||
endif()
|
||||
|
||||
# Public dependency on some libraries required when using Mingw
|
||||
if(WIN32 AND ${CMAKE_CXX_COMPILER_ID} MATCHES "GNU|Clang")
|
||||
target_link_libraries(TracyClient PUBLIC ws2_32 dbghelp secur32)
|
||||
target_compile_definitions(TracyClient PUBLIC WINVER=0x0A00 _WIN32_WINNT=0x0A00)
|
||||
if(WIN32 AND ${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
|
||||
target_link_libraries(TracyClient PUBLIC ws2_32 dbghelp)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||
@@ -87,74 +50,43 @@ if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||
target_link_libraries(TracyClient PUBLIC ${EXECINFO_LIBRARY})
|
||||
endif()
|
||||
|
||||
if(TRACY_LIBUNWIND_BACKTRACE)
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(unwind REQUIRED libunwind)
|
||||
target_include_directories(TracyClient INTERFACE ${unwind_INCLUDE_DIRS})
|
||||
target_link_libraries(TracyClient INTERFACE ${unwind_LINK_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(TRACY_DEBUGINFOD)
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(debuginfod REQUIRED libdebuginfod)
|
||||
target_include_directories(TracyClient INTERFACE ${debuginfod_INCLUDE_DIRS})
|
||||
target_link_libraries(TracyClient INTERFACE ${debuginfod_LINK_LIBRARIES})
|
||||
endif()
|
||||
|
||||
add_library(Tracy::TracyClient ALIAS TracyClient)
|
||||
if(TRACY_Fortran)
|
||||
add_library(Tracy::TracyClient_Fortran ALIAS TracyClientF90)
|
||||
endif()
|
||||
|
||||
include(cmake/options.cmake)
|
||||
macro(set_option option help value)
|
||||
option(${option} ${help} ${value})
|
||||
if(${option})
|
||||
message(STATUS "${option}: ON")
|
||||
target_compile_definitions(TracyClient PUBLIC ${option})
|
||||
else()
|
||||
message(STATUS "${option}: OFF")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
set_option(TRACY_ENABLE "Enable profiling" OFF TracyClient)
|
||||
set_option(TRACY_ON_DEMAND "On-demand profiling" OFF TracyClient)
|
||||
set_option_value(TRACY_CALLSTACK "Override the callstack collection depth for tracy zones" "" TracyClient)
|
||||
set_option_value_as_string(TRACY_PLATFORM_HEADER "Path to a header providing TRACY_HAS_CUSTOM_* hooks for an unsupported platform" "" TracyClient)
|
||||
set_option(TRACY_NO_CALLSTACK "Disable all callstack related functionality" OFF TracyClient)
|
||||
set_option(TRACY_NO_CALLSTACK_INLINES "Disables the inline functions in callstacks" OFF TracyClient)
|
||||
set_option(TRACY_ONLY_LOCALHOST "Only listen on the localhost interface" OFF TracyClient)
|
||||
set_option(TRACY_NO_BROADCAST "Disable client discovery by broadcast to local network" OFF TracyClient)
|
||||
set_option(TRACY_ONLY_IPV4 "Tracy will only accept connections on IPv4 addresses (disable IPv6)" OFF TracyClient)
|
||||
set_option(TRACY_NO_CODE_TRANSFER "Disable collection of source code" OFF TracyClient)
|
||||
set_option(TRACY_NO_CONTEXT_SWITCH "Disable capture of context switches" OFF TracyClient)
|
||||
set_option(TRACY_NO_EXIT "Client executable does not exit until all profile data is sent to server" OFF TracyClient)
|
||||
set_option(TRACY_NO_SAMPLING "Disable call stack sampling" OFF TracyClient)
|
||||
set_option(TRACY_NO_WAIT_STACKS "Disable capture of context switch call stacks" OFF TracyClient)
|
||||
set_option(TRACY_NO_VERIFY "Disable zone validation for C API" OFF TracyClient)
|
||||
set_option(TRACY_NO_VSYNC_CAPTURE "Disable capture of hardware Vsync events" OFF TracyClient)
|
||||
set_option(TRACY_NO_FRAME_IMAGE "Disable the frame image support and its thread" OFF TracyClient)
|
||||
set_option(TRACY_NO_SYSTEM_TRACING "Disable systrace sampling" OFF TracyClient)
|
||||
set_option(TRACY_PATCHABLE_NOPSLEDS "Enable nopsleds for efficient patching by system-level tools (e.g. rr)" OFF TracyClient)
|
||||
set_option(TRACY_MANUAL_LIFETIME "Enable the manual lifetime management of the profile" OFF TracyClient)
|
||||
set_option(TRACY_FIBERS "Enable fibers support" OFF TracyClient)
|
||||
set_option(TRACY_NO_CRASH_HANDLER "Disable crash handling" OFF TracyClient)
|
||||
set_option(TRACY_TIMER_FALLBACK "Use lower resolution timers" OFF TracyClient)
|
||||
set_option(TRACY_DISALLOW_HW_TIMER "Disallow hardware timer (may be useful on VMs). Requires TRACY_TIMER_FALLBACK=ON" OFF TracyClient)
|
||||
set_option(TRACY_LIBUNWIND_BACKTRACE "Use libunwind backtracing where supported" OFF TracyClient)
|
||||
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 TracyClient)
|
||||
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 TracyClient)
|
||||
set_option(TRACY_DEBUGINFOD "Enable debuginfod support" OFF TracyClient)
|
||||
set_option(TRACY_IGNORE_MEMORY_FAULTS "Ignore instrumentation errors from memory free events that do not have a matching allocation, or from repeated allocations of the same address" OFF TracyClient)
|
||||
set_option(TRACY_OPENGL_AUTO_CALIBRATION "Periodically recalibrate OpenGL GPU/CPU clock drift (forces a CPU/GPU sync each time)" OFF TracyClient)
|
||||
|
||||
# advanced
|
||||
set_option(TRACY_VERBOSE "[advanced] Verbose output from the profiler" OFF TracyClient)
|
||||
mark_as_advanced(TRACY_VERBOSE)
|
||||
set_option(TRACY_NO_INTERNAL_MESSAGE "[advanced] Prevent the profiler from logging messages" OFF TracyClient)
|
||||
mark_as_advanced(TRACY_NO_INTERNAL_MESSAGE)
|
||||
set_option(TRACY_DEMANGLE "[advanced] Don't use default demangling function - You'll need to provide your own" OFF TracyClient)
|
||||
mark_as_advanced(TRACY_DEMANGLE)
|
||||
if(rocprofiler-sdk_FOUND)
|
||||
set_option(TRACY_ROCPROF_CALIBRATION "[advanced] Use continuous calibration of the Rocprof GPU time." OFF TracyClient)
|
||||
mark_as_advanced(TRACY_ROCPROF_CALIBRATION)
|
||||
endif()
|
||||
|
||||
# handle incompatible combinations
|
||||
if(TRACY_DISALLOW_HW_TIMER AND NOT TRACY_TIMER_FALLBACK)
|
||||
message(FATAL_ERROR "TRACY_DISALLOW_HW_TIMER can not be activated with disabled TRACY_TIMER_FALLBACK")
|
||||
endif()
|
||||
set_option(TRACY_ENABLE "Enable profiling" ON)
|
||||
set_option(TRACY_ON_DEMAND "On-demand profiling" 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)
|
||||
set_option(TRACY_NO_BROADCAST "Disable client discovery by broadcast to local network" OFF)
|
||||
set_option(TRACY_ONLY_IPV4 "Tracy will only accept connections on IPv4 addresses (disable IPv6)" OFF)
|
||||
set_option(TRACY_NO_CODE_TRANSFER "Disable collection of source code" OFF)
|
||||
set_option(TRACY_NO_CONTEXT_SWITCH "Disable capture of context switches" OFF)
|
||||
set_option(TRACY_NO_EXIT "Client executable does not exit until all profile data is sent to server" OFF)
|
||||
set_option(TRACY_NO_SAMPLING "Disable call stack sampling" OFF)
|
||||
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)
|
||||
@@ -165,28 +97,21 @@ include(CMakePackageConfigHelpers)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set_target_properties(TracyClient PROPERTIES VERSION ${PROJECT_VERSION})
|
||||
if(TRACY_Fortran)
|
||||
set_target_properties(TracyClientF90 PROPERTIES VERSION ${PROJECT_VERSION})
|
||||
endif()
|
||||
|
||||
set(tracy_includes
|
||||
${TRACY_PUBLIC_DIR}/tracy/TracyC.h
|
||||
${TRACY_PUBLIC_DIR}/tracy/Tracy.hpp
|
||||
${TRACY_PUBLIC_DIR}/tracy/TracyCUDA.hpp
|
||||
${TRACY_PUBLIC_DIR}/tracy/TracyD3D11.hpp
|
||||
${TRACY_PUBLIC_DIR}/tracy/TracyD3D12.hpp
|
||||
${TRACY_PUBLIC_DIR}/tracy/TracyLua.hpp
|
||||
${TRACY_PUBLIC_DIR}/tracy/TracyMetal.hmm
|
||||
${TRACY_PUBLIC_DIR}/tracy/TracyOpenCL.hpp
|
||||
${TRACY_PUBLIC_DIR}/tracy/TracyOpenGL.hpp
|
||||
${TRACY_PUBLIC_DIR}/tracy/TracyVulkan.hpp
|
||||
${TRACY_PUBLIC_DIR}/tracy/TracyWebGPU.hpp)
|
||||
${TRACY_PUBLIC_DIR}/tracy/TracyVulkan.hpp)
|
||||
|
||||
set(client_includes
|
||||
${TRACY_PUBLIC_DIR}/client/tracy_concurrentqueue.h
|
||||
${TRACY_PUBLIC_DIR}/client/tracy_rpmalloc.hpp
|
||||
${TRACY_PUBLIC_DIR}/client/tracy_SPSCQueue.h
|
||||
${TRACY_PUBLIC_DIR}/client/TracyKCore.hpp
|
||||
${TRACY_PUBLIC_DIR}/client/TracyArmCpuTable.hpp
|
||||
${TRACY_PUBLIC_DIR}/client/TracyCallstack.h
|
||||
${TRACY_PUBLIC_DIR}/client/TracyCallstack.hpp
|
||||
@@ -195,7 +120,6 @@ set(client_includes
|
||||
${TRACY_PUBLIC_DIR}/client/TracyDxt1.hpp
|
||||
${TRACY_PUBLIC_DIR}/client/TracyFastVector.hpp
|
||||
${TRACY_PUBLIC_DIR}/client/TracyLock.hpp
|
||||
${TRACY_PUBLIC_DIR}/client/TracyMangle.hpp
|
||||
${TRACY_PUBLIC_DIR}/client/TracyProfiler.hpp
|
||||
${TRACY_PUBLIC_DIR}/client/TracyRingBuffer.hpp
|
||||
${TRACY_PUBLIC_DIR}/client/TracyScoped.hpp
|
||||
@@ -211,87 +135,35 @@ set(common_includes
|
||||
${TRACY_PUBLIC_DIR}/common/TracyAlign.hpp
|
||||
${TRACY_PUBLIC_DIR}/common/TracyAlloc.hpp
|
||||
${TRACY_PUBLIC_DIR}/common/TracyApi.h
|
||||
${TRACY_PUBLIC_DIR}/common/TracyAssert.hpp
|
||||
${TRACY_PUBLIC_DIR}/common/TracyColor.hpp
|
||||
${TRACY_PUBLIC_DIR}/common/TracyForceInline.hpp
|
||||
${TRACY_PUBLIC_DIR}/common/TracyFormat.h
|
||||
${TRACY_PUBLIC_DIR}/common/TracyMutex.hpp
|
||||
${TRACY_PUBLIC_DIR}/common/TracyProtocol.hpp
|
||||
${TRACY_PUBLIC_DIR}/common/TracyQueue.hpp
|
||||
${TRACY_PUBLIC_DIR}/common/TracySocket.hpp
|
||||
${TRACY_PUBLIC_DIR}/common/TracyStackFrames.hpp
|
||||
${TRACY_PUBLIC_DIR}/common/TracyString.hpp
|
||||
${TRACY_PUBLIC_DIR}/common/TracySystem.hpp
|
||||
${TRACY_PUBLIC_DIR}/common/TracyTaggedUserlandAddress.hpp
|
||||
${TRACY_PUBLIC_DIR}/common/TracyVersion.hpp
|
||||
${TRACY_PUBLIC_DIR}/common/TracyWinFamily.hpp
|
||||
${TRACY_PUBLIC_DIR}/common/TracyUwp.hpp
|
||||
${TRACY_PUBLIC_DIR}/common/TracyYield.hpp)
|
||||
|
||||
install(TARGETS TracyClient
|
||||
EXPORT TracyConfig
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/$<IF:$<CONFIG:Release>,,$<CONFIG>>
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/$<IF:$<CONFIG:Release>,,$<CONFIG>>
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/$<IF:$<CONFIG:Release>,,$<CONFIG>>
|
||||
COMPONENT lib)
|
||||
if(TRACY_Fortran)
|
||||
install(TARGETS TracyClientF90
|
||||
EXPORT TracyConfig
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/$<IF:$<CONFIG:Release>,,$<CONFIG>>
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/$<IF:$<CONFIG:Release>,,$<CONFIG>>
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/$<IF:$<CONFIG:Release>,,$<CONFIG>>
|
||||
COMPONENT lib)
|
||||
endif()
|
||||
# Export targets to build tree root
|
||||
export(TARGETS TracyClient
|
||||
NAMESPACE Tracy::
|
||||
FILE ${CMAKE_BINARY_DIR}/TracyTargets.cmake)
|
||||
if(TRACY_Fortran)
|
||||
export(TARGETS TracyClientF90
|
||||
NAMESPACE Tracy::
|
||||
APPEND
|
||||
FILE ${CMAKE_BINARY_DIR}/TracyTargets.cmake)
|
||||
endif()
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
install(FILES ${tracy_includes}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy/tracy)
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy)
|
||||
install(FILES ${client_includes}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy/client)
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/client)
|
||||
install(FILES ${common_includes}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy/common)
|
||||
if(TRACY_Fortran)
|
||||
if(${CMAKE_Fortran_COMPILER_ID} MATCHES "Cray")
|
||||
install(FILES ${PROJECT_BINARY_DIR}/TRACY.mod
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy)
|
||||
else()
|
||||
install(FILES ${PROJECT_BINARY_DIR}/tracy.mod
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy)
|
||||
endif()
|
||||
endif()
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/common)
|
||||
install(EXPORT TracyConfig
|
||||
NAMESPACE Tracy::
|
||||
FILE TracyTargets.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
|
||||
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 ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
|
||||
INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Tracy)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/TracyConfig.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
|
||||
write_basic_package_version_file(
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/TracyConfigVersion.cmake"
|
||||
COMPATIBILITY SameMinorVersion)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/TracyConfigVersion.cmake"
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
|
||||
|
||||
option(TRACY_CLIENT_PYTHON "Whether to build Tracy python client library" OFF)
|
||||
|
||||
if(TRACY_CLIENT_PYTHON)
|
||||
if(TRACY_STATIC)
|
||||
message(FATAL_ERROR "Python-bindings require a shared client library")
|
||||
endif()
|
||||
|
||||
add_subdirectory(python)
|
||||
endif()
|
||||
|
||||
if(PROJECT_IS_TOP_LEVEL)
|
||||
set(CMAKE_COLOR_DIAGNOSTICS ON)
|
||||
endif()
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/Tracy)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
set(TRACY_VERSION_STRING "@TRACY_VERSION_STRING@")
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(Threads REQUIRED)
|
||||
|
||||
|
||||
2
LICENSE
@@ -1,7 +1,7 @@
|
||||
Tracy Profiler (https://github.com/wolfpld/tracy) is licensed under the
|
||||
3-clause BSD license.
|
||||
|
||||
Copyright (c) 2017-2026, Bartosz Taudul <wolf@nereid.pl>
|
||||
Copyright (c) 2017-2024, Bartosz Taudul <wolf@nereid.pl>
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
611
NEWS
@@ -2,562 +2,10 @@ 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.
|
||||
|
||||
vx.xx.x (2026-xx-xx)
|
||||
--------------------
|
||||
|
||||
- Added the monitor utility. This Linux-specific tool can launch or attach
|
||||
to a program that has no Tracy instrumentation and perform a profiling run
|
||||
based on sampling call stacks.
|
||||
- It is now possible to load traces available on the web in the web demo
|
||||
of the profiler. See the manual for details.
|
||||
- Pandoc is now required to build the graphical profiler. The build system
|
||||
will automatically download the tool. The pandoc binary will be stored
|
||||
in the user cache directory.
|
||||
- The profiler listening port can now be retrieved during runtime via the
|
||||
TracyPort macro.
|
||||
- The capture daemon will now lock the directory it writes to, so that two
|
||||
simultaneously running daemons will not stomp on each other's data.
|
||||
- Section rows on the timeline can now be grouped by their category.
|
||||
- System tracing on Linux now properly parses rare non-default kernel data
|
||||
structure formats.
|
||||
- Removed filtering of context switch data when saving a trace to disk, as
|
||||
it was losing the thread wake graph data.
|
||||
- Fixed standard deviation in find zone window when the self or running time
|
||||
option was enabled.
|
||||
- Find zone window now works with GPU zones (histogram, statistics, self
|
||||
time).
|
||||
- Changed the GPU zones icon from an eye to a display monitor.
|
||||
- User GUI scale in the profiler can be now controlled with Ctrl + plus/minus
|
||||
and reset with Ctrl + zero.
|
||||
- Various hardening improvements for correctness across the code base.
|
||||
|
||||
v0.14.1 (2026-08-22)
|
||||
--------------------
|
||||
|
||||
- Dropped support for loading pre-0.11 traces.
|
||||
- Silenced MSVC warning C4366: The result of the unary '&' operator may be
|
||||
unaligned.
|
||||
- Fixed section setup in on-demand mode.
|
||||
- Hardened string length encoding in protocol.
|
||||
- Fixed compilation failure related to VSync when targeting 32-bit on
|
||||
Windows.
|
||||
- Added TRACY_NO_WAIT_STACKS compile time macro.
|
||||
- Improved documentation of requirements in edge cases:
|
||||
- Memory allocation reporting needs to be done under a lock.
|
||||
- Manual lifetime management requires shutdown of the profiler.
|
||||
- Documented how zones behave when crossing the on-demand connection
|
||||
boundary.
|
||||
- Mention that statistics time range limit also affects source view.
|
||||
- Memory events are now attributed to virtual fiber threads.
|
||||
- Added TRACY_ASSERT macro allowing user-defined handling of asserts in the
|
||||
profiler.
|
||||
- Fixed csvexport options: -t, --sep, --filter.
|
||||
- Configuration of plot color now matches the documented RGB channels order.
|
||||
- Link profiler executable with libdl (required by old glibc versions).
|
||||
- Improve coverage of link-time macro mismatch detection.
|
||||
- Removed TRACY_DELAYED_INIT option. It was no-op since 2020.
|
||||
- Fixed illegal instruction in rpmalloc on ARMv6 and older.
|
||||
- Fixed handling of source code queries in no-callstack builds. Previously
|
||||
the profiling session would hang at exit.
|
||||
- Hardened Lua on-demand handling.
|
||||
- Fixed system tracing on Linux kernels older than 4.1.
|
||||
- Linux system tracing setup failures are now reported via Tracy debug
|
||||
message functionality.
|
||||
- Improved version handling in CMake / Meson / Python build systems.
|
||||
- Fixed D3D12 readback buffer error.
|
||||
- Child zone list in zone info window can be now sorted by name or by time.
|
||||
- File dialog failures (e.g. related to the XDG portal) are now reported
|
||||
in the modal dialog.
|
||||
- Fixed NO_FILESELECTOR builds.
|
||||
- Fixed possible profiler hang when there was not enough space to draw
|
||||
a plot on the timeline.
|
||||
- Update check can be now interrupted, e.g. when exiting the profiler.
|
||||
- Patched the file selector library to use modern Wayland protocol for
|
||||
setting parent-child window relation.
|
||||
|
||||
|
||||
v0.14.0 (2026-08-09)
|
||||
--------------------
|
||||
|
||||
- API break: removed "secure" variants of memory alloc and free macros. The
|
||||
secure code path is now always enabled. Migrate by removing "Secure" from
|
||||
the macros you use, e.g. TracySecureAlloc(...) -> TracyAlloc(...).
|
||||
- Added printf-style variants of the C API zone text and name macros:
|
||||
TracyCZoneTextF and TracyCZoneNameF now accept a format string and
|
||||
arguments, instead of a fixed-length text buffer.
|
||||
- Added tracy-capture-daemon for automated multi-client trace capture.
|
||||
- Added tracy-merge utility for combining multiple trace files into one.
|
||||
- Added support for Windows on ARM64 with MSVC.
|
||||
- Added support for WebGPU.
|
||||
- Binary releases are now also provided for macOS (needs manual quarantine
|
||||
handling) and Linux (AppImage with Ubuntu 24.04 base, requires Wayland).
|
||||
- Trace-specific settings storage has been completely overhauled. It is now
|
||||
possible to make the settings sidecar file public, saved next to the trace
|
||||
file.
|
||||
- External frames are now omitted in the single-line call stack list visible
|
||||
in messages list, or in memory allocation info window.
|
||||
- External frames are now hidden by default in various contexts where they
|
||||
were previously enabled:
|
||||
- Flame graph window.
|
||||
- Call stack window.
|
||||
- Statistics window (sampling mode).
|
||||
- Wait stacks have a separate setting for external frames, as you would
|
||||
typically want to know what caused the wait state, which can be inferred
|
||||
from the external code.
|
||||
- External frames are now dimmed out in call stacks in various parts of UI.
|
||||
- Sample markers on the timeline are now colored according to sample type:
|
||||
- Green for samples in the profiled program,
|
||||
- Blue for samples in external code,
|
||||
- Red for samples in kernel.
|
||||
- Single-line call stacks now have ellipsis at the end, if there are frames
|
||||
remaining.
|
||||
- Sample entry stacks window can now also show the stacks by which a symbol
|
||||
was reached, i.e. it was present anywhere on the call stack, not only when
|
||||
it was executing. Recursive re-entries can be either ignored or counted
|
||||
separately.
|
||||
- Entry stacks are now also available for symbols which were only reached,
|
||||
but never directly sampled, e.g. in the assembly view of a call site with
|
||||
purely child sample costs, or in the statistics window for symbols which
|
||||
only have inclusive counts.
|
||||
- Fixed inclusive sample counts of symbols with inline functions. Each
|
||||
sample was counted multiple times: once for the symbol itself and once for
|
||||
every of its inline functions present on the call stack.
|
||||
- Fixed context switch samples leaking into per-symbol sample lists and
|
||||
child sample data on trace load. This inflated range-limited sample counts
|
||||
and child call costs, and made loaded traces disagree with live sessions,
|
||||
where such samples are excluded from sampling statistics.
|
||||
- Fixed wrong results of range-limited child call queries during live
|
||||
capture, when some samples had to wait for context switch data to arrive.
|
||||
- Fixed crashes when opening the sample entry stacks window for symbols
|
||||
without any sampling data.
|
||||
- Sampling statistics percentages are now calculated against the number of
|
||||
samples that were actually collected. Previously, enabling the range
|
||||
filter switched the calculation to a theoretical single-thread estimate,
|
||||
which changed both the meaning and the scale of the displayed values.
|
||||
- Find zone sample count percentages are now relative to the matched zones,
|
||||
consistent with the time percentages in the same list, instead of being
|
||||
relative to the whole trace.
|
||||
- Context switch samples are now consistently excluded from all sampling
|
||||
statistics views.
|
||||
- System tracing on Windows has been refactored to be more robust.
|
||||
- Tracing on Arm macOS will now have more precise timer readings.
|
||||
- Extended CUDA support to track some previously missing memory operations.
|
||||
- Added support for setting message's source and severity, through the
|
||||
TracyLogString macro.
|
||||
- The "zone trace" list in zone information window has been removed. It was
|
||||
never convenient to use properly. It was replaced by "parent zones" list,
|
||||
which is basically a less convoluted equivalent.
|
||||
- Added inline call stack list to the zone information window.
|
||||
- The "call stack" button for opening the call stack in a separate window
|
||||
is still there.
|
||||
- Call stacks are now also displayed in zone and memory allocation tooltips
|
||||
(single-line).
|
||||
- Implemented heuristic reconstruction of zone call stacks for zones that
|
||||
were captured without call stacks.
|
||||
- Requires sampling to be enabled, and at least one sample in the zone
|
||||
extent.
|
||||
- Since this is a heuristic, the result can be wrong.
|
||||
- The reconstructed call stack can be displayed in the zone tooltip and in
|
||||
the inline call stack view in zone information window.
|
||||
- Reconstructed call stacks are indicated with the "magic wand" icon.
|
||||
- Various LLM integration improvements.
|
||||
- The protocol has been updated to use model templates. As a result, tools
|
||||
are now specified in a common way and the reasoning is performed in a
|
||||
separate content stream.
|
||||
- Several new tools were added, which in concert enable the assistant to
|
||||
answer very general questions, such as "how to optimize this program?".
|
||||
- Smaller models are now viable to use. Models as small as 4B parameters do
|
||||
now work really well. You can run such models on virtually all hardware.
|
||||
- Added horizontal scroll bars to code segments.
|
||||
- LLM thinking regions are now hidden by default.
|
||||
- The assistant may notify the user about its current findings, then
|
||||
resume thinking, after which it may give a more complete answer. In
|
||||
such cases, the initial part of the reply will be faded out.
|
||||
- Sampled execution costs are now included in assembly attachments.
|
||||
- Source code retrieval now has an optional line context parameter.
|
||||
- Added ability to search the code for keywords.
|
||||
- Calls in assembly attachments are now annotated with function names.
|
||||
- Wikipedia search will now return 10 results, not only the top one.
|
||||
- Brave search engine is now available as an alternative web search option.
|
||||
- Added emoji font.
|
||||
- Maximum tool reply size has been tweaked to better work with larger
|
||||
contexts.
|
||||
- Tool reply size limit is now configurable in LLM settings.
|
||||
- Tool reply eviction logic for context management has been adjusted to
|
||||
better work with larger contexts. Additional logic was added to prefer
|
||||
eviction of old responses.
|
||||
- Certain LLM actions want to run in a fast mode, with reasoning disabled.
|
||||
In most scenarios the default chat model will have to do here. If you
|
||||
have the memory to spare, you can optionally load two models at once,
|
||||
setting the "fast" model to a smaller and much quicker one.
|
||||
- Chat topic description is now provided, based on the first user question.
|
||||
- Each assistant reply is now labeled with used model and reply time.
|
||||
- Follow-up questions can be automatically suggested.
|
||||
- It is now possible to alter the assistant personality.
|
||||
- Expanded LLM attachments.
|
||||
- You can now attach complete symbol assembly.
|
||||
- Entry call stacks can be now attached (previously it was only regular
|
||||
call stacks).
|
||||
- Crash call stack attachments are now annotated with crash info.
|
||||
- Wait stack attachments now contain wait metadata.
|
||||
- Source code can be attached (also with execution costs in symbol view).
|
||||
- Zone histogram data can be attached for analysis.
|
||||
- Added MCP server.
|
||||
- Markdown renderer improvements.
|
||||
- Tables are now properly rendered.
|
||||
- Tasklist rendering has been implemented.
|
||||
- Strikethrough is now supported.
|
||||
- Clickable links are now underlined.
|
||||
- Tweaked high-resolution scroll handling on Wayland.
|
||||
- Touchpad gestures on the timeline now either scroll or zoom, but not both
|
||||
simultaneously.
|
||||
- Full user name is now stored in trace info.
|
||||
- External functions can be filtered out in the sampling statistics view.
|
||||
- Tweaked external paths heuristics.
|
||||
- Check for both 64-bit and 32-bit versions of Program Files directory.
|
||||
- Hidden unix files and directories are now also considered external. For
|
||||
example: $(HOME)/.cache/cpm/somelib/file.h.
|
||||
- Call stack window can now provide LLM summaries.
|
||||
- These summaries can be performed automatically. Enable in LLM settings.
|
||||
- The capture utility is now displaying query backlog, just like the profiler
|
||||
GUI.
|
||||
- Lua source locations that are script code will now have newlines removed.
|
||||
This is a capture-time change, so previously captured broken Lua source
|
||||
locations won't be fixed.
|
||||
- Call stack window will now display notification if viewing a crash call
|
||||
stack.
|
||||
- Call stack window will now show a proper label if viewing a wait stack.
|
||||
- Removal of Tracy crash handler stack from the reported crash call stack
|
||||
should now work again on Linux.
|
||||
- In disassembly line view, source file names are now displayed instead of
|
||||
"unknown", in case the source line number is not known.
|
||||
- Trace host info is now properly formatted.
|
||||
- It is now possible to sort the order of threads on the timeline ("visible
|
||||
threads" in trace settings).
|
||||
- Added clipboard support to emscripten backend.
|
||||
- Added TRACY_DISALLOW_HW_TIMER define for virtualized environments and WSL2,
|
||||
which may not have reliable access to hardware timer registers. Falls back
|
||||
to standard library timer with reduced resolution.
|
||||
- Fixed TRACY_NO_CODE_TRANSFER define. It didn't prevent source code transfer
|
||||
before.
|
||||
- Fixed DPI scaling on macOS.
|
||||
- Thread names are no longer truncated to 15 characters on Apple.
|
||||
- Executable path is now inspected when looking for PDB files on Windows.
|
||||
- Added ___tracy_get_time() C API as an equivalent for Profiler::GetTime().
|
||||
- D3D12 instrumentation improvements.
|
||||
- CUDA instrumentation improvements.
|
||||
- Properly set API visibility attributes on MSVC + clang.
|
||||
- Fixed regression in data sorting algorithm that could cause broken (going
|
||||
back in time) plots. A retroactive fix is included for previously broken
|
||||
traces.
|
||||
- All tools provided by the project now report the version number and git sha
|
||||
revision on the command line help output.
|
||||
- Microarchitectural data has been updated to include the latest uops.info
|
||||
measurements.
|
||||
- Added validation check for SymSrv.dll on Windows.
|
||||
- Various CMake options are now available to control optional build settings:
|
||||
- NO_LTO disables link-time optimization.
|
||||
- NO_MOLD_LINKER disables use of the mold linker.
|
||||
- NO_CCACHE disables use of ccache (compiler cache).
|
||||
- The Tracy library now has TRACY_ENABLED unset by default in the CMake and
|
||||
Meson default configurations. This now matches what the documentation was
|
||||
always saying. Some build setups may need updating.
|
||||
- Adjust to max sampling rate on Linux.
|
||||
- Further improvements to tracefs mount path discovery robustness.
|
||||
- Macro mismatch detection between Tracy configuration and client code.
|
||||
- Tracy client build settings change the ABI of the library.
|
||||
- Mismatched versions will break at linking.
|
||||
- As a reminder, Tracy *always* required using the same set of compilation
|
||||
options for the entire program.
|
||||
- Message windows were improved.
|
||||
- Full message will be now displayed in a tooltip for multi-line messages.
|
||||
- Added right click context menu with option to copy message to clipboard.
|
||||
- Greatly improved the in-profiler user manual.
|
||||
- There is now chapter tree and the manual contents are displayed section
|
||||
by section.
|
||||
- Links to chapters are now properly working.
|
||||
- The "bclogo" blocks are now correctly processed and displayed as proper
|
||||
admonitions.
|
||||
- The font awesome icons now show as in the rest of the UI.
|
||||
- Footnotes are now rendered as proper footnotes.
|
||||
- Tables are now rendered as intended.
|
||||
- LaTeX math is now converted to readable form.
|
||||
- Added a button to download the full PDF manual to the user manual window.
|
||||
- Call stack window will now show the thread viewed call stack originates
|
||||
from (if possible).
|
||||
- "Visible threads" checkboxes in messages, flame graph and wait stacks
|
||||
windows are now displayed in multiple columns, and the maximum number of
|
||||
visible rows is limited, with fallback to scrollable view.
|
||||
- Improved child call distribution list in the symbol view window.
|
||||
- The visible area can be now resized horizontally.
|
||||
- The list is now displayed as a table with resizable columns, etc.
|
||||
- Child calls time percentage is now shown as a percentage of calls (as
|
||||
it was before), and also as a percentage of total symbol time.
|
||||
- Child calls time is now also displayed as a percentage.
|
||||
- Prototype implementation of system tracing on Apple devices.
|
||||
- Local (inline) call stack printouts were added to tooltips in statistics
|
||||
window, in sampling mode.
|
||||
- Ironed out some code corners to make integration of closed gaming console
|
||||
platforms easier. Added support for custom platform headers.
|
||||
- Bottom and top sample trees (in wait stacks, or in entry call stacks)
|
||||
now display aggregation counts if "group by function name" is enabled.
|
||||
- HW sample view in symbol view are now disabled by default.
|
||||
- The profiler can no longer be built with the statistics disabled.
|
||||
- Fixed NVCC builds.
|
||||
- Fixed possible lockups in Vulkan timer calibration loop.
|
||||
- Flame graph improvements.
|
||||
- The flame graph view now supports zooming in and panning with the mouse.
|
||||
- Sampling flame graph items can be now also grouped by name, in addition
|
||||
to symbol address.
|
||||
- Sampling flame graph no longer omits display of unknown symbols. These
|
||||
are now aggregated into blocks named after the executable image.
|
||||
- General application crash information polish in the profiler UI.
|
||||
- The achievements system has been converted to use markdown renderer.
|
||||
- Offline symbol resolution with the update utility now supports custom
|
||||
addr2line-compatible tools via -a and -A command line parameters.
|
||||
Additionally, it is now possible to reset all call stack frame symbols to
|
||||
unresolved with the -R parameter.
|
||||
- Periodic recalibration of the clock drift in OpenGL contexts can be enabled
|
||||
with the TRACY_OPENGL_AUTO_CALIBRATION compilation define. Note that this
|
||||
requires a full CPU/GPU sync on each calibration event. These events will
|
||||
not fire more often than once every second.
|
||||
- Additional hardening of OpenGL tracing.
|
||||
- Added missing C API for shared locks.
|
||||
- Implemented semi-unique, nonsense random name generator.
|
||||
- Can be used to set a trace description.
|
||||
- Will be used to provide default description for newly added annotations.
|
||||
- Polished look and feel of annotation regions on the timeline.
|
||||
- Annotations can now be hidden.
|
||||
- It is now possible to create annotations from time range limits.
|
||||
- Expanded available tests.
|
||||
- The previously existing "test" program now lives in "tests/tracy".
|
||||
- The tests directory also contains some repro cases for solved problems.
|
||||
- Expanded examples showing how to use the profiler.
|
||||
- Includes "Dyna.net", a small 2D game that is a variation of Bomberman.
|
||||
- Made numeric input field for trace parameters usable again.
|
||||
- Added new type of trace parameter that exposes a trigger button.
|
||||
- Added "sections" feature for marking high-level sections of program
|
||||
execution.
|
||||
- For example, a game with multiple levels may have each of the levels
|
||||
marked as a section.
|
||||
- Each section is a distinct region not restricted by other sections.
|
||||
- Multiple sections can overlap.
|
||||
- Sections can be assigned to user-defined categories.
|
||||
- Can be used to set time range limits.
|
||||
- Exposed via Lua bindings.
|
||||
- Find zone window now also displays coefficient of variation, in addition
|
||||
to standard deviation.
|
||||
- Moved frame statistics from trace information window to its own window.
|
||||
- Added various statistical data to bring frame statistics up to par with
|
||||
the find zone window.
|
||||
- Added a new time range limit for frame statistics. This accompanies the
|
||||
previously existing "limit to view" option.
|
||||
- More robust statistics for functions that recursively call themselves.
|
||||
- General uplift of the compare traces window.
|
||||
- Added all the statistical parameters displayed in find zone window that
|
||||
were missing here.
|
||||
- Frame comparison now also displays FPS values.
|
||||
- The "more" and "less" indicators are now color coded to show their
|
||||
importance. The amount of color these keywords are printed with is now
|
||||
dependant on how divergent the numeric values are.
|
||||
- It is now possible to limit time range for both traces that are compared
|
||||
to their respective annotations or sections.
|
||||
- Frame image playback improvements.
|
||||
- Playback can be looped.
|
||||
- The range of played frame images can be limited, either manually, or by
|
||||
copying annotation, section, or time range limit. There's an "require
|
||||
frame coverage" option to only include frames that are at least 75%
|
||||
within the source region.
|
||||
- Most windows now have a minimum width, in order to make sure all controls
|
||||
provided in the window are visible. Previously it was easy to oversee some
|
||||
button that was out of the window draw area.
|
||||
- The ignore memory faults functionality (enabled by default if profiling
|
||||
programs on Apple platforms) will now also ignore allocating memory at the
|
||||
same location twice, without an intermediate free. Thanks, Tim Apple!
|
||||
|
||||
|
||||
v0.13.1 (2025-12-11)
|
||||
--------------------
|
||||
|
||||
- Fixed parsing of extended model and family of x86 CPUID.
|
||||
- Fixed memory corruption when a "long" user name was used on Android.
|
||||
- Fixed wrong function signature when TRACY_DEBUGINFOD was enabled.
|
||||
- Mount list is now read using proper API instead of processing /proc/mounts.
|
||||
- Fixed shadow warning supression not being enabled on gcc.
|
||||
- Silently ignore lost ETW Vsync events instead of asserting.
|
||||
- Worked around few cases where old macOS machines do not support C++20
|
||||
properly. Thanks Tim Apple!
|
||||
- Added truncated mean parameter to csvexport.
|
||||
- Added experimental viewer for the user manual.
|
||||
- Memory free faults can be now ignored with the TRACY_IGNORE_MEMORY_FAULTS
|
||||
option.
|
||||
- Fixed race condition during profiler shutdown.
|
||||
|
||||
|
||||
v0.13.0 (2025-11-11)
|
||||
--------------------
|
||||
|
||||
- Added optional LLM integration.
|
||||
- Can be completely disabled in options.
|
||||
- Requires you to provide a local LLM service.
|
||||
- Can be used to retrieve information from the user manual.
|
||||
- Can answer queries about application call stacks, assembly code, other
|
||||
general questions.
|
||||
- Will refer to network resources to obtain information.
|
||||
- The required setup is detailed in the user manual.
|
||||
- Added support for Microsoft Game Development Kit (GDK).
|
||||
- Added support for ROCm / Rocprof.
|
||||
- Default values for certain settings can be now saved in the options
|
||||
window.
|
||||
- The display height of any timeline thread can be limited with a thread
|
||||
cropper widget at the left border of the screen.
|
||||
- System tracing is now stopped when the profiled program wants to exit.
|
||||
- System tracing can be now enabled and disabled by the profile program.
|
||||
- Added support for host query reset when collecting Vulkan traces.
|
||||
- The find zone statistics now also show P99 and P99.9.
|
||||
- Timeline for a thread will no longer hide if there are no zones to show,
|
||||
but samples are visible.
|
||||
- Fixed problems with Wayland integration.
|
||||
- Proper order of operations is now ensured during initialization.
|
||||
- The window size calculations for fractional scaling are now done
|
||||
correctly.
|
||||
- The Linux tracefs mount path is now properly detected, instead of relying
|
||||
on a hardcoded value.
|
||||
- Fixed LockMark macro expansion.
|
||||
- Fixed invalid reported fiber enter time.
|
||||
- Properly handle fiber enter and leave events in the on demand mode.
|
||||
- Removed calibration of queue delay time. It served no real purpose.
|
||||
- Various improvements have been made to speed up symbol and executable
|
||||
image queries.
|
||||
- Exposed internal mutex variable in Lockable and SharedLockable.
|
||||
- Fixed problems with Linux systems that do not use glibc.
|
||||
- Fixed edge case that could corrupt rpmalloc state in the profiled
|
||||
application.
|
||||
- Extended ZoneNameF macro with compiler checks for proper printf args.
|
||||
- Warnings about variable redefinition by nested zone macros are now
|
||||
supressed by default. The old behavior can be restored by adding the
|
||||
TRACY_ALLOW_SHADOW_WARNING define during compilation of your program.
|
||||
- Fixed window icon and dock integration on macOS.
|
||||
- Fixed edge case with symbols thread not behaving as expected when on
|
||||
demand mode was used and a rapid reconnection was made.
|
||||
- Properly defer GPU context events in serial C API.
|
||||
|
||||
|
||||
v0.12.2 (2025-06-25)
|
||||
--------------------
|
||||
|
||||
- Fixed builds made out of git checkout directory.
|
||||
- Added range limits for flame graph.
|
||||
- Fixed wayland include paths for distros that use non-standard package
|
||||
layouts.
|
||||
- Workarounded MinGW build problems. Safe symbol retrieval is not available
|
||||
on this platform.
|
||||
- Fixed Lua bindings when TRACY_NO_CALLSTACK is defined.
|
||||
|
||||
|
||||
v0.12.1 (2025-06-07)
|
||||
--------------------
|
||||
|
||||
- Fixed window size calculation on macOS, most notably enabling the vertical
|
||||
timeline scroll bar.
|
||||
- Made debug builds of the GUI profiler work with broken Apple compiler.
|
||||
- Fixed profiler compilation when build directory is outside the source
|
||||
directory.
|
||||
- Set proper include path when using CMake integration.
|
||||
- Added the Tracy Metal and CUDA headers to CMake install configuration.
|
||||
- Documented flame graphs.
|
||||
|
||||
|
||||
v0.12.0 (2025-05-30)
|
||||
--------------------
|
||||
|
||||
- Enabled workaround for MSVC runtime library SNAFU, which manifested with
|
||||
the profiler executables crashing at startup inside mutex code.
|
||||
- CPU topology data now includes CPU die information.
|
||||
- Clients running under Wine will now report that in the trace info.
|
||||
- Added flame graph.
|
||||
- The Git ref information for the build is now included in the about dialog.
|
||||
- Added support for clipboard copy and paste on Wayland.
|
||||
- The welcome dialog client address entry field will now trim the entered
|
||||
address, so that stray spaces at the start and the end are removed. This
|
||||
should reduce the amount of user precision required when copy pasting the
|
||||
address from somewhere else.
|
||||
- GPU profiling is now available with Metal and CUDA.
|
||||
- Profiling zones can now optionally inherit their parent color.
|
||||
- It is no longer needed to have up-to-date copy of wayland-protocols
|
||||
installed. CMake will download the required version from GitHub.
|
||||
- Added option to show the top inline in symbol statistics list in stead of
|
||||
the symbol name.
|
||||
- Parallel sorting is now performed with PPQSort (which removes potential
|
||||
dependency on TBB).
|
||||
- Added CMake option TRACY_DEBUGINFOD to enable use of libdebuginfod to
|
||||
retrieve symbols on Linux clients.
|
||||
- Added a "custom" label as an option to select for GPU context type.
|
||||
- Symbol code retrieval is now protected against reading no longer available
|
||||
memory.
|
||||
- Clicking on a symbol in the symbol statistics list will now open a popup
|
||||
with two options. This change intends to make the useful but quite hidden
|
||||
disassembly view more discoverable.
|
||||
- "View symbol" shows the symbol code disassembly. It was previously
|
||||
available by right-click on the source file name.
|
||||
- "Sample entry stacks" shows the list window that was previously
|
||||
opened when the symbol entry was clicked.
|
||||
- Plots are now extended to the end of the trace, instead of ending at the
|
||||
last data point.
|
||||
- Added TracyMemoryDiscard macros to mark that all allocations made in a
|
||||
certain memory pool were freed. This enables better support for arena
|
||||
allocators.
|
||||
- It is now possible to fine-tune horizontal and vertical mouse wheel scroll
|
||||
sensitivity.
|
||||
- Added p75 and p90 percentiles in the Find zone window.
|
||||
- Zone info window will now display (approximate) wall-clock time of when
|
||||
the zone appeared, in addition to the previously displayed time from the
|
||||
start of the program.
|
||||
- Zone values passed via ZoneValue macro will be now also displayed in hex.
|
||||
- The csvexport utility can now export:
|
||||
- plots,
|
||||
- GPU zones,
|
||||
- zone text.
|
||||
- Fortran integration is now available.
|
||||
- Added TRACY_LTO CMake option to enable Link-Time Optimizations.
|
||||
- Executable image names will now be shortened to just the file name. The
|
||||
full path is available as a tooltip. Shortening can be disabled with a
|
||||
"scissors" checkbox.
|
||||
- Entry stacks can be now also viewed via a button in the symbol view.
|
||||
- On Wayland the application icon is now set even without the desktop file.
|
||||
- Lua code can be now automatically instrumented via a hook.
|
||||
- User text set in zone can be now copied to clipboard.
|
||||
- The LockMark() macro is now less strict about what object you can pass
|
||||
to it. It is now possible to pass members, e.g. LockMark(obj.mutex).
|
||||
- The profiler application now adapts to per-monitor DPI on Windows.
|
||||
- It is now possible to save the UI scale of the profiler (needs to be
|
||||
enabled in settings).
|
||||
- Added thread wakeup visualization.
|
||||
|
||||
|
||||
v0.11.1 (2024-08-22)
|
||||
--------------------
|
||||
|
||||
- Utilities import-chrome and import-fuchsia now live together in the import
|
||||
directory.
|
||||
- Added TRACY_VERBOSE to available CMake options.
|
||||
- It is now possible to set TRACY_SAMPLING_HZ via a environment variable.
|
||||
- Thread group hints can be now used to group threads together in the
|
||||
profiler UI.
|
||||
- Limit Lua file names to 255 characters, as the source string can contain
|
||||
the whole script, if loaded with loadstring().
|
||||
|
||||
|
||||
v0.11.0 (2024-07-16)
|
||||
vx.xx.x (xxxx-xx-xx)
|
||||
--------------------
|
||||
|
||||
- Support for pre-0.9 traces has been dropped.
|
||||
- The old server-side build system has been replaced by CMake. The client
|
||||
integration is not affected. Refer to the manual for details.
|
||||
- Most importantly, a known version of the capstone library is now
|
||||
downloaded from GitHub. You will need to have git installed for this
|
||||
to work (there is a CMake option to use the capstone installed on the
|
||||
system, as was done previously).
|
||||
- Various Meson fixes.
|
||||
- Proper way of loading Vulkan calibrated timestamps extension.
|
||||
- Fixed C API support for GPU tracing when on demand mode is enabled.
|
||||
@@ -619,63 +67,6 @@ v0.11.0 (2024-07-16)
|
||||
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.
|
||||
- There's now a copy to clipboard button in the statistics view. It copies
|
||||
the visible rows of either the instrumentation or GPU statistics view to
|
||||
a CSV string matching a subset of the csvexport format.
|
||||
- Source file contents can be copied to the clipboard.
|
||||
- Added key binding for immediate reconnect: Ctrl+Shift+Alt+R.
|
||||
- Lock markup is now available through the C API.
|
||||
- Symbol statistics window now allows aggregation of inlined functions in
|
||||
symbols.
|
||||
- Cost measurements of inlined functions in the symbol statistics window
|
||||
can be now relative to the base symbol instead of total program run time.
|
||||
- ScopedZone and AllocSourceLocation now accept color parameter. Impact on
|
||||
existing code should be minimal.
|
||||
- AllocSourceLocation has a new parameter with a default value.
|
||||
- __tracy_alloc_srcloc and __tracy_alloc_srcloc_name break the existing
|
||||
API. This can be easily fixed by setting the last parameter to zero.
|
||||
- To build the profiler GUI with Wayland you now need wayland-scanner and
|
||||
wayland-protocols to be installed. A reasonably recent release of the
|
||||
protocols is required, which, as always, is not available on Ubuntu.
|
||||
Seriously, stop trying to build modern software with that broken distro.
|
||||
- Fractional DPI scaling is now properly supported on Wayland.
|
||||
- Added Python bindings.
|
||||
- The per-line sampling statistics are now also displayed as a percentage
|
||||
of total program run time.
|
||||
- The out-of-focus render frame rate reduction can be now disabled in
|
||||
global settings.
|
||||
- It is now possible to load source files that are newer than the trace.
|
||||
The default setting is still to reject such files.
|
||||
- Memory limit for a capture can be now set, both in the GUI profiler and
|
||||
in the capture utility.
|
||||
- Thread list can be now sorted alphabetically.
|
||||
- It is now possible to adjust plot height.
|
||||
- Trace comparison statistics were expanded and made more clear.
|
||||
- Implemented retrieval of kernel symbol code on Linux.
|
||||
- Added support for multiple compression streams in trace files. This
|
||||
effectively parallelizes both load and save operations.
|
||||
- The default save setup is now set to Zstd level 3 with 4 compression
|
||||
streams. This gives both faster compression time and smaller file size.
|
||||
- New users will be now eased into the profiler with a set of tutorial
|
||||
achievements.
|
||||
- You can now set the timeline options default values in global settings.
|
||||
- Added a check for program memory being available before symbol retrieval
|
||||
on Windows.
|
||||
|
||||
|
||||
v0.10.0 (2023-10-16)
|
||||
|
||||
@@ -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++, Lua, Python and Fortran 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/tealsnow/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 graphics/compute APIs: OpenGL, Vulkan, Direct3D 11/12, Metal, OpenCL, CUDA, WebGPU.), 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
|
||||
@@ -17,8 +17,6 @@ Tracy supports profiling CPU (Direct support is provided for C, C++, Lua, Python
|
||||
|
||||

|
||||
|
||||
[An Introduction to Tracy Profiler in C++ - Marcos Slomp - CppCon 2023](https://youtu.be/ghXk3Bk5F2U?t=37)
|
||||
|
||||
[Introduction to Tracy Profiler v0.2](https://www.youtube.com/watch?v=fB5B46lbapc)
|
||||
[New features in Tracy Profiler v0.3](https://www.youtube.com/watch?v=3SXpDpDh2Uo)
|
||||
[New features in Tracy Profiler v0.4](https://www.youtube.com/watch?v=eAkgkaO8B9o)
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
set(NO_STATISTICS ON)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
project(
|
||||
tracy-capture
|
||||
LANGUAGES C CXX
|
||||
VERSION ${TRACY_VERSION_STRING}
|
||||
)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/config.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/vendor.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/server.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/GitRef.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/util.cmake)
|
||||
|
||||
set(PROGRAM_FILES
|
||||
src/capture.cpp
|
||||
)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${PROGRAM_FILES})
|
||||
add_git_ref(${PROJECT_NAME})
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE TracyServer TracyUtil TracyGetOpt)
|
||||
set_property(DIRECTORY ${CMAKE_CURRENT_LIST_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME})
|
||||
|
||||
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
add_executable(tracy-capture-daemon src/capturedaemon.cpp)
|
||||
add_git_ref(tracy-capture-daemon)
|
||||
target_link_libraries(tracy-capture-daemon PRIVATE TracyServer TracyUtil TracyGetOpt)
|
||||
|
||||
install(TARGETS tracy-capture-daemon DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"version": 10,
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "common",
|
||||
"hidden": true,
|
||||
"binaryDir": "${sourceDir}/build-${presetName}",
|
||||
"generator": "Ninja",
|
||||
"cacheVariables": {
|
||||
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "debug",
|
||||
"displayName": "Debug configuration",
|
||||
"inherits": "common",
|
||||
"binaryDir": "${sourceDir}/build",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "release",
|
||||
"displayName": "Release configuration",
|
||||
"inherits": "common",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
16
capture/build/unix/Makefile
Normal file
@@ -0,0 +1,16 @@
|
||||
all: release
|
||||
|
||||
debug:
|
||||
@$(MAKE) -f debug.mk all
|
||||
|
||||
release:
|
||||
@$(MAKE) -f release.mk all
|
||||
|
||||
clean:
|
||||
@$(MAKE) -f build.mk clean
|
||||
|
||||
db: clean
|
||||
@bear -- $(MAKE) -f debug.mk all
|
||||
@mv -f compile_commands.json ../../../
|
||||
|
||||
.PHONY: all clean debug release db
|
||||
12
capture/build/unix/build.mk
Normal file
@@ -0,0 +1,12 @@
|
||||
CFLAGS +=
|
||||
CXXFLAGS := $(CFLAGS) -std=gnu++17
|
||||
DEFINES += -DTRACY_NO_STATISTICS
|
||||
INCLUDES := $(shell pkg-config --cflags capstone)
|
||||
LIBS += $(shell pkg-config --libs capstone) -lpthread
|
||||
PROJECT := capture
|
||||
IMAGE := $(PROJECT)-$(BUILD)
|
||||
|
||||
FILTER := ../../../getopt/getopt.c
|
||||
include ../../../common/src-from-vcxproj.mk
|
||||
|
||||
include ../../../common/unix.mk
|
||||
6
capture/build/unix/debug.mk
Normal file
@@ -0,0 +1,6 @@
|
||||
CFLAGS := -g3 -Wall
|
||||
DEFINES := -DDEBUG
|
||||
BUILD := debug
|
||||
|
||||
include ../../../common/unix-debug.mk
|
||||
include build.mk
|
||||
9
capture/build/unix/release.mk
Normal file
@@ -0,0 +1,9 @@
|
||||
CFLAGS := -O3
|
||||
ifndef TRACY_NO_LTO
|
||||
CFLAGS += -flto
|
||||
endif
|
||||
DEFINES := -DNDEBUG
|
||||
BUILD := release
|
||||
|
||||
include ../../../common/unix-release.mk
|
||||
include build.mk
|
||||
25
capture/build/win32/capture.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30907.101
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "capture", "capture.vcxproj", "{447D58BF-94CD-4469-BB90-549C05D03E00}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{447D58BF-94CD-4469-BB90-549C05D03E00}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{447D58BF-94CD-4469-BB90-549C05D03E00}.Debug|x64.Build.0 = Debug|x64
|
||||
{447D58BF-94CD-4469-BB90-549C05D03E00}.Release|x64.ActiveCfg = Release|x64
|
||||
{447D58BF-94CD-4469-BB90-549C05D03E00}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {3E51386C-43EA-44AC-9F24-AFAFE4D63ADE}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
210
capture/build/win32/capture.vcxproj
Normal file
@@ -0,0 +1,210 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{447D58BF-94CD-4469-BB90-549C05D03E00}</ProjectGuid>
|
||||
<RootNamespace>capture</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<VcpkgTriplet>x64-windows-static</VcpkgTriplet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
<PropertyGroup Label="Vcpkg">
|
||||
<VcpkgEnableManifest>true</VcpkgEnableManifest>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>TRACY_NO_STATISTICS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32_LEAN_AND_MEAN;NOMINMAX;_USE_MATH_DEFINES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\include;$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\include\capstone;$(VcpkgManifestRoot)\vcpkg_installed\$(VcpkgTriplet)\$(VcpkgTriplet)\include\capstone;$(VcpkgRoot)\installed\$(VcpkgTriplet)\include\capstone</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ws2_32.lib;capstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\debug\lib</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>TRACY_NO_STATISTICS;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32_LEAN_AND_MEAN;NOMINMAX;_USE_MATH_DEFINES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\include;$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\include\capstone;$(VcpkgManifestRoot)\vcpkg_installed\$(VcpkgTriplet)\$(VcpkgTriplet)\include\capstone;$(VcpkgRoot)\installed\$(VcpkgTriplet)\include\capstone</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>ws2_32.lib;capstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\lib</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\getopt\getopt.c" />
|
||||
<ClCompile Include="..\..\..\public\common\TracySocket.cpp" />
|
||||
<ClCompile Include="..\..\..\public\common\TracyStackFrames.cpp" />
|
||||
<ClCompile Include="..\..\..\public\common\TracySystem.cpp" />
|
||||
<ClCompile Include="..\..\..\public\common\tracy_lz4.cpp" />
|
||||
<ClCompile Include="..\..\..\public\common\tracy_lz4hc.cpp" />
|
||||
<ClCompile Include="..\..\..\server\TracyMemory.cpp" />
|
||||
<ClCompile Include="..\..\..\server\TracyMmap.cpp" />
|
||||
<ClCompile Include="..\..\..\server\TracyPrint.cpp" />
|
||||
<ClCompile Include="..\..\..\server\TracyTaskDispatch.cpp" />
|
||||
<ClCompile Include="..\..\..\server\TracyTextureCompression.cpp" />
|
||||
<ClCompile Include="..\..\..\server\TracyThreadCompress.cpp" />
|
||||
<ClCompile Include="..\..\..\server\TracyWorker.cpp" />
|
||||
<ClCompile Include="..\..\..\zstd\common\debug.c" />
|
||||
<ClCompile Include="..\..\..\zstd\common\entropy_common.c" />
|
||||
<ClCompile Include="..\..\..\zstd\common\error_private.c" />
|
||||
<ClCompile Include="..\..\..\zstd\common\fse_decompress.c" />
|
||||
<ClCompile Include="..\..\..\zstd\common\pool.c" />
|
||||
<ClCompile Include="..\..\..\zstd\common\threading.c" />
|
||||
<ClCompile Include="..\..\..\zstd\common\xxhash.c" />
|
||||
<ClCompile Include="..\..\..\zstd\common\zstd_common.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\fse_compress.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\hist.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\huf_compress.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstdmt_compress.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_compress.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_literals.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_sequences.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_superblock.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_double_fast.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_fast.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_lazy.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_ldm.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_opt.c" />
|
||||
<ClCompile Include="..\..\..\zstd\decompress\huf_decompress.c" />
|
||||
<ClCompile Include="..\..\..\zstd\decompress\zstd_ddict.c" />
|
||||
<ClCompile Include="..\..\..\zstd\decompress\zstd_decompress.c" />
|
||||
<ClCompile Include="..\..\..\zstd\decompress\zstd_decompress_block.c" />
|
||||
<ClCompile Include="..\..\..\zstd\dictBuilder\cover.c" />
|
||||
<ClCompile Include="..\..\..\zstd\dictBuilder\divsufsort.c" />
|
||||
<ClCompile Include="..\..\..\zstd\dictBuilder\fastcover.c" />
|
||||
<ClCompile Include="..\..\..\zstd\dictBuilder\zdict.c" />
|
||||
<ClCompile Include="..\..\src\capture.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\getopt\getopt.h" />
|
||||
<ClInclude Include="..\..\..\public\common\TracyAlign.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\TracyAlloc.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\TracyApi.h" />
|
||||
<ClInclude Include="..\..\..\public\common\TracyColor.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\TracyForceInline.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\TracyMutex.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\TracyProtocol.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\TracyQueue.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\TracySocket.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\TracyStackFrames.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\TracySystem.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\TracyUwp.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\TracyYield.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\tracy_lz4.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\tracy_lz4hc.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyCharUtil.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyEvent.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyFileRead.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyFileWrite.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyMemory.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyMmap.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyPopcnt.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyPrint.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracySlab.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyTaskDispatch.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyTextureCompression.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyThreadCompress.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyVector.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyWorker.hpp" />
|
||||
<ClInclude Include="..\..\..\zstd\common\bitstream.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\compiler.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\cpu.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\debug.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\error_private.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\fse.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\huf.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\mem.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\pool.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\portability_macros.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\threading.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\xxhash.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\zstd_deps.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\zstd_internal.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\zstd_trace.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\clevels.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\hist.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstdmt_compress.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_internal.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_literals.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_sequences.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_superblock.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_cwksp.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_double_fast.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_fast.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_lazy.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_ldm.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_ldm_geartab.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_opt.h" />
|
||||
<ClInclude Include="..\..\..\zstd\decompress\zstd_ddict.h" />
|
||||
<ClInclude Include="..\..\..\zstd\decompress\zstd_decompress_block.h" />
|
||||
<ClInclude Include="..\..\..\zstd\decompress\zstd_decompress_internal.h" />
|
||||
<ClInclude Include="..\..\..\zstd\dictBuilder\cover.h" />
|
||||
<ClInclude Include="..\..\..\zstd\dictBuilder\divsufsort.h" />
|
||||
<ClInclude Include="..\..\..\zstd\zdict.h" />
|
||||
<ClInclude Include="..\..\..\zstd\zstd.h" />
|
||||
<ClInclude Include="..\..\..\zstd\zstd_errors.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\..\zstd\decompress\huf_decompress_amd64.S" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
371
capture/build/win32/capture.vcxproj.filters
Normal file
@@ -0,0 +1,371 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="src">
|
||||
<UniqueIdentifier>{729c80ee-4d26-4a5e-8f1f-6c075783eb56}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="server">
|
||||
<UniqueIdentifier>{cf23ef7b-7694-4154-830b-00cf053350ea}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="common">
|
||||
<UniqueIdentifier>{e39d3623-47cd-4752-8da9-3ea324f964c1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="getopt">
|
||||
<UniqueIdentifier>{ee9737d2-69c7-44da-b9c7-539d18f9d4b4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="zstd">
|
||||
<UniqueIdentifier>{f201463b-5e69-46fe-bdfc-1b5eed86c7f7}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="zstd\common">
|
||||
<UniqueIdentifier>{7e93ae33-6543-4bca-b05b-50818dbf24cc}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="zstd\compress">
|
||||
<UniqueIdentifier>{3b0c32f5-9efb-4503-9394-5ab95909fb1c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="zstd\decompress">
|
||||
<UniqueIdentifier>{c1f99170-d904-4af1-8010-0a3ded5736c8}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="zstd\dictBuilder">
|
||||
<UniqueIdentifier>{456e6786-ea57-42b8-ae38-829cd2d918bd}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\server\TracyMemory.cpp">
|
||||
<Filter>server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\server\TracyWorker.cpp">
|
||||
<Filter>server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\capture.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\server\TracyPrint.cpp">
|
||||
<Filter>server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\server\TracyThreadCompress.cpp">
|
||||
<Filter>server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\server\TracyTaskDispatch.cpp">
|
||||
<Filter>server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\server\TracyMmap.cpp">
|
||||
<Filter>server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\server\TracyTextureCompression.cpp">
|
||||
<Filter>server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\getopt\getopt.c">
|
||||
<Filter>getopt</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\common\debug.c">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\common\entropy_common.c">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\common\error_private.c">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\common\fse_decompress.c">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\common\pool.c">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\common\threading.c">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\common\xxhash.c">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\common\zstd_common.c">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\fse_compress.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\hist.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\huf_compress.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_compress.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_literals.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_sequences.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_superblock.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_double_fast.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_fast.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_lazy.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_ldm.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_opt.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstdmt_compress.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\decompress\huf_decompress.c">
|
||||
<Filter>zstd\decompress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\decompress\zstd_ddict.c">
|
||||
<Filter>zstd\decompress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\decompress\zstd_decompress.c">
|
||||
<Filter>zstd\decompress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\decompress\zstd_decompress_block.c">
|
||||
<Filter>zstd\decompress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\dictBuilder\cover.c">
|
||||
<Filter>zstd\dictBuilder</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\dictBuilder\divsufsort.c">
|
||||
<Filter>zstd\dictBuilder</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\dictBuilder\fastcover.c">
|
||||
<Filter>zstd\dictBuilder</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\dictBuilder\zdict.c">
|
||||
<Filter>zstd\dictBuilder</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\public\common\tracy_lz4.cpp">
|
||||
<Filter>common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\public\common\tracy_lz4hc.cpp">
|
||||
<Filter>common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\public\common\TracySocket.cpp">
|
||||
<Filter>common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\public\common\TracyStackFrames.cpp">
|
||||
<Filter>common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\public\common\TracySystem.cpp">
|
||||
<Filter>common</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\server\TracyCharUtil.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyEvent.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyFileWrite.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyMemory.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyPopcnt.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracySlab.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyVector.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyWorker.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyPrint.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyThreadCompress.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyTaskDispatch.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyFileRead.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyMmap.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyTextureCompression.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\getopt\getopt.h">
|
||||
<Filter>getopt</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\zstd.h">
|
||||
<Filter>zstd</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\zstd_errors.h">
|
||||
<Filter>zstd</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\bitstream.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\compiler.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\cpu.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\debug.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\error_private.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\fse.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\huf.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\mem.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\pool.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\threading.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\xxhash.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\zstd_deps.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\zstd_internal.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\zstd_trace.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\hist.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_internal.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_literals.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_sequences.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_superblock.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_cwksp.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_double_fast.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_fast.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_lazy.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_ldm.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_ldm_geartab.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_opt.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstdmt_compress.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\decompress\zstd_ddict.h">
|
||||
<Filter>zstd\decompress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\decompress\zstd_decompress_block.h">
|
||||
<Filter>zstd\decompress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\decompress\zstd_decompress_internal.h">
|
||||
<Filter>zstd\decompress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\dictBuilder\cover.h">
|
||||
<Filter>zstd\dictBuilder</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\dictBuilder\divsufsort.h">
|
||||
<Filter>zstd\dictBuilder</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\zdict.h">
|
||||
<Filter>zstd</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\portability_macros.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\clevels.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\tracy_lz4.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\tracy_lz4hc.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracyAlign.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracyAlloc.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracyApi.h">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracyColor.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracyForceInline.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracyMutex.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracyProtocol.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracyQueue.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracySocket.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracyStackFrames.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracySystem.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracyUwp.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracyYield.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\..\zstd\decompress\huf_decompress_amd64.S">
|
||||
<Filter>zstd\decompress</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,5 +1,6 @@
|
||||
#ifdef _WIN32
|
||||
# include <windows.h>
|
||||
# include <io.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
@@ -7,21 +8,20 @@
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
#include <inttypes.h>
|
||||
#include <mutex>
|
||||
#include <signal.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "../../public/common/TracyProtocol.hpp"
|
||||
#include "../../public/common/TracyStackFrames.hpp"
|
||||
#include "../../server/TracyFileWrite.hpp"
|
||||
#include "../../server/TracyMemory.hpp"
|
||||
#include "../../server/TracyPrint.hpp"
|
||||
#include "../../server/TracySysUtil.hpp"
|
||||
#include "../../server/TracyWorker.hpp"
|
||||
#include "../../public/common/TracyVersion.hpp"
|
||||
#include "GitRef.hpp"
|
||||
#include "CaptureFileBackup.hpp"
|
||||
#include "CaptureConsole.hpp"
|
||||
|
||||
#include "CaptureOutput.hpp"
|
||||
|
||||
#ifdef _WIN32
|
||||
# include "../../getopt/getopt.h"
|
||||
@@ -37,13 +37,60 @@ static std::atomic<bool> s_disconnect { false };
|
||||
|
||||
void SigInt( int )
|
||||
{
|
||||
// Relaxed order is closest to a traditional `volatile` write.
|
||||
// We don't need stronger ordering since this signal handler doesn't do
|
||||
// anything else that would need to be ordered relatively to this.
|
||||
s_disconnect.store(true, std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
static bool s_isStdoutATerminal = false;
|
||||
|
||||
void InitIsStdoutATerminal() {
|
||||
#ifdef _WIN32
|
||||
s_isStdoutATerminal = _isatty( fileno( stdout ) );
|
||||
#else
|
||||
s_isStdoutATerminal = isatty( fileno( stdout ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
bool IsStdoutATerminal() { return s_isStdoutATerminal; }
|
||||
|
||||
#define ANSI_RESET "\033[0m"
|
||||
#define ANSI_BOLD "\033[1m"
|
||||
#define ANSI_BLACK "\033[30m"
|
||||
#define ANSI_RED "\033[31m"
|
||||
#define ANSI_GREEN "\033[32m"
|
||||
#define ANSI_YELLOW "\033[33m"
|
||||
#define ANSI_MAGENTA "\033[35m"
|
||||
#define ANSI_CYAN "\033[36m"
|
||||
#define ANSI_ERASE_LINE "\033[2K"
|
||||
|
||||
// Like printf, but if stdout is a terminal, prepends the output with
|
||||
// the given `ansiEscape` and appends ANSI_RESET.
|
||||
void AnsiPrintf( const char* ansiEscape, const char* format, ... ) {
|
||||
if( IsStdoutATerminal() )
|
||||
{
|
||||
// Prepend ansiEscape and append ANSI_RESET.
|
||||
char buf[256];
|
||||
va_list args;
|
||||
va_start( args, format );
|
||||
vsnprintf( buf, sizeof buf, format, args );
|
||||
va_end( args );
|
||||
printf( "%s%s" ANSI_RESET, ansiEscape, buf );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Just a normal printf.
|
||||
va_list args;
|
||||
va_start( args, format );
|
||||
vfprintf( stdout, format, args );
|
||||
va_end( args );
|
||||
}
|
||||
}
|
||||
|
||||
[[noreturn]] void Usage()
|
||||
{
|
||||
printf( "tracy-capture %i.%i.%i / %s\n\n", tracy::Version::Major, tracy::Version::Minor, tracy::Version::Patch, tracy::GitRef );
|
||||
printf( "Usage: capture -o output.tracy [-a address] [-p port] [-f] [-s seconds] [-m memlimit]\n" );
|
||||
printf( "Usage: capture -o output.tracy [-a address] [-p port] [-f] [-s seconds]\n" );
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
@@ -57,17 +104,16 @@ int main( int argc, char** argv )
|
||||
}
|
||||
#endif
|
||||
|
||||
InitTerminalDetection();
|
||||
InitIsStdoutATerminal();
|
||||
|
||||
bool overwrite = false;
|
||||
const char* address = "127.0.0.1";
|
||||
const char* output = nullptr;
|
||||
int port = 8086;
|
||||
int seconds = -1;
|
||||
int64_t memoryLimit = -1;
|
||||
|
||||
int c;
|
||||
while( ( c = getopt( argc, argv, "a:o:p:fs:m:" ) ) != -1 )
|
||||
while( ( c = getopt( argc, argv, "a:o:p:fs:" ) ) != -1 )
|
||||
{
|
||||
switch( c )
|
||||
{
|
||||
@@ -84,10 +130,7 @@ int main( int argc, char** argv )
|
||||
overwrite = true;
|
||||
break;
|
||||
case 's':
|
||||
seconds = atoi(optarg);
|
||||
break;
|
||||
case 'm':
|
||||
memoryLimit = std::clamp( atoll( optarg ), 1ll, 999ll ) * tracy::GetPhysicalMemorySize() / 100;
|
||||
seconds = atoi (optarg);
|
||||
break;
|
||||
default:
|
||||
Usage();
|
||||
@@ -97,25 +140,46 @@ int main( int argc, char** argv )
|
||||
|
||||
if( !address || !output ) Usage();
|
||||
|
||||
const char* prepError = nullptr;
|
||||
const auto prep = tracy::PrepareOutputFile( output, overwrite, &prepError );
|
||||
if( prep == tracy::OutputPrep::Exists )
|
||||
struct stat st;
|
||||
if( stat( output, &st ) == 0 && !overwrite )
|
||||
{
|
||||
printf( "Output file %s already exists! Use -f to force overwrite.\n", output );
|
||||
return 4;
|
||||
}
|
||||
if( prep == tracy::OutputPrep::Unusable )
|
||||
|
||||
FILE* test = fopen( output, "wb" );
|
||||
if( !test )
|
||||
{
|
||||
printf( "Cannot use output file: %s!\n", prepError );
|
||||
printf( "Cannot open output file %s for writing!\n", output );
|
||||
return 5;
|
||||
}
|
||||
fclose( test );
|
||||
unlink( output );
|
||||
|
||||
printf( "Connecting to %s:%i...", address, port );
|
||||
fflush( stdout );
|
||||
tracy::Worker worker( address, port, memoryLimit );
|
||||
int result = WaitForConnection( worker );
|
||||
if( result != 0 ) return result;
|
||||
printf( "\nTimer resolution: %s\n", tracy::TimeToString( worker.GetResolution() ) );
|
||||
tracy::Worker worker( address, port );
|
||||
while( !worker.HasData() )
|
||||
{
|
||||
const auto handshake = worker.GetHandshakeStatus();
|
||||
if( handshake == tracy::HandshakeProtocolMismatch )
|
||||
{
|
||||
printf( "\nThe client you are trying to connect to uses incompatible protocol version.\nMake sure you are using the same Tracy version on both client and server.\n" );
|
||||
return 1;
|
||||
}
|
||||
if( handshake == tracy::HandshakeNotAvailable )
|
||||
{
|
||||
printf( "\nThe client you are trying to connect to is no longer able to sent profiling data,\nbecause another server was already connected to it.\nYou can do the following:\n\n 1. Restart the client application.\n 2. Rebuild the client application with on-demand mode enabled.\n" );
|
||||
return 2;
|
||||
}
|
||||
if( handshake == tracy::HandshakeDropped )
|
||||
{
|
||||
printf( "\nThe client you are trying to connect to has disconnected during the initial\nconnection handshake. Please check your network configuration.\n" );
|
||||
return 3;
|
||||
}
|
||||
std::this_thread::sleep_for( std::chrono::milliseconds( 100 ) );
|
||||
}
|
||||
printf( "\nQueue delay: %s\nTimer resolution: %s\n", tracy::TimeToString( worker.GetDelay() ), tracy::TimeToString( worker.GetResolution() ) );
|
||||
|
||||
#ifdef _WIN32
|
||||
signal( SIGINT, SigInt );
|
||||
@@ -127,19 +191,54 @@ int main( int argc, char** argv )
|
||||
#endif
|
||||
|
||||
const auto firstTime = worker.GetFirstTime();
|
||||
auto& lock = worker.GetMbpsDataLock();
|
||||
|
||||
const auto t0 = std::chrono::high_resolution_clock::now();
|
||||
while( worker.IsConnected() )
|
||||
{
|
||||
// Relaxed order is sufficient here because `s_disconnect` is only ever
|
||||
// set by this thread or by the SigInt handler, and that handler does
|
||||
// nothing else than storing `s_disconnect`.
|
||||
if( s_disconnect.load( std::memory_order_relaxed ) )
|
||||
{
|
||||
worker.Disconnect();
|
||||
// Relaxed order is sufficient because only this thread ever reads
|
||||
// this value.
|
||||
s_disconnect.store(false, std::memory_order_relaxed );
|
||||
while( worker.IsConnected() ) std::this_thread::sleep_for( std::chrono::milliseconds( 100 ) );
|
||||
break;
|
||||
}
|
||||
|
||||
PrintCaptureProgress( worker, firstTime, memoryLimit );
|
||||
lock.lock();
|
||||
const auto mbps = worker.GetMbpsData().back();
|
||||
const auto compRatio = worker.GetCompRatio();
|
||||
const auto netTotal = worker.GetDataTransferred();
|
||||
lock.unlock();
|
||||
|
||||
// Output progress info only if destination is a TTY to avoid bloating
|
||||
// log files (so this is not just about usage of ANSI color codes).
|
||||
if( IsStdoutATerminal() )
|
||||
{
|
||||
const char* unit = "Mbps";
|
||||
float unitsPerMbps = 1.f;
|
||||
if( mbps < 0.1f )
|
||||
{
|
||||
unit = "Kbps";
|
||||
unitsPerMbps = 1000.f;
|
||||
}
|
||||
AnsiPrintf( ANSI_ERASE_LINE ANSI_CYAN ANSI_BOLD, "\r%7.2f %s", mbps * unitsPerMbps, unit );
|
||||
printf( " /");
|
||||
AnsiPrintf( ANSI_CYAN ANSI_BOLD, "%5.1f%%", compRatio * 100.f );
|
||||
printf( " =");
|
||||
AnsiPrintf( ANSI_YELLOW ANSI_BOLD, "%7.2f Mbps", mbps / compRatio );
|
||||
printf( " | ");
|
||||
AnsiPrintf( ANSI_YELLOW, "Tx: ");
|
||||
AnsiPrintf( ANSI_GREEN, "%s", tracy::MemSizeToString( netTotal ) );
|
||||
printf( " | ");
|
||||
AnsiPrintf( ANSI_RED ANSI_BOLD, "%s", tracy::MemSizeToString( tracy::memUsage ) );
|
||||
printf( " | ");
|
||||
AnsiPrintf( ANSI_RED, "%s", tracy::TimeToString( worker.GetLastTime() - firstTime ) );
|
||||
fflush( stdout );
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for( std::chrono::milliseconds( 100 ) );
|
||||
if( seconds != -1 )
|
||||
@@ -147,19 +246,96 @@ int main( int argc, char** argv )
|
||||
const auto dur = std::chrono::high_resolution_clock::now() - t0;
|
||||
if( std::chrono::duration_cast<std::chrono::seconds>(dur).count() >= seconds )
|
||||
{
|
||||
// Relaxed order is sufficient because only this thread ever reads
|
||||
// this value.
|
||||
s_disconnect.store(true, std::memory_order_relaxed );
|
||||
}
|
||||
}
|
||||
}
|
||||
const auto t1 = std::chrono::high_resolution_clock::now();
|
||||
|
||||
PrintWorkerFailure( worker );
|
||||
const auto& failure = worker.GetFailureType();
|
||||
if( failure != tracy::Worker::Failure::None )
|
||||
{
|
||||
AnsiPrintf( ANSI_RED ANSI_BOLD, "\nInstrumentation failure: %s", tracy::Worker::GetFailureString( failure ) );
|
||||
auto& fd = worker.GetFailureData();
|
||||
if( !fd.message.empty() )
|
||||
{
|
||||
printf( "\nContext: %s", fd.message.c_str() );
|
||||
}
|
||||
if( fd.callstack != 0 )
|
||||
{
|
||||
AnsiPrintf( ANSI_BOLD, "\n%sFailure callstack:%s\n" );
|
||||
auto& cs = worker.GetCallstack( fd.callstack );
|
||||
int fidx = 0;
|
||||
for( auto& entry : cs )
|
||||
{
|
||||
auto frameData = worker.GetCallstackFrame( entry );
|
||||
if( !frameData )
|
||||
{
|
||||
printf( "%3i. %p\n", fidx++, (void*)worker.GetCanonicalPointer( entry ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto fsz = frameData->size;
|
||||
for( uint8_t f=0; f<fsz; f++ )
|
||||
{
|
||||
const auto& frame = frameData->data[f];
|
||||
auto txt = worker.GetString( frame.name );
|
||||
|
||||
if( fidx == 0 && f != fsz-1 )
|
||||
{
|
||||
auto test = tracy::s_tracyStackFrames;
|
||||
bool match = false;
|
||||
do
|
||||
{
|
||||
if( strcmp( txt, *test ) == 0 )
|
||||
{
|
||||
match = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
while( *++test );
|
||||
if( match ) continue;
|
||||
}
|
||||
|
||||
if( f == fsz-1 )
|
||||
{
|
||||
printf( "%3i. ", fidx++ );
|
||||
}
|
||||
else
|
||||
{
|
||||
AnsiPrintf( ANSI_BLACK ANSI_BOLD, "inl. " );
|
||||
}
|
||||
AnsiPrintf( ANSI_CYAN, "%s ", txt );
|
||||
txt = worker.GetString( frame.file );
|
||||
if( frame.line == 0 )
|
||||
{
|
||||
AnsiPrintf( ANSI_YELLOW, "(%s)", txt );
|
||||
}
|
||||
else
|
||||
{
|
||||
AnsiPrintf( ANSI_YELLOW, "(%s:%" PRIu32 ")", txt, frame.line );
|
||||
}
|
||||
if( frameData->imageName.Active() )
|
||||
{
|
||||
AnsiPrintf( ANSI_MAGENTA, " %s\n", worker.GetString( frameData->imageName ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
printf( "\n" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
printf( "\nFrames: %" PRIu64 "\nTime span: %s\nZones: %s\nElapsed time: %s\nSaving trace...",
|
||||
worker.GetFrameCount( *worker.GetFramesBase() ), tracy::TimeToString( worker.GetLastTime() - firstTime ), tracy::RealToString( worker.GetZoneCount() ),
|
||||
tracy::TimeToString( std::chrono::duration_cast<std::chrono::nanoseconds>( t1 - t0 ).count() ) );
|
||||
fflush( stdout );
|
||||
auto f = std::unique_ptr<tracy::FileWrite>( tracy::FileWrite::Open( output, tracy::FileCompression::Zstd, 3, 4 ) );
|
||||
auto f = std::unique_ptr<tracy::FileWrite>( tracy::FileWrite::Open( output ) );
|
||||
if( f )
|
||||
{
|
||||
worker.Write( *f, false );
|
||||
@@ -167,12 +343,10 @@ int main( int argc, char** argv )
|
||||
f->Finish();
|
||||
const auto stats = f->GetCompressionStatistics();
|
||||
printf( "Trace size %s (%.2f%% ratio)\n", tracy::MemSizeToString( stats.second ), 100.f * stats.second / stats.first );
|
||||
tracy::DiscardOutputBackup();
|
||||
}
|
||||
else
|
||||
{
|
||||
AnsiPrintf( ANSI_RED ANSI_BOLD, " failed!\n");
|
||||
tracy::RestoreOutputBackup();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1,505 +0,0 @@
|
||||
#ifdef _WIN32
|
||||
# include <process.h>
|
||||
# include <windows.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
#include <cerrno>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <fcntl.h>
|
||||
#include <filesystem>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <signal.h>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
#include "../../getopt/getopt.h"
|
||||
#include "../../public/common/TracySocket.hpp"
|
||||
#include "../../public/common/TracyVersion.hpp"
|
||||
#include "../../server/TracyBroadcast.hpp"
|
||||
#include "../../server/TracyFileWrite.hpp"
|
||||
#include "../../server/TracyMemory.hpp"
|
||||
#include "../../server/TracyPrint.hpp"
|
||||
#include "../../server/TracySysUtil.hpp"
|
||||
#include "../../server/TracyWorker.hpp"
|
||||
#include "GitRef.hpp"
|
||||
|
||||
#include "CaptureConsole.hpp"
|
||||
#include "CaptureOutput.hpp"
|
||||
|
||||
static std::atomic<bool> g_shutdown{false};
|
||||
static std::mutex g_clientsMutex;
|
||||
static uint16_t g_listenPort = 8086;
|
||||
static std::string g_filterName;
|
||||
static int g_filterPort = 0;
|
||||
static int64_t g_memoryLimit = -1;
|
||||
static std::string g_lockFile;
|
||||
|
||||
void SigInt( int )
|
||||
{
|
||||
g_shutdown.store( true, std::memory_order_relaxed );
|
||||
}
|
||||
|
||||
static void RemoveLockFile()
|
||||
{
|
||||
std::error_code ec;
|
||||
std::filesystem::remove( g_lockFile, ec );
|
||||
}
|
||||
|
||||
static long ReadLockPid( const std::string& path )
|
||||
{
|
||||
FILE* in = fopen( path.c_str(), "r" );
|
||||
if( !in ) return -1;
|
||||
long pid = -1;
|
||||
const int result = fscanf( in, "%li", &pid );
|
||||
fclose( in );
|
||||
return ( result == 1 && pid > 0 ) ? pid : -1;
|
||||
}
|
||||
|
||||
struct ClientStats
|
||||
{
|
||||
std::atomic<float> mbps{0};
|
||||
std::atomic<int64_t> txBytes{0};
|
||||
std::atomic<int64_t> memUsage{0};
|
||||
std::atomic<int64_t> firstTime{-1};
|
||||
};
|
||||
|
||||
struct ClientSession
|
||||
{
|
||||
std::string id;
|
||||
std::string programName;
|
||||
std::string address;
|
||||
uint16_t port;
|
||||
std::string outputFile;
|
||||
std::thread thread;
|
||||
std::atomic<bool> active{true};
|
||||
std::atomic<bool> finished{false};
|
||||
ClientStats stats;
|
||||
std::atomic<uint64_t> fileSize{0};
|
||||
};
|
||||
|
||||
static std::map<std::string, ClientSession*> g_clients;
|
||||
static std::unordered_set<std::string> g_outputFiles;
|
||||
|
||||
[[noreturn]] void Usage()
|
||||
{
|
||||
printf( "tracy-capture-daemon %i.%i.%i / %s\n\n", tracy::Version::Major, tracy::Version::Minor, tracy::Version::Patch, tracy::GitRef );
|
||||
printf( "Usage: tracy-capture-daemon -o <output_dir> [options]\n\n" );
|
||||
printf( "Options:\n" );
|
||||
printf( " -o, --output <dir> Output directory (required)\n" );
|
||||
printf( " -p, --port <port> UDP listen port (default: 8086)\n" );
|
||||
printf( " -m, --memory <limit> Memory limit per client as %% of system RAM\n" );
|
||||
printf( " --filter-name <pattern> Only capture clients matching program name\n" );
|
||||
printf( " --filter-port <port> Only capture clients with specific data port\n" );
|
||||
printf( " -h, --help Show this help\n" );
|
||||
printf( " -V, --version Show version information\n" );
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
std::string SanitizeName( const std::string& name )
|
||||
{
|
||||
std::string result;
|
||||
for( char c : name )
|
||||
{
|
||||
if( ( c >= 'a' && c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) || ( c >= '0' && c <= '9' ) || c == '_' || c == '-' )
|
||||
{
|
||||
result += c;
|
||||
}
|
||||
else if( c == ' ' || c == '\t' )
|
||||
{
|
||||
result += '_';
|
||||
}
|
||||
}
|
||||
if( result.empty() ) result = "unknown";
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string GenerateOutputFilename( const std::string& outputDir, const std::string& programName, const std::string& address, uint16_t port )
|
||||
{
|
||||
std::string base = SanitizeName( programName ) + "_" + address + "_" + std::to_string( port );
|
||||
std::string candidate = base + ".tracy";
|
||||
std::string path = outputDir + "/" + candidate;
|
||||
|
||||
int idx = 0;
|
||||
while( g_outputFiles.count( path ) || std::filesystem::exists( path ) )
|
||||
{
|
||||
idx++;
|
||||
candidate = base + "_" + std::to_string( idx ) + ".tracy";
|
||||
path = outputDir + "/" + candidate;
|
||||
}
|
||||
|
||||
g_outputFiles.insert( path );
|
||||
return path;
|
||||
}
|
||||
|
||||
bool MatchesFilters( const tracy::BroadcastMessage& msg )
|
||||
{
|
||||
if( !g_filterName.empty() )
|
||||
{
|
||||
if( strstr( msg.programName, g_filterName.c_str() ) == nullptr )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if( g_filterPort > 0 && msg.listenPort != g_filterPort )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void CaptureThread( ClientSession* session, const std::string& address, uint16_t port, int64_t memoryLimit, const std::string& outputFile )
|
||||
{
|
||||
printf( "Connecting to %s:%u...\n", address.c_str(), port );
|
||||
fflush( stdout );
|
||||
|
||||
tracy::Worker worker( address.c_str(), port, memoryLimit );
|
||||
|
||||
int result = WaitForConnection( worker );
|
||||
if( result != 0 )
|
||||
{
|
||||
session->active = false;
|
||||
session->finished = true;
|
||||
return;
|
||||
}
|
||||
|
||||
printf( "Connected to %s (%s:%u)\n", session->programName.c_str(), address.c_str(), port );
|
||||
|
||||
int64_t firstTime = worker.GetFirstTime();
|
||||
session->stats.firstTime = firstTime;
|
||||
|
||||
while( session->active && worker.IsConnected() )
|
||||
{
|
||||
auto& lock = worker.GetMbpsDataLock();
|
||||
lock.lock();
|
||||
const auto& mbpsData = worker.GetMbpsData();
|
||||
if( !mbpsData.empty() )
|
||||
{
|
||||
session->stats.mbps = mbpsData.back();
|
||||
session->stats.txBytes = worker.GetDataTransferred();
|
||||
}
|
||||
lock.unlock();
|
||||
session->stats.memUsage = tracy::memUsage.load( std::memory_order_relaxed );
|
||||
|
||||
std::this_thread::sleep_for( std::chrono::milliseconds( 100 ) );
|
||||
}
|
||||
|
||||
if( worker.IsConnected() )
|
||||
{
|
||||
worker.Disconnect();
|
||||
while( worker.IsConnected() ) std::this_thread::sleep_for( std::chrono::milliseconds( 100 ) );
|
||||
}
|
||||
|
||||
printf( "\nSaving %s...", outputFile.c_str() );
|
||||
fflush( stdout );
|
||||
|
||||
auto file = std::unique_ptr<tracy::FileWrite>( tracy::FileWrite::Open( outputFile.c_str(), tracy::FileCompression::Zstd, 3, 4 ) );
|
||||
if( file )
|
||||
{
|
||||
worker.Write( *file, false );
|
||||
file->Finish();
|
||||
auto stats = file->GetCompressionStatistics();
|
||||
session->fileSize = stats.second;
|
||||
AnsiPrintf( ANSI_GREEN ANSI_BOLD, " done!\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
AnsiPrintf( ANSI_RED ANSI_BOLD, " failed!\n" );
|
||||
}
|
||||
|
||||
session->finished = true;
|
||||
session->active = false;
|
||||
}
|
||||
|
||||
void RefreshDisplay( const std::string& listenAddr )
|
||||
{
|
||||
if( !IsTerminal() ) return;
|
||||
|
||||
printf( "\033[H\033[J" );
|
||||
|
||||
size_t clientCount = 0;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock( g_clientsMutex );
|
||||
clientCount = g_clients.size();
|
||||
}
|
||||
|
||||
printf( "[%zu client%s] Listening on %s:%u... Press Ctrl+C to stop\n\n", clientCount, clientCount == 1 ? "" : "s", listenAddr.c_str(), g_listenPort );
|
||||
|
||||
int idx = 1;
|
||||
float totalMbps = 0;
|
||||
int64_t totalTx = 0;
|
||||
int64_t totalMem = 0;
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock( g_clientsMutex );
|
||||
for( auto& [id, session] : g_clients )
|
||||
{
|
||||
printf( " [%d] %s @ %s:%u ", idx, session->programName.c_str(), session->address.c_str(), session->port );
|
||||
|
||||
if( session->finished )
|
||||
{
|
||||
printf( "finished (" );
|
||||
printf( "%s", tracy::MemSizeToString( session->fileSize.load() ) );
|
||||
printf( ")" );
|
||||
}
|
||||
else if( session->active )
|
||||
{
|
||||
float mbps = session->stats.mbps.load();
|
||||
int64_t tx = session->stats.txBytes.load();
|
||||
int64_t mem = session->stats.memUsage.load();
|
||||
int64_t firstTime = session->stats.firstTime.load();
|
||||
|
||||
printf( "%.1f Mbps | %s | %s", mbps, tracy::MemSizeToString( tx ), tracy::MemSizeToString( mem ) );
|
||||
|
||||
totalMbps += mbps;
|
||||
totalTx += tx;
|
||||
totalMem += mem;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf( "connecting..." );
|
||||
}
|
||||
printf( "\n" );
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
|
||||
printf( "\nTotal: %.1f Mbps | %s | Mem: %s", totalMbps, tracy::MemSizeToString( totalTx ), tracy::MemSizeToString( totalMem ) );
|
||||
fflush( stdout );
|
||||
}
|
||||
|
||||
void PrintSummary()
|
||||
{
|
||||
printf( "\n\n=== Capture Summary ===\n" );
|
||||
|
||||
std::lock_guard<std::mutex> lock( g_clientsMutex );
|
||||
int idx = 1;
|
||||
int64_t totalSize = 0;
|
||||
|
||||
for( auto& [id, session] : g_clients )
|
||||
{
|
||||
int64_t size = session->fileSize.load();
|
||||
totalSize += size;
|
||||
printf( " [%d] %s @ %s:%u -> %s (%s)\n", idx++, session->programName.c_str(), session->address.c_str(), session->port, session->outputFile.c_str(), tracy::MemSizeToString( size ) );
|
||||
}
|
||||
|
||||
printf( "\nTotal: %zu files, %s\n", g_clients.size(), tracy::MemSizeToString( totalSize ) );
|
||||
}
|
||||
|
||||
int main( int argc, char** argv )
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if( !AttachConsole( ATTACH_PARENT_PROCESS ) )
|
||||
{
|
||||
AllocConsole();
|
||||
SetConsoleMode( GetStdHandle( STD_OUTPUT_HANDLE ), 0x07 );
|
||||
}
|
||||
#endif
|
||||
|
||||
std::string outputDir;
|
||||
|
||||
static struct option longOptions[] = {
|
||||
{ "output", required_argument, nullptr, 'o' },
|
||||
{ "port", required_argument, nullptr, 'p' },
|
||||
{ "memory", required_argument, nullptr, 'm' },
|
||||
{ "filter-name", required_argument, nullptr, 1 },
|
||||
{ "filter-port", required_argument, nullptr, 2 },
|
||||
{ "help", no_argument, nullptr, 'h' },
|
||||
{ "version", no_argument, nullptr, 'V' },
|
||||
{ nullptr, 0, nullptr, 0 }
|
||||
};
|
||||
|
||||
int c;
|
||||
while( ( c = getopt_long( argc, argv, "o:p:m:hV", longOptions, nullptr ) ) != -1 )
|
||||
{
|
||||
switch( c )
|
||||
{
|
||||
case 'o':
|
||||
outputDir = optarg;
|
||||
break;
|
||||
case 'p':
|
||||
g_listenPort = atoi( optarg );
|
||||
break;
|
||||
case 'm':
|
||||
g_memoryLimit = std::clamp( atoll( optarg ), 1ll, 999ll ) * tracy::GetPhysicalMemorySize() / 100;
|
||||
break;
|
||||
case 1:
|
||||
g_filterName = optarg;
|
||||
break;
|
||||
case 2:
|
||||
g_filterPort = atoi( optarg );
|
||||
break;
|
||||
case 'h':
|
||||
Usage();
|
||||
break;
|
||||
case 'V':
|
||||
printf( "tracy-capture-daemon %i.%i.%i / %s\n", tracy::Version::Major, tracy::Version::Minor, tracy::Version::Patch, tracy::GitRef );
|
||||
exit( 0 );
|
||||
default:
|
||||
Usage();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( outputDir.empty() )
|
||||
{
|
||||
fprintf( stderr, "Error: Output directory is required (-o)\n\n" );
|
||||
Usage();
|
||||
}
|
||||
|
||||
std::filesystem::create_directories( outputDir );
|
||||
|
||||
InitTerminalDetection();
|
||||
#ifndef _WIN32
|
||||
g_lockFile = outputDir + "/.tracy-capture-daemon.lock";
|
||||
{
|
||||
int lockFd = -1;
|
||||
for( int attempt = 0; attempt < 5; attempt++ )
|
||||
{
|
||||
lockFd = open( g_lockFile.c_str(), O_CREAT | O_EXCL | O_WRONLY, 0644 );
|
||||
if( lockFd >= 0 ) break;
|
||||
if( errno != EEXIST )
|
||||
{
|
||||
fprintf( stderr, "Error: Cannot create the lock file %s: %s\n", g_lockFile.c_str(), strerror( errno ) );
|
||||
return 1;
|
||||
}
|
||||
const long owner = ReadLockPid( g_lockFile );
|
||||
if( owner <= 0 )
|
||||
{
|
||||
fprintf( stderr, "Error: The lock file %s has no readable owner PID; remove it by hand if no daemon is running\n", g_lockFile.c_str() );
|
||||
return 1;
|
||||
}
|
||||
// EPERM: the process exists under another user; treat it as alive.
|
||||
if( kill( owner, 0 ) == 0 || errno == EPERM )
|
||||
{
|
||||
fprintf( stderr, "Error: Another capture daemon (pid %ld) is already using the output directory %s\n", owner, outputDir.c_str() );
|
||||
return 1;
|
||||
}
|
||||
std::error_code ec;
|
||||
std::filesystem::remove( g_lockFile, ec );
|
||||
}
|
||||
if( lockFd < 0 )
|
||||
{
|
||||
fprintf( stderr, "Error: Another capture daemon is already using the output directory %s\n", outputDir.c_str() );
|
||||
return 1;
|
||||
}
|
||||
const std::string pid = std::to_string( getpid() );
|
||||
write( lockFd, pid.c_str(), pid.size() );
|
||||
close( lockFd );
|
||||
}
|
||||
atexit( RemoveLockFile );
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
signal( SIGINT, SigInt );
|
||||
#else
|
||||
struct sigaction sigint, oldsigint;
|
||||
memset( &sigint, 0, sizeof( sigint ) );
|
||||
sigint.sa_handler = SigInt;
|
||||
sigaction( SIGINT, &sigint, &oldsigint );
|
||||
#endif
|
||||
|
||||
tracy::UdpListen udpSocket;
|
||||
if( !udpSocket.Listen( g_listenPort ) )
|
||||
{
|
||||
fprintf( stderr, "Error: Failed to listen on port %u\n", g_listenPort );
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf( "Listening on 0.0.0.0:%u... Press Ctrl+C to stop\n", g_listenPort );
|
||||
printf( "Output directory: %s\n", outputDir.c_str() );
|
||||
|
||||
const std::string listenAddr = "0.0.0.0";
|
||||
auto lastDisplay = std::chrono::steady_clock::now();
|
||||
|
||||
while( !g_shutdown )
|
||||
{
|
||||
tracy::IpAddress clientAddr;
|
||||
size_t len;
|
||||
const char* msg = udpSocket.Read( len, clientAddr, 100 );
|
||||
|
||||
if( msg )
|
||||
{
|
||||
auto parsed = tracy::ParseBroadcastMessage( msg, len );
|
||||
if( parsed )
|
||||
{
|
||||
std::string clientId = std::to_string( parsed->pid ) + "_" + clientAddr.GetText() + "_" + std::to_string( parsed->listenPort );
|
||||
|
||||
bool isNew = false;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock( g_clientsMutex );
|
||||
isNew = g_clients.find( clientId ) == g_clients.end();
|
||||
}
|
||||
|
||||
if( isNew && MatchesFilters( *parsed ) )
|
||||
{
|
||||
std::string addressStr = clientAddr.GetText();
|
||||
std::string outputFile = GenerateOutputFilename( outputDir, parsed->programName, addressStr, parsed->listenPort );
|
||||
|
||||
auto session = new ClientSession();
|
||||
session->id = clientId;
|
||||
session->programName = parsed->programName;
|
||||
session->address = addressStr;
|
||||
session->port = parsed->listenPort;
|
||||
session->outputFile = outputFile;
|
||||
session->active = true;
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock( g_clientsMutex );
|
||||
g_clients[clientId] = session;
|
||||
}
|
||||
|
||||
session->thread = std::thread( CaptureThread, session, addressStr, parsed->listenPort, g_memoryLimit, outputFile );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto now = std::chrono::steady_clock::now();
|
||||
if( std::chrono::duration_cast<std::chrono::milliseconds>( now - lastDisplay ).count() >= 100 )
|
||||
{
|
||||
RefreshDisplay( listenAddr );
|
||||
lastDisplay = now;
|
||||
}
|
||||
}
|
||||
|
||||
printf( "\n\nShutting down... waiting for %zu client(s) to finish\n", g_clients.size() );
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock( g_clientsMutex );
|
||||
for( auto& [id, session] : g_clients )
|
||||
{
|
||||
session->active = false;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock( g_clientsMutex );
|
||||
for( auto& [id, session] : g_clients )
|
||||
{
|
||||
if( session->thread.joinable() )
|
||||
{
|
||||
session->thread.join();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PrintSummary();
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock( g_clientsMutex );
|
||||
for( auto& [id, session] : g_clients )
|
||||
{
|
||||
delete session;
|
||||
}
|
||||
g_clients.clear();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
1379
cmake/CPM.cmake
@@ -1,300 +0,0 @@
|
||||
#.rst:
|
||||
# ECMFindModuleHelpers
|
||||
# --------------------
|
||||
#
|
||||
# Helper macros for find modules: ecm_find_package_version_check(),
|
||||
# ecm_find_package_parse_components() and
|
||||
# ecm_find_package_handle_library_components().
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# ecm_find_package_version_check(<name>)
|
||||
#
|
||||
# Prints warnings if the CMake version or the project's required CMake version
|
||||
# is older than that required by extra-cmake-modules.
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# ecm_find_package_parse_components(<name>
|
||||
# RESULT_VAR <variable>
|
||||
# KNOWN_COMPONENTS <component1> [<component2> [...]]
|
||||
# [SKIP_DEPENDENCY_HANDLING])
|
||||
#
|
||||
# This macro will populate <variable> with a list of components found in
|
||||
# <name>_FIND_COMPONENTS, after checking that all those components are in the
|
||||
# list of KNOWN_COMPONENTS; if there are any unknown components, it will print
|
||||
# an error or warning (depending on the value of <name>_FIND_REQUIRED) and call
|
||||
# return().
|
||||
#
|
||||
# The order of components in <variable> is guaranteed to match the order they
|
||||
# are listed in the KNOWN_COMPONENTS argument.
|
||||
#
|
||||
# If SKIP_DEPENDENCY_HANDLING is not set, for each component the variable
|
||||
# <name>_<component>_component_deps will be checked for dependent components.
|
||||
# If <component> is listed in <name>_FIND_COMPONENTS, then all its (transitive)
|
||||
# dependencies will also be added to <variable>.
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# ecm_find_package_handle_library_components(<name>
|
||||
# COMPONENTS <component> [<component> [...]]
|
||||
# [SKIP_DEPENDENCY_HANDLING])
|
||||
# [SKIP_PKG_CONFIG])
|
||||
#
|
||||
# Creates an imported library target for each component. The operation of this
|
||||
# macro depends on the presence of a number of CMake variables.
|
||||
#
|
||||
# The <name>_<component>_lib variable should contain the name of this library,
|
||||
# and <name>_<component>_header variable should contain the name of a header
|
||||
# file associated with it (whatever relative path is normally passed to
|
||||
# '#include'). <name>_<component>_header_subdir variable can be used to specify
|
||||
# which subdirectory of the include path the headers will be found in.
|
||||
# ecm_find_package_components() will then search for the library
|
||||
# and include directory (creating appropriate cache variables) and create an
|
||||
# imported library target named <name>::<component>.
|
||||
#
|
||||
# Additional variables can be used to provide additional information:
|
||||
#
|
||||
# If SKIP_PKG_CONFIG, the <name>_<component>_pkg_config variable is set, and
|
||||
# pkg-config is found, the pkg-config module given by
|
||||
# <name>_<component>_pkg_config will be searched for and used to help locate the
|
||||
# library and header file. It will also be used to set
|
||||
# <name>_<component>_VERSION.
|
||||
#
|
||||
# Note that if version information is found via pkg-config,
|
||||
# <name>_<component>_FIND_VERSION can be set to require a particular version
|
||||
# for each component.
|
||||
#
|
||||
# If SKIP_DEPENDENCY_HANDLING is not set, the INTERFACE_LINK_LIBRARIES property
|
||||
# of the imported target for <component> will be set to contain the imported
|
||||
# targets for the components listed in <name>_<component>_component_deps.
|
||||
# <component>_FOUND will also be set to false if any of the components in
|
||||
# <name>_<component>_component_deps are not found. This requires the components
|
||||
# in <name>_<component>_component_deps to be listed before <component> in the
|
||||
# COMPONENTS argument.
|
||||
#
|
||||
# The following variables will be set:
|
||||
#
|
||||
# ``<name>_TARGETS``
|
||||
# the imported targets
|
||||
# ``<name>_LIBRARIES``
|
||||
# the found libraries
|
||||
# ``<name>_INCLUDE_DIRS``
|
||||
# the combined required include directories for the components
|
||||
# ``<name>_DEFINITIONS``
|
||||
# the "other" CFLAGS provided by pkg-config, if any
|
||||
# ``<name>_VERSION``
|
||||
# the value of ``<name>_<component>_VERSION`` for the first component that
|
||||
# has this variable set (note that components are searched for in the order
|
||||
# they are passed to the macro), although if it is already set, it will not
|
||||
# be altered
|
||||
#
|
||||
# Note that these variables are never cleared, so if
|
||||
# ecm_find_package_handle_library_components() is called multiple times with
|
||||
# different components (typically because of multiple find_package() calls) then
|
||||
# ``<name>_TARGETS``, for example, will contain all the targets found in any
|
||||
# call (although no duplicates).
|
||||
#
|
||||
# Since pre-1.0.0.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2014 Alex Merry <alex.merry@kde.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
macro(ecm_find_package_version_check module_name)
|
||||
if(CMAKE_VERSION VERSION_LESS 2.8.12)
|
||||
message(FATAL_ERROR "CMake 2.8.12 is required by Find${module_name}.cmake")
|
||||
endif()
|
||||
if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12)
|
||||
message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use Find${module_name}.cmake")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(ecm_find_package_parse_components module_name)
|
||||
set(ecm_fppc_options SKIP_DEPENDENCY_HANDLING)
|
||||
set(ecm_fppc_oneValueArgs RESULT_VAR)
|
||||
set(ecm_fppc_multiValueArgs KNOWN_COMPONENTS DEFAULT_COMPONENTS)
|
||||
cmake_parse_arguments(ECM_FPPC "${ecm_fppc_options}" "${ecm_fppc_oneValueArgs}" "${ecm_fppc_multiValueArgs}" ${ARGN})
|
||||
|
||||
if(ECM_FPPC_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "Unexpected arguments to ecm_find_package_parse_components: ${ECM_FPPC_UNPARSED_ARGUMENTS}")
|
||||
endif()
|
||||
if(NOT ECM_FPPC_RESULT_VAR)
|
||||
message(FATAL_ERROR "Missing RESULT_VAR argument to ecm_find_package_parse_components")
|
||||
endif()
|
||||
if(NOT ECM_FPPC_KNOWN_COMPONENTS)
|
||||
message(FATAL_ERROR "Missing KNOWN_COMPONENTS argument to ecm_find_package_parse_components")
|
||||
endif()
|
||||
if(NOT ECM_FPPC_DEFAULT_COMPONENTS)
|
||||
set(ECM_FPPC_DEFAULT_COMPONENTS ${ECM_FPPC_KNOWN_COMPONENTS})
|
||||
endif()
|
||||
|
||||
if(${module_name}_FIND_COMPONENTS)
|
||||
set(ecm_fppc_requestedComps ${${module_name}_FIND_COMPONENTS})
|
||||
|
||||
if(NOT ECM_FPPC_SKIP_DEPENDENCY_HANDLING)
|
||||
# Make sure deps are included
|
||||
foreach(ecm_fppc_comp ${ecm_fppc_requestedComps})
|
||||
foreach(ecm_fppc_dep_comp ${${module_name}_${ecm_fppc_comp}_component_deps})
|
||||
list(FIND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}" ecm_fppc_index)
|
||||
if("${ecm_fppc_index}" STREQUAL "-1")
|
||||
if(NOT ${module_name}_FIND_QUIETLY)
|
||||
message(STATUS "${module_name}: ${ecm_fppc_comp} requires ${${module_name}_${ecm_fppc_comp}_component_deps}")
|
||||
endif()
|
||||
list(APPEND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}")
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
else()
|
||||
message(STATUS "Skipping dependency handling for ${module_name}")
|
||||
endif()
|
||||
list(REMOVE_DUPLICATES ecm_fppc_requestedComps)
|
||||
|
||||
# This makes sure components are listed in the same order as
|
||||
# KNOWN_COMPONENTS (potentially important for inter-dependencies)
|
||||
set(${ECM_FPPC_RESULT_VAR})
|
||||
foreach(ecm_fppc_comp ${ECM_FPPC_KNOWN_COMPONENTS})
|
||||
list(FIND ecm_fppc_requestedComps "${ecm_fppc_comp}" ecm_fppc_index)
|
||||
if(NOT "${ecm_fppc_index}" STREQUAL "-1")
|
||||
list(APPEND ${ECM_FPPC_RESULT_VAR} "${ecm_fppc_comp}")
|
||||
list(REMOVE_AT ecm_fppc_requestedComps ${ecm_fppc_index})
|
||||
endif()
|
||||
endforeach()
|
||||
# if there are any left, they are unknown components
|
||||
if(ecm_fppc_requestedComps)
|
||||
set(ecm_fppc_msgType STATUS)
|
||||
if(${module_name}_FIND_REQUIRED)
|
||||
set(ecm_fppc_msgType FATAL_ERROR)
|
||||
endif()
|
||||
if(NOT ${module_name}_FIND_QUIETLY)
|
||||
message(${ecm_fppc_msgType} "${module_name}: requested unknown components ${ecm_fppc_requestedComps}")
|
||||
endif()
|
||||
return()
|
||||
endif()
|
||||
else()
|
||||
set(${ECM_FPPC_RESULT_VAR} ${ECM_FPPC_DEFAULT_COMPONENTS})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(ecm_find_package_handle_library_components module_name)
|
||||
set(ecm_fpwc_options SKIP_PKG_CONFIG SKIP_DEPENDENCY_HANDLING)
|
||||
set(ecm_fpwc_oneValueArgs)
|
||||
set(ecm_fpwc_multiValueArgs COMPONENTS)
|
||||
cmake_parse_arguments(ECM_FPWC "${ecm_fpwc_options}" "${ecm_fpwc_oneValueArgs}" "${ecm_fpwc_multiValueArgs}" ${ARGN})
|
||||
|
||||
if(ECM_FPWC_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "Unexpected arguments to ecm_find_package_handle_components: ${ECM_FPWC_UNPARSED_ARGUMENTS}")
|
||||
endif()
|
||||
if(NOT ECM_FPWC_COMPONENTS)
|
||||
message(FATAL_ERROR "Missing COMPONENTS argument to ecm_find_package_handle_components")
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package(PkgConfig QUIET)
|
||||
foreach(ecm_fpwc_comp ${ECM_FPWC_COMPONENTS})
|
||||
set(ecm_fpwc_dep_vars)
|
||||
set(ecm_fpwc_dep_targets)
|
||||
if(NOT SKIP_DEPENDENCY_HANDLING)
|
||||
foreach(ecm_fpwc_dep ${${module_name}_${ecm_fpwc_comp}_component_deps})
|
||||
list(APPEND ecm_fpwc_dep_vars "${module_name}_${ecm_fpwc_dep}_FOUND")
|
||||
list(APPEND ecm_fpwc_dep_targets "${module_name}::${ecm_fpwc_dep}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(NOT ECM_FPWC_SKIP_PKG_CONFIG AND ${module_name}_${ecm_fpwc_comp}_pkg_config)
|
||||
pkg_check_modules(PKG_${module_name}_${ecm_fpwc_comp} QUIET
|
||||
${${module_name}_${ecm_fpwc_comp}_pkg_config})
|
||||
endif()
|
||||
|
||||
find_path(${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
|
||||
NAMES ${${module_name}_${ecm_fpwc_comp}_header}
|
||||
HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES ${${module_name}_${ecm_fpwc_comp}_header_subdir}
|
||||
)
|
||||
find_library(${module_name}_${ecm_fpwc_comp}_LIBRARY
|
||||
NAMES ${${module_name}_${ecm_fpwc_comp}_lib}
|
||||
HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
set(${module_name}_${ecm_fpwc_comp}_VERSION "${PKG_${module_name}_${ecm_fpwc_comp}_VERSION}")
|
||||
if(NOT ${module_name}_VERSION)
|
||||
set(${module_name}_VERSION ${${module_name}_${ecm_fpwc_comp}_VERSION})
|
||||
endif()
|
||||
|
||||
set(_name_mismatched_arg)
|
||||
if(NOT CMAKE_VERSION VERSION_LESS 3.17)
|
||||
set(_name_mismatched_arg NAME_MISMATCHED)
|
||||
endif()
|
||||
find_package_handle_standard_args(${module_name}_${ecm_fpwc_comp}
|
||||
FOUND_VAR
|
||||
${module_name}_${ecm_fpwc_comp}_FOUND
|
||||
REQUIRED_VARS
|
||||
${module_name}_${ecm_fpwc_comp}_LIBRARY
|
||||
${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
|
||||
${ecm_fpwc_dep_vars}
|
||||
VERSION_VAR
|
||||
${module_name}_${ecm_fpwc_comp}_VERSION
|
||||
${_name_mismatched_arg}
|
||||
)
|
||||
|
||||
mark_as_advanced(
|
||||
${module_name}_${ecm_fpwc_comp}_LIBRARY
|
||||
${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
|
||||
)
|
||||
|
||||
if(${module_name}_${ecm_fpwc_comp}_FOUND)
|
||||
list(APPEND ${module_name}_LIBRARIES
|
||||
"${${module_name}_${ecm_fpwc_comp}_LIBRARY}")
|
||||
list(APPEND ${module_name}_INCLUDE_DIRS
|
||||
"${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}")
|
||||
set(${module_name}_DEFINITIONS
|
||||
${${module_name}_DEFINITIONS}
|
||||
${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS})
|
||||
if(NOT TARGET ${module_name}::${ecm_fpwc_comp})
|
||||
add_library(${module_name}::${ecm_fpwc_comp} UNKNOWN IMPORTED)
|
||||
set_target_properties(${module_name}::${ecm_fpwc_comp} PROPERTIES
|
||||
IMPORTED_LOCATION "${${module_name}_${ecm_fpwc_comp}_LIBRARY}"
|
||||
INTERFACE_COMPILE_OPTIONS "${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}"
|
||||
INTERFACE_LINK_LIBRARIES "${ecm_fpwc_dep_targets}"
|
||||
)
|
||||
endif()
|
||||
list(APPEND ${module_name}_TARGETS
|
||||
"${module_name}::${ecm_fpwc_comp}")
|
||||
endif()
|
||||
endforeach()
|
||||
if(${module_name}_LIBRARIES)
|
||||
list(REMOVE_DUPLICATES ${module_name}_LIBRARIES)
|
||||
endif()
|
||||
if(${module_name}_INCLUDE_DIRS)
|
||||
list(REMOVE_DUPLICATES ${module_name}_INCLUDE_DIRS)
|
||||
endif()
|
||||
if(${module_name}_DEFINITIONS)
|
||||
list(REMOVE_DUPLICATES ${module_name}_DEFINITIONS)
|
||||
endif()
|
||||
if(${module_name}_TARGETS)
|
||||
list(REMOVE_DUPLICATES ${module_name}_TARGETS)
|
||||
endif()
|
||||
endmacro()
|
||||
@@ -1,170 +0,0 @@
|
||||
#.rst:
|
||||
# FindWaylandScanner
|
||||
# ------------------
|
||||
#
|
||||
# Try to find wayland-scanner.
|
||||
#
|
||||
# If the wayland-scanner executable is not in your PATH, you can provide
|
||||
# an alternative name or full path location with the ``WaylandScanner_EXECUTABLE``
|
||||
# variable.
|
||||
#
|
||||
# This will define the following variables:
|
||||
#
|
||||
# ``WaylandScanner_FOUND``
|
||||
# True if wayland-scanner is available.
|
||||
#
|
||||
# ``WaylandScanner_EXECUTABLE``
|
||||
# The wayland-scanner executable.
|
||||
#
|
||||
# If ``WaylandScanner_FOUND`` is TRUE, it will also define the following imported
|
||||
# target:
|
||||
#
|
||||
# ``Wayland::Scanner``
|
||||
# The wayland-scanner executable.
|
||||
#
|
||||
# This module provides the following functions to generate C protocol
|
||||
# implementations:
|
||||
#
|
||||
# - ``ecm_add_wayland_client_protocol``
|
||||
# - ``ecm_add_wayland_server_protocol``
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# ecm_add_wayland_client_protocol(<source_files_var>
|
||||
# PROTOCOL <xmlfile>
|
||||
# BASENAME <basename>)
|
||||
#
|
||||
# Generate Wayland client protocol files from ``<xmlfile>`` XML
|
||||
# definition for the ``<basename>`` interface and append those files
|
||||
# to ``<source_files_var>``.
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# ecm_add_wayland_server_protocol(<source_files_var>
|
||||
# PROTOCOL <xmlfile>
|
||||
# BASENAME <basename>)
|
||||
#
|
||||
# Generate Wayland server protocol files from ``<xmlfile>`` XML
|
||||
# definition for the ``<basename>`` interface and append those files
|
||||
# to ``<source_files_var>``.
|
||||
#
|
||||
# Since 1.4.0.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2012-2014 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. The name of the author may not be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#=============================================================================
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpers.cmake)
|
||||
|
||||
ecm_find_package_version_check(WaylandScanner)
|
||||
|
||||
# Find wayland-scanner
|
||||
find_program(WaylandScanner_EXECUTABLE NAMES wayland-scanner)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(WaylandScanner
|
||||
FOUND_VAR
|
||||
WaylandScanner_FOUND
|
||||
REQUIRED_VARS
|
||||
WaylandScanner_EXECUTABLE
|
||||
)
|
||||
|
||||
mark_as_advanced(WaylandScanner_EXECUTABLE)
|
||||
|
||||
if(NOT TARGET Wayland::Scanner AND WaylandScanner_FOUND)
|
||||
add_executable(Wayland::Scanner IMPORTED)
|
||||
set_target_properties(Wayland::Scanner PROPERTIES
|
||||
IMPORTED_LOCATION "${WaylandScanner_EXECUTABLE}"
|
||||
)
|
||||
endif()
|
||||
|
||||
include(FeatureSummary)
|
||||
set_package_properties(WaylandScanner PROPERTIES
|
||||
URL "https://wayland.freedesktop.org/"
|
||||
DESCRIPTION "Executable that converts XML protocol files to C code"
|
||||
)
|
||||
|
||||
function(ecm_add_wayland_client_protocol out_var)
|
||||
# Parse arguments
|
||||
set(oneValueArgs PROTOCOL BASENAME)
|
||||
cmake_parse_arguments(ARGS "" "${oneValueArgs}" "" ${ARGN})
|
||||
|
||||
if(ARGS_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "Unknown keywords given to ecm_add_wayland_client_protocol(): \"${ARGS_UNPARSED_ARGUMENTS}\"")
|
||||
endif()
|
||||
|
||||
get_filename_component(_infile ${ARGS_PROTOCOL} ABSOLUTE)
|
||||
set(_client_header "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-client-protocol.h")
|
||||
set(_code "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-protocol.c")
|
||||
|
||||
set_source_files_properties(${_client_header} GENERATED)
|
||||
set_source_files_properties(${_code} GENERATED)
|
||||
set_property(SOURCE ${_client_header} PROPERTY SKIP_AUTOMOC ON)
|
||||
|
||||
add_custom_command(OUTPUT "${_client_header}"
|
||||
COMMAND ${WaylandScanner_EXECUTABLE} client-header ${_infile} ${_client_header}
|
||||
DEPENDS ${WaylandScanner_EXECUTABLE} ${_infile}
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
add_custom_command(OUTPUT "${_code}"
|
||||
COMMAND ${WaylandScanner_EXECUTABLE} private-code ${_infile} ${_code}
|
||||
DEPENDS ${WaylandScanner_EXECUTABLE} ${_infile} ${_client_header}
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
list(APPEND ${out_var} "${_client_header}" "${_code}")
|
||||
set(${out_var} ${${out_var}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
|
||||
function(ecm_add_wayland_server_protocol out_var)
|
||||
# Parse arguments
|
||||
set(oneValueArgs PROTOCOL BASENAME)
|
||||
cmake_parse_arguments(ARGS "" "${oneValueArgs}" "" ${ARGN})
|
||||
|
||||
if(ARGS_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "Unknown keywords given to ecm_add_wayland_server_protocol(): \"${ARGS_UNPARSED_ARGUMENTS}\"")
|
||||
endif()
|
||||
|
||||
ecm_add_wayland_client_protocol(${out_var}
|
||||
PROTOCOL ${ARGS_PROTOCOL}
|
||||
BASENAME ${ARGS_BASENAME})
|
||||
|
||||
get_filename_component(_infile ${ARGS_PROTOCOL} ABSOLUTE)
|
||||
set(_server_header "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-server-protocol.h")
|
||||
set_property(SOURCE ${_server_header} PROPERTY SKIP_AUTOMOC ON)
|
||||
set_source_files_properties(${_server_header} GENERATED)
|
||||
|
||||
add_custom_command(OUTPUT "${_server_header}"
|
||||
COMMAND ${WaylandScanner_EXECUTABLE} server-header ${_infile} ${_server_header}
|
||||
DEPENDS ${WaylandScanner_EXECUTABLE} ${_infile}
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
list(APPEND ${out_var} "${_server_header}")
|
||||
set(${out_var} ${${out_var}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
@@ -1,37 +0,0 @@
|
||||
function(add_git_ref target)
|
||||
if(NOT DEFINED GIT_REV)
|
||||
set(GIT_REV "HEAD")
|
||||
endif()
|
||||
|
||||
get_property(_git_ref_created GLOBAL PROPERTY _GIT_REF_CREATED)
|
||||
if(NOT _git_ref_created)
|
||||
set_property(GLOBAL PROPERTY _GIT_REF_CREATED TRUE)
|
||||
find_package(Git)
|
||||
set_property(GLOBAL PROPERTY _GIT_FOUND "${Git_FOUND}")
|
||||
if(Git_FOUND)
|
||||
add_custom_target(git-ref
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "#pragma once" > GitRef.hpp.tmp
|
||||
COMMAND ${GIT_EXECUTABLE} -C ${CMAKE_CURRENT_SOURCE_DIR} log -1 "--format=namespace tracy { static inline const char* GitRef = %x22%h%x22; }" ${GIT_REV} >> GitRef.hpp.tmp || ${CMAKE_COMMAND} -E echo "namespace tracy { static inline const char* GitRef = \"unknown\"; }" >> GitRef.hpp.tmp
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different GitRef.hpp.tmp GitRef.hpp
|
||||
BYPRODUCTS GitRef.hpp GitRef.hpp.tmp
|
||||
VERBATIM
|
||||
)
|
||||
else()
|
||||
message(WARNING "git not found, using 'unknown' as git ref.")
|
||||
add_custom_command(
|
||||
OUTPUT GitRef.hpp
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "#pragma once" > GitRef.hpp
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "namespace tracy { static inline const char* GitRef = \"unknown\"; }" >> GitRef.hpp
|
||||
VERBATIM
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_include_directories(${target} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
get_property(_git_found GLOBAL PROPERTY _GIT_FOUND)
|
||||
if(_git_found)
|
||||
add_dependencies(${target} git-ref)
|
||||
else()
|
||||
target_sources(${target} PUBLIC GitRef.hpp)
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -1,84 +0,0 @@
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/options.cmake)
|
||||
|
||||
set_option(NO_ISA_EXTENSIONS "Disable ISA extensions (don't pass -march=native or -mcpu=native to the compiler)" OFF)
|
||||
set_option(NO_LTO "Disable interprocedural optimization (LTO)" OFF)
|
||||
set_option(NO_MOLD_LINKER "Disable mold linker (use default linker)" OFF)
|
||||
set_option(NO_CCACHE "Disable ccache acceleration" OFF)
|
||||
|
||||
if (NOT NO_ISA_EXTENSIONS)
|
||||
include(CheckCXXCompilerFlag)
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
|
||||
CHECK_CXX_COMPILER_FLAG("-mcpu=native" COMPILER_SUPPORTS_MCPU_NATIVE)
|
||||
if(COMPILER_SUPPORTS_MCPU_NATIVE)
|
||||
add_compile_options(-mcpu=native)
|
||||
endif()
|
||||
else()
|
||||
CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
|
||||
if(COMPILER_SUPPORTS_MARCH_NATIVE)
|
||||
add_compile_options(-march=native)
|
||||
endif()
|
||||
endif()
|
||||
if(WIN32)
|
||||
add_compile_options(/arch:AVX2)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT LEGACY)
|
||||
set(USE_WAYLAND ON)
|
||||
else()
|
||||
set(USE_WAYLAND OFF)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "15.0")
|
||||
endif()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "15")
|
||||
message(FATAL_ERROR "Apple Clang 15 or newer is required.")
|
||||
elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "16" AND CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS "13.3")
|
||||
# AppleClang 15 has issues with to_chars in <chrono> if target is too old
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "13.3")
|
||||
endif()
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fexperimental-library>)
|
||||
endif()
|
||||
message(STATUS "macOS deployment target: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(-DNOMINMAX -DWIN32_LEAN_AND_MEAN -D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
|
||||
# /MP is MSVC-specific for multi-processor compilation
|
||||
if(MSVC)
|
||||
add_compile_options(/MP)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(EMSCRIPTEN)
|
||||
add_compile_options(-pthread -DIMGUI_IMPL_OPENGL_ES2)
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT EMSCRIPTEN AND NOT NO_LTO)
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT NO_MOLD_LINKER)
|
||||
find_program(MOLD_LINKER mold)
|
||||
if(MOLD_LINKER)
|
||||
set(CMAKE_LINKER_TYPE "MOLD")
|
||||
endif()
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
add_compile_options(-fno-eliminate-unused-debug-types)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT NO_CCACHE)
|
||||
find_program(CCACHE ccache)
|
||||
if(CCACHE)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
file(GENERATE OUTPUT .gitignore CONTENT "*")
|
||||
|
||||
set(CMAKE_COLOR_DIAGNOSTICS ON)
|
||||
@@ -1,14 +0,0 @@
|
||||
diff '--color=auto' -ruN 72d8f61727dc878102157113d1998f86b852d20e/imconfig.h new/imconfig.h
|
||||
--- 72d8f61727dc878102157113d1998f86b852d20e/imconfig.h 2024-09-27 14:28:05.568760349 +0200
|
||||
+++ new/imconfig.h 2024-09-27 14:29:47.310243707 +0200
|
||||
@@ -113,6 +113,10 @@
|
||||
// Read about ImGuiBackendFlags_RendererHasVtxOffset for details.
|
||||
//#define ImDrawIdx unsigned int
|
||||
|
||||
+#ifdef __EMSCRIPTEN__
|
||||
+#define ImDrawIdx unsigned int
|
||||
+#endif
|
||||
+
|
||||
//---- Override ImDrawCallback signature (will need to modify renderer backends accordingly)
|
||||
//struct ImDrawList;
|
||||
//struct ImDrawCmd;
|
||||
@@ -1,56 +0,0 @@
|
||||
diff --git i/backends/imgui_impl_opengl3_loader.h w/backends/imgui_impl_opengl3_loader.h
|
||||
index 4ca0536..a1ff572 100644
|
||||
--- i/backends/imgui_impl_opengl3_loader.h
|
||||
+++ w/backends/imgui_impl_opengl3_loader.h
|
||||
@@ -180,6 +180,7 @@ typedef khronos_uint8_t GLubyte;
|
||||
#define GL_VERSION 0x1F02
|
||||
#define GL_EXTENSIONS 0x1F03
|
||||
#define GL_LINEAR 0x2601
|
||||
+#define GL_LINEAR_MIPMAP_LINEAR 0x2703
|
||||
#define GL_TEXTURE_MAG_FILTER 0x2800
|
||||
#define GL_TEXTURE_MIN_FILTER 0x2801
|
||||
#define GL_TEXTURE_WRAP_S 0x2802
|
||||
@@ -244,8 +245,10 @@ GLAPI void APIENTRY glGenTextures (GLsizei n, GLuint *textures);
|
||||
#define GL_TEXTURE0 0x84C0
|
||||
#define GL_ACTIVE_TEXTURE 0x84E0
|
||||
typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
|
||||
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glActiveTexture (GLenum texture);
|
||||
+GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
|
||||
#endif
|
||||
#endif /* GL_VERSION_1_3 */
|
||||
#ifndef GL_VERSION_1_4
|
||||
@@ -481,7 +484,7 @@ GL3W_API GL3WglProc imgl3wGetProcAddress(const char *proc);
|
||||
|
||||
/* gl3w internal state */
|
||||
union ImGL3WProcs {
|
||||
- GL3WglProc ptr[63];
|
||||
+ GL3WglProc ptr[64];
|
||||
struct {
|
||||
PFNGLACTIVETEXTUREPROC ActiveTexture;
|
||||
PFNGLATTACHSHADERPROC AttachShader;
|
||||
@@ -497,6 +500,7 @@ union ImGL3WProcs {
|
||||
PFNGLCLEARPROC Clear;
|
||||
PFNGLCLEARCOLORPROC ClearColor;
|
||||
PFNGLCOMPILESHADERPROC CompileShader;
|
||||
+ PFNGLCOMPRESSEDTEXIMAGE2DPROC CompressedTexImage2D;
|
||||
PFNGLCREATEPROGRAMPROC CreateProgram;
|
||||
PFNGLCREATESHADERPROC CreateShader;
|
||||
PFNGLDELETEBUFFERSPROC DeleteBuffers;
|
||||
@@ -563,6 +567,7 @@ GL3W_API extern union ImGL3WProcs imgl3wProcs;
|
||||
#define glClear imgl3wProcs.gl.Clear
|
||||
#define glClearColor imgl3wProcs.gl.ClearColor
|
||||
#define glCompileShader imgl3wProcs.gl.CompileShader
|
||||
+#define glCompressedTexImage2D imgl3wProcs.gl.CompressedTexImage2D
|
||||
#define glCreateProgram imgl3wProcs.gl.CreateProgram
|
||||
#define glCreateShader imgl3wProcs.gl.CreateShader
|
||||
#define glDeleteBuffers imgl3wProcs.gl.DeleteBuffers
|
||||
@@ -859,6 +864,7 @@ static const char *proc_names[] = {
|
||||
"glClear",
|
||||
"glClearColor",
|
||||
"glCompileShader",
|
||||
+ "glCompressedTexImage2D",
|
||||
"glCreateProgram",
|
||||
"glCreateShader",
|
||||
"glDeleteBuffers",
|
||||
@@ -1,13 +0,0 @@
|
||||
diff --git i/imconfig.h w/imconfig.h
|
||||
index b40db3898..561ab7782 100644
|
||||
--- i/imconfig.h
|
||||
+++ w/imconfig.h
|
||||
@@ -42,7 +42,7 @@
|
||||
//#define IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with Visual Studio] Implement default IME handler (require imm32.lib/.a, auto-link for Visual Studio, -limm32 on command-line for MinGW)
|
||||
//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with non-Visual Studio compilers] Don't implement default IME handler (won't require imm32.lib/.a)
|
||||
//#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, IME).
|
||||
-//#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default).
|
||||
+#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default).
|
||||
//#define IMGUI_DISABLE_TIME_FUNCTIONS // Don't setup default platform_io.Platform_SessionDate value using time(), localtime_r().
|
||||
//#define IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS // Don't implement default platform_io.Platform_OpenInShellFn() handler (Win32: ShellExecute(), require shell32.lib/.a, Mac/Linux: use system("")).
|
||||
//#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf)
|
||||
@@ -1,13 +0,0 @@
|
||||
diff --git i/imconfig.h w/imconfig.h
|
||||
index b40db3898..f7f864394 100644
|
||||
--- i/imconfig.h
|
||||
+++ w/imconfig.h
|
||||
@@ -50,7 +50,7 @@
|
||||
//#define IMGUI_DISABLE_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle at all (replace them with dummies)
|
||||
//#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle so you can implement them yourself if you don't want to link with fopen/fclose/fread/fwrite. This will also disable the LogToTTY() function.
|
||||
//#define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement default allocators calling malloc()/free() to avoid linking with them. You will need to call ImGui::SetAllocatorFunctions().
|
||||
-//#define IMGUI_DISABLE_DEFAULT_FONT // Disable default embedded fonts (ProggyClean + ProggyForever). Remove ~9 KB + ~14 KB from output binary. AddFontDefaultXXX() functions will assert.
|
||||
+#define IMGUI_DISABLE_DEFAULT_FONT // Disable default embedded fonts (ProggyClean + ProggyForever). Remove ~9 KB + ~14 KB from output binary. AddFontDefaultXXX() functions will assert.
|
||||
//#define IMGUI_DISABLE_DEFAULT_FONT_BITMAP // Disable default embedded bitmap font (ProggyClean). Remove ~9 KB from output binary. AddFontDefaultBitmap() will assert.
|
||||
//#define IMGUI_DISABLE_DEFAULT_FONT_VECTOR // Disable default embedded vector font (ProggyForever), Remove ~14 KB from output binary. AddFontDefaultVector() will assert.
|
||||
//#define IMGUI_DISABLE_SSE // Disable use of SSE intrinsics even if available
|
||||
@@ -1,13 +0,0 @@
|
||||
diff --git a/backends/imgui_impl_opengl3.cpp b/backends/imgui_impl_opengl3.cpp
|
||||
index a9e32b7ac..2cdbc4812 100644
|
||||
--- a/backends/imgui_impl_opengl3.cpp
|
||||
+++ b/backends/imgui_impl_opengl3.cpp
|
||||
@@ -1069,7 +1069,7 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
|
||||
bd->HasPolygonMode = (!bd->GlProfileIsES2 && !bd->GlProfileIsES3);
|
||||
#endif
|
||||
#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_BIND_SAMPLER
|
||||
- bd->HasBindSampler = (bd->GlVersion >= 330 || bd->GlProfileIsES3);
|
||||
+ //bd->HasBindSampler = (bd->GlVersion >= 330 || bd->GlProfileIsES3);
|
||||
#endif
|
||||
bd->HasClipOrigin = (bd->GlVersion >= 450);
|
||||
#ifdef IMGUI_IMPL_OPENGL_HAS_EXTENSIONS
|
||||
@@ -1,14 +0,0 @@
|
||||
diff --git a/imgui_tables.cpp b/imgui_tables.cpp
|
||||
--- a/imgui_tables.cpp
|
||||
+++ b/imgui_tables.cpp
|
||||
@@ -4082,7 +4082,9 @@
|
||||
}
|
||||
if (load_flags & ImGuiTableFlags_Reorderable)
|
||||
column->DisplayOrder = column_settings->DisplayOrder;
|
||||
- else
|
||||
+ else if (column_settings->Index != -1)
|
||||
+ // An Index of -1 means this column had no "Column N" line in the .ini file (columns without saved
|
||||
+ // data are not written). Keep the display order as initialized (identity for non-reorderable tables). (#9519)
|
||||
column->DisplayOrder = column_settings->Index; // Because default depends on previous Index, we need to set that up and cannot rely on TableInitColumnDefaults()
|
||||
if ((load_flags & ImGuiTableFlags_Hideable) && column_settings->IsEnabled != -1)
|
||||
column->IsUserEnabled = column->IsUserEnabledNextFrame = (column_settings->IsEnabled == 1);
|
||||
@@ -1,88 +0,0 @@
|
||||
set(PANDOC_VERSION 3.11)
|
||||
|
||||
find_package(Python3 COMPONENTS Interpreter REQUIRED)
|
||||
|
||||
find_program(TRACY_PANDOC pandoc)
|
||||
if(TRACY_PANDOC)
|
||||
execute_process(
|
||||
COMMAND ${TRACY_PANDOC} --version
|
||||
OUTPUT_VARIABLE _pandoc_version
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE _pandoc_rc
|
||||
ERROR_QUIET)
|
||||
string(REGEX MATCH "pandoc [0-9.]+" _pandoc_version "${_pandoc_version}")
|
||||
if(NOT _pandoc_rc EQUAL 0 OR NOT _pandoc_version STREQUAL "pandoc ${PANDOC_VERSION}")
|
||||
set(TRACY_PANDOC "")
|
||||
endif()
|
||||
endif()
|
||||
if(TRACY_PANDOC)
|
||||
message(STATUS "Using system pandoc ${PANDOC_VERSION}: ${TRACY_PANDOC}")
|
||||
else()
|
||||
if(WIN32)
|
||||
if(NOT CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64|amd64)$")
|
||||
message(FATAL_ERROR "No pinned pandoc ${PANDOC_VERSION} binary for ${CMAKE_HOST_SYSTEM_PROCESSOR}; install pandoc ${PANDOC_VERSION}")
|
||||
endif()
|
||||
set(_pandoc_asset pandoc-${PANDOC_VERSION}-windows-x86_64.zip)
|
||||
set(_pandoc_hash 2ab72baf2399450e148ddf7a2a8689806c42e1bba71862b57e220fd9b8456d3d)
|
||||
set(_pandoc_exe pandoc-${PANDOC_VERSION}/pandoc.exe)
|
||||
elseif(APPLE)
|
||||
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^(arm64|aarch64)$")
|
||||
set(_pandoc_asset pandoc-${PANDOC_VERSION}-arm64-macOS.zip)
|
||||
set(_pandoc_hash 15806bedf9517bfead72e88fe6a6696635c3691efbb6e152173440e9c5bb50b4)
|
||||
set(_pandoc_exe pandoc-${PANDOC_VERSION}-arm64/bin/pandoc)
|
||||
elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64|amd64)$")
|
||||
set(_pandoc_asset pandoc-${PANDOC_VERSION}-x86_64-macOS.zip)
|
||||
set(_pandoc_hash 3b1c1b57f160112c821d02f23d946ede8b7f57a6ccf4632a25a512d334a9291f)
|
||||
set(_pandoc_exe pandoc-${PANDOC_VERSION}-x86_64/bin/pandoc)
|
||||
else()
|
||||
message(FATAL_ERROR "No pinned pandoc ${PANDOC_VERSION} binary for ${CMAKE_HOST_SYSTEM_PROCESSOR}; install pandoc ${PANDOC_VERSION}")
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)$")
|
||||
set(_pandoc_asset pandoc-${PANDOC_VERSION}-linux-arm64.tar.gz)
|
||||
set(_pandoc_hash 56ed5566ec41d22ec9ee0704e6ac0b98ba102e92384efd5306173a22d314c79a)
|
||||
set(_pandoc_exe pandoc-${PANDOC_VERSION}/bin/pandoc)
|
||||
elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64|amd64)$")
|
||||
set(_pandoc_asset pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz)
|
||||
set(_pandoc_hash 37edb3bbcf722f921a009941bf5874e2e0c09263226c9b4a2d980788cb062ab6)
|
||||
set(_pandoc_exe pandoc-${PANDOC_VERSION}/bin/pandoc)
|
||||
else()
|
||||
message(FATAL_ERROR "No pinned pandoc ${PANDOC_VERSION} binary for ${CMAKE_HOST_SYSTEM_PROCESSOR}; install pandoc ${PANDOC_VERSION}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Shared cache: $PANDOC_CACHE_DIR, else the platform user cache directory.
|
||||
if(DEFINED ENV{PANDOC_CACHE_DIR})
|
||||
set(_pandoc_cache $ENV{PANDOC_CACHE_DIR})
|
||||
elseif(WIN32)
|
||||
set(_pandoc_cache $ENV{LOCALAPPDATA}/tracy/pandoc)
|
||||
elseif(APPLE)
|
||||
set(_pandoc_cache $ENV{HOME}/Library/Caches/tracy/pandoc)
|
||||
elseif(DEFINED ENV{XDG_CACHE_HOME})
|
||||
set(_pandoc_cache $ENV{XDG_CACHE_HOME}/tracy/pandoc)
|
||||
else()
|
||||
set(_pandoc_cache $ENV{HOME}/.cache/tracy/pandoc)
|
||||
endif()
|
||||
|
||||
set(TRACY_PANDOC ${_pandoc_cache}/${_pandoc_exe})
|
||||
if(NOT EXISTS ${TRACY_PANDOC})
|
||||
# Concurrent configures on a cold cache can collide; worst case the
|
||||
# hash check fails and a rerun succeeds.
|
||||
message(STATUS "Downloading pandoc ${PANDOC_VERSION} (${_pandoc_asset})")
|
||||
file(MAKE_DIRECTORY ${_pandoc_cache})
|
||||
file(DOWNLOAD
|
||||
https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/${_pandoc_asset}
|
||||
${_pandoc_cache}/pandoc.archive
|
||||
EXPECTED_HASH SHA256=${_pandoc_hash}
|
||||
STATUS _pandoc_download)
|
||||
list(GET _pandoc_download 0 _pandoc_download_rc)
|
||||
if(NOT _pandoc_download_rc STREQUAL "0")
|
||||
file(REMOVE ${_pandoc_cache}/pandoc.archive)
|
||||
message(FATAL_ERROR "Failed to download pandoc ${PANDOC_VERSION}: ${_pandoc_download}")
|
||||
endif()
|
||||
file(ARCHIVE_EXTRACT
|
||||
INPUT ${_pandoc_cache}/pandoc.archive
|
||||
DESTINATION ${_pandoc_cache})
|
||||
file(REMOVE ${_pandoc_cache}/pandoc.archive)
|
||||
endif()
|
||||
endif()
|
||||
@@ -1,203 +0,0 @@
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index d6a9edc..abef8d7 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -32,18 +32,18 @@ if(nfd_PLATFORM STREQUAL PLATFORM_LINUX)
|
||||
if(NFD_WAYLAND)
|
||||
pkg_check_modules(WAYLAND REQUIRED wayland-client)
|
||||
message(STATUS "Using Wayland version: ${WAYLAND_VERSION}")
|
||||
- set(NFD_WAYLAND_PROTOCOL_XDG_FOREIGN ${CMAKE_CURRENT_SOURCE_DIR}/../3ps/wayland-protocols/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml)
|
||||
+ set(NFD_WAYLAND_PROTOCOL_XDG_FOREIGN ${CMAKE_CURRENT_SOURCE_DIR}/../3ps/wayland-protocols/unstable/xdg-foreign/xdg-foreign-unstable-v2.xml)
|
||||
add_custom_command(
|
||||
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xdg-foreign-unstable-v1.h
|
||||
- COMMAND wayland-scanner client-header < ${NFD_WAYLAND_PROTOCOL_XDG_FOREIGN} > ${CMAKE_CURRENT_BINARY_DIR}/xdg-foreign-unstable-v1.h
|
||||
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xdg-foreign-unstable-v2.h
|
||||
+ COMMAND wayland-scanner client-header < ${NFD_WAYLAND_PROTOCOL_XDG_FOREIGN} > ${CMAKE_CURRENT_BINARY_DIR}/xdg-foreign-unstable-v2.h
|
||||
MAIN_DEPENDENCY ${NFD_WAYLAND_PROTOCOL_XDG_FOREIGN}
|
||||
)
|
||||
add_custom_command(
|
||||
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xdg-foreign-unstable-v1.c
|
||||
- COMMAND wayland-scanner private-code < ${NFD_WAYLAND_PROTOCOL_XDG_FOREIGN} > ${CMAKE_CURRENT_BINARY_DIR}/xdg-foreign-unstable-v1.c
|
||||
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xdg-foreign-unstable-v2.c
|
||||
+ COMMAND wayland-scanner private-code < ${NFD_WAYLAND_PROTOCOL_XDG_FOREIGN} > ${CMAKE_CURRENT_BINARY_DIR}/xdg-foreign-unstable-v2.c
|
||||
MAIN_DEPENDENCY ${NFD_WAYLAND_PROTOCOL_XDG_FOREIGN}
|
||||
)
|
||||
- list(APPEND SOURCE_FILES ${CMAKE_CURRENT_BINARY_DIR}/xdg-foreign-unstable-v1.h ${CMAKE_CURRENT_BINARY_DIR}/xdg-foreign-unstable-v1.c)
|
||||
+ list(APPEND SOURCE_FILES ${CMAKE_CURRENT_BINARY_DIR}/xdg-foreign-unstable-v2.h ${CMAKE_CURRENT_BINARY_DIR}/xdg-foreign-unstable-v2.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
diff --git a/src/nfd_gtk.cpp b/src/nfd_gtk.cpp
|
||||
index 76fdcd7..cec691d 100644
|
||||
--- a/src/nfd_gtk.cpp
|
||||
+++ b/src/nfd_gtk.cpp
|
||||
@@ -433,17 +433,17 @@ gint RunDialogWithFocus(GtkDialog* dialog) {
|
||||
|
||||
#if defined(NFD_WAYLAND)
|
||||
void DestroyXdgExported(void* context) {
|
||||
- zxdg_exported_v1_destroy(static_cast<struct zxdg_exported_v1*>(context));
|
||||
+ zxdg_exported_v2_destroy(static_cast<struct zxdg_exported_v2*>(context));
|
||||
}
|
||||
|
||||
-void zxdg_exported_v1_handle(void* context, struct zxdg_exported_v1*, const char* handle) {
|
||||
+void zxdg_exported_v2_handle(void* context, struct zxdg_exported_v2*, const char* handle) {
|
||||
GdkWindow* childWindow = static_cast<GdkWindow*>(context);
|
||||
// GDK doesn't modify the string, even though it takes char*, so we can cast away the constness
|
||||
gdk_wayland_window_set_transient_for_exported(childWindow, const_cast<char*>(handle));
|
||||
}
|
||||
|
||||
-constexpr struct zxdg_exported_v1_listener wayland_xdg_exported_v1_listener{
|
||||
- &zxdg_exported_v1_handle};
|
||||
+constexpr struct zxdg_exported_v2_listener wayland_xdg_exported_v2_listener{
|
||||
+ &zxdg_exported_v2_handle};
|
||||
#endif
|
||||
|
||||
// This is an RAII class that wraps the parenting of a GtkWidget (the file dialog).
|
||||
@@ -645,17 +645,17 @@ struct NativeWindowParenter {
|
||||
|
||||
#if defined(NFD_WAYLAND)
|
||||
void SetParentWayland(GdkWindow* childWindow) {
|
||||
- if (wayland_display && wayland_xdg_exporter_v1) {
|
||||
- struct zxdg_exported_v1* exported = zxdg_exporter_v1_export(
|
||||
- wayland_xdg_exporter_v1, static_cast<struct wl_surface*>(parentWindowHandle));
|
||||
+ if (wayland_display && wayland_xdg_exporter_v2) {
|
||||
+ struct zxdg_exported_v2* exported = zxdg_exporter_v2_export_toplevel(
|
||||
+ wayland_xdg_exporter_v2, static_cast<struct wl_surface*>(parentWindowHandle));
|
||||
if (!exported) {
|
||||
// if we fail to export the wl_surface, act as if the window has no parent
|
||||
return;
|
||||
}
|
||||
- zxdg_exported_v1_add_listener(
|
||||
- exported, &wayland_xdg_exported_v1_listener, static_cast<void*>(childWindow));
|
||||
+ zxdg_exported_v2_add_listener(
|
||||
+ exported, &wayland_xdg_exported_v2_listener, static_cast<void*>(childWindow));
|
||||
wl_display_roundtrip(wayland_display);
|
||||
- zxdg_exported_v1_set_user_data(exported, nullptr);
|
||||
+ zxdg_exported_v2_set_user_data(exported, nullptr);
|
||||
destroy.fn = &DestroyXdgExported;
|
||||
destroy.context = static_cast<void*>(exported);
|
||||
}
|
||||
diff --git a/src/nfd_linux_shared.hpp b/src/nfd_linux_shared.hpp
|
||||
index 1413bac..e826f1e 100644
|
||||
--- a/src/nfd_linux_shared.hpp
|
||||
+++ b/src/nfd_linux_shared.hpp
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#ifdef NFD_WAYLAND
|
||||
#include <wayland-client.h>
|
||||
-#include "xdg-foreign-unstable-v1.h"
|
||||
+#include "xdg-foreign-unstable-v2.h"
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
@@ -81,9 +81,9 @@ nfdnchar_t* emit_case_insensitive_glob(const nfdnchar_t* begin,
|
||||
#ifdef NFD_WAYLAND
|
||||
struct wl_display* wayland_display;
|
||||
struct wl_registry* wayland_registry;
|
||||
-uint32_t wayland_xdg_exporter_v1_name;
|
||||
-struct zxdg_exporter_v1* wayland_xdg_exporter_v1;
|
||||
-constexpr const char* XDG_EXPORTER_V1 = "zxdg_exporter_v1";
|
||||
+uint32_t wayland_xdg_exporter_v2_name;
|
||||
+struct zxdg_exporter_v2* wayland_xdg_exporter_v2;
|
||||
+constexpr const char* XDG_EXPORTER_V2 = "zxdg_exporter_v2";
|
||||
#endif
|
||||
|
||||
void EmptyFn(void*) {}
|
||||
@@ -103,19 +103,19 @@ void registry_handle_global(void* context,
|
||||
uint32_t version) {
|
||||
(void)context;
|
||||
(void)version;
|
||||
- if (strcmp(interface, XDG_EXPORTER_V1) == 0) {
|
||||
- wayland_xdg_exporter_v1_name = name;
|
||||
- wayland_xdg_exporter_v1 = static_cast<struct zxdg_exporter_v1*>(wl_registry_bind(
|
||||
- registry, name, &zxdg_exporter_v1_interface, zxdg_exporter_v1_interface.version));
|
||||
+ if (strcmp(interface, XDG_EXPORTER_V2) == 0) {
|
||||
+ wayland_xdg_exporter_v2_name = name;
|
||||
+ wayland_xdg_exporter_v2 = static_cast<struct zxdg_exporter_v2*>(wl_registry_bind(
|
||||
+ registry, name, &zxdg_exporter_v2_interface, zxdg_exporter_v2_interface.version));
|
||||
}
|
||||
}
|
||||
|
||||
void registry_handle_global_remove(void* context, struct wl_registry* registry, uint32_t name) {
|
||||
(void)context;
|
||||
(void)registry;
|
||||
- if (wayland_xdg_exporter_v1 && name == wayland_xdg_exporter_v1_name) {
|
||||
- zxdg_exporter_v1_destroy(wayland_xdg_exporter_v1);
|
||||
- wayland_xdg_exporter_v1 = nullptr;
|
||||
+ if (wayland_xdg_exporter_v2 && name == wayland_xdg_exporter_v2_name) {
|
||||
+ zxdg_exporter_v2_destroy(wayland_xdg_exporter_v2);
|
||||
+ wayland_xdg_exporter_v2 = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ void NFD_Wayland_Init(void) {
|
||||
|
||||
void NFD_Wayland_Quit(void) {
|
||||
if (wayland_display) {
|
||||
- if (wayland_xdg_exporter_v1) zxdg_exporter_v1_destroy(wayland_xdg_exporter_v1);
|
||||
+ if (wayland_xdg_exporter_v2) zxdg_exporter_v2_destroy(wayland_xdg_exporter_v2);
|
||||
wl_registry_destroy(wayland_registry);
|
||||
}
|
||||
}
|
||||
@@ -143,7 +143,7 @@ nfdresult_t NFD_SetWaylandDisplay(wl_display* display) {
|
||||
wayland_display = display;
|
||||
if (wayland_display) {
|
||||
wayland_registry = wl_display_get_registry(wayland_display);
|
||||
- wayland_xdg_exporter_v1 = nullptr;
|
||||
+ wayland_xdg_exporter_v2 = nullptr;
|
||||
// seems like registry can't be null
|
||||
wl_registry_add_listener(wayland_registry, &wayland_registry_listener, nullptr);
|
||||
wl_display_roundtrip(wayland_display);
|
||||
diff --git a/src/nfd_portal.cpp b/src/nfd_portal.cpp
|
||||
index df840e0..e66ca7f 100644
|
||||
--- a/src/nfd_portal.cpp
|
||||
+++ b/src/nfd_portal.cpp
|
||||
@@ -148,10 +148,10 @@ constexpr const char* DBUS_REQUEST_IFACE = "org.freedesktop.portal.Request";
|
||||
constexpr const char* WAYLAND_PREFIX = "wayland:";
|
||||
|
||||
void DestroyXdgExported(void* context) {
|
||||
- zxdg_exported_v1_destroy(static_cast<struct zxdg_exported_v1*>(context));
|
||||
+ zxdg_exported_v2_destroy(static_cast<struct zxdg_exported_v2*>(context));
|
||||
}
|
||||
|
||||
-void zxdg_exported_v1_handle(void* context, struct zxdg_exported_v1*, const char* handle) {
|
||||
+void zxdg_exported_v2_handle(void* context, struct zxdg_exported_v2*, const char* handle) {
|
||||
DBusMessageIter& iter = *static_cast<DBusMessageIter*>(context);
|
||||
const size_t handle_len = strlen(handle);
|
||||
const size_t prefix_len = strlen(WAYLAND_PREFIX);
|
||||
@@ -163,8 +163,8 @@ void zxdg_exported_v1_handle(void* context, struct zxdg_exported_v1*, const char
|
||||
NFDi_Free(buf);
|
||||
}
|
||||
|
||||
-constexpr struct zxdg_exported_v1_listener wayland_xdg_exported_v1_listener{
|
||||
- &zxdg_exported_v1_handle};
|
||||
+constexpr struct zxdg_exported_v2_listener wayland_xdg_exported_v2_listener{
|
||||
+ &zxdg_exported_v2_handle};
|
||||
#endif
|
||||
|
||||
void AppendOpenFileQueryParentWindow(DBusMessageIter& iter,
|
||||
@@ -194,18 +194,18 @@ void AppendOpenFileQueryParentWindow(DBusMessageIter& iter,
|
||||
#endif
|
||||
#ifdef NFD_WAYLAND
|
||||
case NFD_WINDOW_HANDLE_TYPE_WAYLAND: {
|
||||
- if (wayland_display && wayland_xdg_exporter_v1) {
|
||||
- struct zxdg_exported_v1* exported = zxdg_exporter_v1_export(
|
||||
- wayland_xdg_exporter_v1, static_cast<struct wl_surface*>(parentWindow.handle));
|
||||
+ if (wayland_display && wayland_xdg_exporter_v2) {
|
||||
+ struct zxdg_exported_v2* exported = zxdg_exporter_v2_export_toplevel(
|
||||
+ wayland_xdg_exporter_v2, static_cast<struct wl_surface*>(parentWindow.handle));
|
||||
if (!exported) {
|
||||
// if we fail to export the wl_surface, act as if the window has no parent
|
||||
dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &STR_EMPTY);
|
||||
return;
|
||||
}
|
||||
- zxdg_exported_v1_add_listener(
|
||||
- exported, &wayland_xdg_exported_v1_listener, static_cast<void*>(&iter));
|
||||
+ zxdg_exported_v2_add_listener(
|
||||
+ exported, &wayland_xdg_exported_v2_listener, static_cast<void*>(&iter));
|
||||
wl_display_roundtrip(wayland_display);
|
||||
- zxdg_exported_v1_set_user_data(exported, nullptr);
|
||||
+ zxdg_exported_v2_set_user_data(exported, nullptr);
|
||||
destroy.fn = &DestroyXdgExported;
|
||||
destroy.context = static_cast<void*>(exported);
|
||||
return;
|
||||
@@ -1,48 +0,0 @@
|
||||
# Reusable option macros for Tracy CMake projects
|
||||
#
|
||||
# Usage:
|
||||
# set_option(OPTION_NAME "Help text" ON/OFF [TARGET]) - for boolean options
|
||||
# set_option_value(VAR_NAME "Help text" "value" [TARGET]) - for value options (CACHE STRING)
|
||||
# set_option_value_as_string(VAR_NAME "Help text" "value" [TARGET]) - for value options as C string literals
|
||||
#
|
||||
# [TARGET] is optional and specifies a target to which the option will
|
||||
# be added as a compile definition (e.g., -DOPTION_NAME or -DVAR_NAME=value).
|
||||
|
||||
# Boolean option (ON/OFF).
|
||||
macro(set_option option help value)
|
||||
option(${option} ${help} ${value})
|
||||
if(${option})
|
||||
message(STATUS "${option}: ON")
|
||||
if(${ARGC} GREATER 3)
|
||||
target_compile_definitions(${ARGV3} PUBLIC ${option})
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "${option}: OFF")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Value option (string/number).
|
||||
macro(set_option_value var help default)
|
||||
set(${var} ${default} CACHE STRING "${help}")
|
||||
if(${var})
|
||||
message(STATUS "${var}: ${${var}}")
|
||||
if(${ARGC} GREATER 3)
|
||||
target_compile_definitions(${ARGV3} PUBLIC ${var}=${${var}})
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "${var}: (not set)")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Value option embedded as a C string literal (VAR="value").
|
||||
macro(set_option_value_as_string var help default)
|
||||
set(${var} ${default} CACHE STRING "${help}")
|
||||
if(${var})
|
||||
message(STATUS "${var}: ${${var}}")
|
||||
if(${ARGC} GREATER 3)
|
||||
target_compile_definitions(${ARGV3} PUBLIC "${var}=\"${${var}}\"")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "${var}: (not set)")
|
||||
endif()
|
||||
endmacro()
|
||||
@@ -1,14 +0,0 @@
|
||||
diff --git i/include/ppqsort/parameters.h w/include/ppqsort/parameters.h
|
||||
index 115c3a1..3f4b669 100644
|
||||
--- i/include/ppqsort/parameters.h
|
||||
+++ w/include/ppqsort/parameters.h
|
||||
@@ -3,7 +3,8 @@
|
||||
#include <bit>
|
||||
#include <execution>
|
||||
|
||||
-#ifndef NDEBUG
|
||||
+//#ifndef NDEBUG
|
||||
+#if 0
|
||||
#include <bitset>
|
||||
#include <iostream>
|
||||
#include <syncstream>
|
||||
@@ -1,14 +0,0 @@
|
||||
diff --git i/include/ppqsort/parallel/cpp/thread_pool.h w/include/ppqsort/parallel/cpp/thread_pool.h
|
||||
--- i/include/ppqsort/parallel/cpp/thread_pool.h
|
||||
+++ w/include/ppqsort/parallel/cpp/thread_pool.h
|
||||
@@ -134,7 +134,9 @@ namespace ppqsort::impl::cpp {
|
||||
alignas(parameters::cacheline_size) std::atomic<std::size_t> pending_tasks_{0};
|
||||
alignas(parameters::cacheline_size) std::atomic<std::size_t> total_tasks_{0};
|
||||
alignas(parameters::cacheline_size) std::atomic<bool> to_stop_{false};
|
||||
- std::binary_semaphore threads_done_semaphore_{0}; // used to wait for all tasks to finish
|
||||
+ // counting_semaphore: multiple workers may concurrently observe total_tasks_ == 0
|
||||
+ // and call release(); a binary_semaphore would assert when the count exceeds 1.
|
||||
+ std::counting_semaphore<> threads_done_semaphore_{0};
|
||||
std::mutex mtx_priority_;
|
||||
bool stopped = false;
|
||||
};
|
||||
@@ -1,36 +0,0 @@
|
||||
set(TRACY_COMMON_DIR ${CMAKE_CURRENT_LIST_DIR}/../public/common)
|
||||
|
||||
set(TRACY_COMMON_SOURCES
|
||||
tracy_lz4.cpp
|
||||
tracy_lz4hc.cpp
|
||||
TracySocket.cpp
|
||||
TracyStackFrames.cpp
|
||||
TracySystem.cpp
|
||||
)
|
||||
|
||||
list(TRANSFORM TRACY_COMMON_SOURCES PREPEND "${TRACY_COMMON_DIR}/")
|
||||
|
||||
|
||||
set(TRACY_SERVER_DIR ${CMAKE_CURRENT_LIST_DIR}/../server)
|
||||
|
||||
set(TRACY_SERVER_SOURCES
|
||||
TracyBroadcast.cpp
|
||||
TracyMemory.cpp
|
||||
TracyMmap.cpp
|
||||
TracyPrint.cpp
|
||||
TracySysUtil.cpp
|
||||
TracyTaskDispatch.cpp
|
||||
TracyTextureCompression.cpp
|
||||
TracyThreadCompress.cpp
|
||||
TracyWorker.cpp
|
||||
)
|
||||
|
||||
list(TRANSFORM TRACY_SERVER_SOURCES PREPEND "${TRACY_SERVER_DIR}/")
|
||||
|
||||
|
||||
add_library(TracyServer STATIC EXCLUDE_FROM_ALL ${TRACY_COMMON_SOURCES} ${TRACY_SERVER_SOURCES})
|
||||
target_include_directories(TracyServer PUBLIC ${TRACY_COMMON_DIR} ${TRACY_SERVER_DIR})
|
||||
target_link_libraries(TracyServer PUBLIC TracyCapstone libzstd PPQSort::PPQSort)
|
||||
if(NO_STATISTICS)
|
||||
target_compile_definitions(TracyServer PUBLIC TRACY_NO_STATISTICS)
|
||||
endif()
|
||||
@@ -1,39 +0,0 @@
|
||||
diff --git i/CMakeLists.txt w/CMakeLists.txt
|
||||
index 8efec25..c1d101e 100644
|
||||
--- i/CMakeLists.txt
|
||||
+++ w/CMakeLists.txt
|
||||
@@ -17,7 +17,7 @@
|
||||
# @date Consult git log.
|
||||
##############################################################################
|
||||
|
||||
-cmake_minimum_required (VERSION 2.8.12)
|
||||
+cmake_minimum_required (VERSION 3.10)
|
||||
|
||||
set(LIB_NAME tidy)
|
||||
set(LIBTIDY_DESCRIPTION "${LIB_NAME} - HTML syntax checker")
|
||||
@@ -528,6 +528,7 @@ if (UNIX AND SUPPORT_CONSOLE_APP)
|
||||
|
||||
# Run the built EXE to generate xml output .
|
||||
add_custom_command(
|
||||
+ POST_BUILD
|
||||
TARGET man
|
||||
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME} -xml-help > ${TIDYHELP}
|
||||
COMMENT "Generate ${TIDYHELP}"
|
||||
@@ -536,6 +537,7 @@ if (UNIX AND SUPPORT_CONSOLE_APP)
|
||||
|
||||
# Run the built EXE to generate more xml output.
|
||||
add_custom_command(
|
||||
+ POST_BUILD
|
||||
TARGET man
|
||||
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME} -xml-config > ${TIDYCONFIG}
|
||||
COMMENT "Generate ${TIDYCONFIG}"
|
||||
@@ -544,8 +546,8 @@ if (UNIX AND SUPPORT_CONSOLE_APP)
|
||||
|
||||
# Run xsltproc to generate the install files.
|
||||
add_custom_command(
|
||||
+ POST_BUILD
|
||||
TARGET man
|
||||
- DEPENDS ${TIDYHELP}
|
||||
COMMAND xsltproc ARGS ${TIDY1XSL} ${TIDYHELP} > ${CMAKE_CURRENT_BINARY_DIR}/${TIDY_MANFILE}
|
||||
COMMENT "Generate ${TIDY_MANFILE}"
|
||||
VERBATIM
|
||||
@@ -1,13 +0,0 @@
|
||||
set(TRACY_UTIL_DIR ${CMAKE_CURRENT_LIST_DIR}/../util)
|
||||
|
||||
set(TRACY_UTIL_SOURCES
|
||||
CaptureConsole.cpp
|
||||
CaptureFileBackup.cpp
|
||||
CaptureOutput.cpp
|
||||
)
|
||||
|
||||
list(TRANSFORM TRACY_UTIL_SOURCES PREPEND "${TRACY_UTIL_DIR}/")
|
||||
|
||||
add_library(TracyUtil STATIC EXCLUDE_FROM_ALL ${TRACY_UTIL_SOURCES})
|
||||
target_link_libraries(TracyUtil PUBLIC TracyServer)
|
||||
target_include_directories(TracyUtil PUBLIC ${TRACY_UTIL_DIR})
|
||||
@@ -1,341 +0,0 @@
|
||||
# Vendor Specific CMake
|
||||
# The Tracy project keeps most vendor source locally
|
||||
|
||||
set (ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../")
|
||||
|
||||
# Dependencies are taken from the system first and if not found, they are pulled with CPM and built from source
|
||||
|
||||
include(FindPkgConfig)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CPM.cmake)
|
||||
|
||||
if(APPLE AND BUNDLE)
|
||||
set(DLOPT ON)
|
||||
else()
|
||||
set(DLOPT OFF)
|
||||
endif()
|
||||
|
||||
option(DOWNLOAD_CAPSTONE "Force download capstone" ON)
|
||||
|
||||
if(VENDOR_GUI)
|
||||
option(DOWNLOAD_GLFW "Force download glfw" ${DLOPT})
|
||||
option(DOWNLOAD_FREETYPE "Force download freetype" ${DLOPT})
|
||||
option(DOWNLOAD_LIBCURL "Force download libcURL" OFF)
|
||||
option(DOWNLOAD_PUGIXML "Force download pugixml" ${DLOPT})
|
||||
endif()
|
||||
|
||||
# capstone
|
||||
|
||||
pkg_check_modules(CAPSTONE capstone)
|
||||
if(CAPSTONE_FOUND AND NOT DOWNLOAD_CAPSTONE)
|
||||
message(STATUS "Capstone found: ${CAPSTONE}")
|
||||
add_library(TracyCapstone INTERFACE)
|
||||
target_include_directories(TracyCapstone INTERFACE ${CAPSTONE_INCLUDE_DIRS})
|
||||
target_link_libraries(TracyCapstone INTERFACE ${CAPSTONE_LINK_LIBRARIES})
|
||||
else()
|
||||
CPMAddPackage(
|
||||
NAME capstone
|
||||
GITHUB_REPOSITORY capstone-engine/capstone
|
||||
GIT_TAG 6.0.0-Alpha10
|
||||
OPTIONS
|
||||
"CAPSTONE_X86_ATT_DISABLE ON"
|
||||
"CAPSTONE_ALPHA_SUPPORT OFF"
|
||||
"CAPSTONE_ARC_SUPPORT OFF"
|
||||
"CAPSTONE_HPPA_SUPPORT OFF"
|
||||
"CAPSTONE_LOONGARCH_SUPPORT OFF"
|
||||
"CAPSTONE_M680X_SUPPORT OFF"
|
||||
"CAPSTONE_M68K_SUPPORT OFF"
|
||||
"CAPSTONE_MIPS_SUPPORT OFF"
|
||||
"CAPSTONE_MOS65XX_SUPPORT OFF"
|
||||
"CAPSTONE_PPC_SUPPORT OFF"
|
||||
"CAPSTONE_SPARC_SUPPORT OFF"
|
||||
"CAPSTONE_SYSTEMZ_SUPPORT OFF"
|
||||
"CAPSTONE_XCORE_SUPPORT OFF"
|
||||
"CAPSTONE_TRICORE_SUPPORT OFF"
|
||||
"CAPSTONE_TMS320C64X_SUPPORT OFF"
|
||||
"CAPSTONE_M680X_SUPPORT OFF"
|
||||
"CAPSTONE_EVM_SUPPORT OFF"
|
||||
"CAPSTONE_WASM_SUPPORT OFF"
|
||||
"CAPSTONE_BPF_SUPPORT OFF"
|
||||
"CAPSTONE_RISCV_SUPPORT OFF"
|
||||
"CAPSTONE_SH_SUPPORT OFF"
|
||||
"CAPSTONE_XTENSA_SUPPORT OFF"
|
||||
"CAPSTONE_BUILD_MACOS_THIN ON"
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
)
|
||||
add_library(TracyCapstone INTERFACE)
|
||||
target_include_directories(TracyCapstone INTERFACE ${capstone_SOURCE_DIR}/include/capstone)
|
||||
target_link_libraries(TracyCapstone INTERFACE capstone_static)
|
||||
endif()
|
||||
|
||||
# Zstd
|
||||
|
||||
CPMAddPackage(
|
||||
NAME zstd
|
||||
GITHUB_REPOSITORY facebook/zstd
|
||||
GIT_TAG v1.5.7
|
||||
OPTIONS
|
||||
"ZSTD_BUILD_SHARED OFF"
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
SOURCE_SUBDIR build/cmake
|
||||
)
|
||||
|
||||
# Diff Template Library
|
||||
|
||||
set(DTL_DIR "${ROOT_DIR}/dtl")
|
||||
file(GLOB_RECURSE DTL_HEADERS CONFIGURE_DEPENDS RELATIVE ${DTL_DIR} "*.hpp")
|
||||
add_library(TracyDtl INTERFACE)
|
||||
target_sources(TracyDtl INTERFACE ${DTL_HEADERS})
|
||||
target_include_directories(TracyDtl INTERFACE ${DTL_DIR})
|
||||
|
||||
# Get Opt
|
||||
|
||||
set(GETOPT_DIR "${ROOT_DIR}/getopt")
|
||||
set(GETOPT_SOURCES ${GETOPT_DIR}/getopt.c)
|
||||
set(GETOPT_HEADERS ${GETOPT_DIR}/getopt.h)
|
||||
add_library(TracyGetOpt STATIC EXCLUDE_FROM_ALL ${GETOPT_SOURCES} ${GETOPT_HEADERS})
|
||||
target_include_directories(TracyGetOpt PUBLIC ${GETOPT_DIR})
|
||||
|
||||
# PPQSort
|
||||
|
||||
CPMAddPackage(
|
||||
NAME PPQSort
|
||||
GITHUB_REPOSITORY GabTux/PPQSort
|
||||
VERSION 1.0.6
|
||||
PATCHES
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ppqsort-nodebug.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ppqsort-semaphore.patch"
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
)
|
||||
|
||||
# json
|
||||
|
||||
CPMAddPackage(
|
||||
NAME json
|
||||
GITHUB_REPOSITORY nlohmann/json
|
||||
GIT_TAG v3.12.0
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
)
|
||||
|
||||
if(VENDOR_GUI)
|
||||
|
||||
# GLFW
|
||||
|
||||
if(NOT USE_WAYLAND AND NOT EMSCRIPTEN)
|
||||
pkg_check_modules(GLFW glfw3)
|
||||
if (GLFW_FOUND AND NOT DOWNLOAD_GLFW)
|
||||
add_library(TracyGlfw3 INTERFACE)
|
||||
target_include_directories(TracyGlfw3 INTERFACE ${GLFW_INCLUDE_DIRS})
|
||||
target_link_libraries(TracyGlfw3 INTERFACE ${GLFW_LINK_LIBRARIES})
|
||||
else()
|
||||
CPMAddPackage(
|
||||
NAME glfw
|
||||
GITHUB_REPOSITORY glfw/glfw
|
||||
GIT_TAG 3.5.1
|
||||
OPTIONS
|
||||
"GLFW_BUILD_EXAMPLES OFF"
|
||||
"GLFW_BUILD_TESTS OFF"
|
||||
"GLFW_BUILD_DOCS OFF"
|
||||
"GLFW_INSTALL OFF"
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
)
|
||||
add_library(TracyGlfw3 INTERFACE)
|
||||
target_link_libraries(TracyGlfw3 INTERFACE glfw)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# freetype
|
||||
|
||||
pkg_check_modules(FREETYPE freetype2)
|
||||
if (FREETYPE_FOUND AND NOT DOWNLOAD_FREETYPE)
|
||||
add_library(TracyFreetype INTERFACE)
|
||||
target_include_directories(TracyFreetype INTERFACE ${FREETYPE_INCLUDE_DIRS})
|
||||
target_link_libraries(TracyFreetype INTERFACE ${FREETYPE_LINK_LIBRARIES})
|
||||
else()
|
||||
CPMAddPackage(
|
||||
NAME freetype
|
||||
GITHUB_REPOSITORY freetype/freetype
|
||||
GIT_TAG VER-2-14-3
|
||||
OPTIONS
|
||||
"FT_DISABLE_HARFBUZZ ON"
|
||||
"FT_WITH_HARFBUZZ OFF"
|
||||
"FT_DISABLE_ZLIB ON"
|
||||
"FT_DISABLE_BZIP2 ON"
|
||||
"FT_DISABLE_PNG ON"
|
||||
"FT_DISABLE_BROTLI ON"
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
)
|
||||
add_library(TracyFreetype INTERFACE)
|
||||
target_link_libraries(TracyFreetype INTERFACE freetype)
|
||||
endif()
|
||||
|
||||
# ImGui
|
||||
|
||||
CPMAddPackage(
|
||||
NAME ImGui
|
||||
GITHUB_REPOSITORY ocornut/imgui
|
||||
GIT_TAG v1.92.9b-docking
|
||||
DOWNLOAD_ONLY TRUE
|
||||
PATCHES
|
||||
"${CMAKE_CURRENT_LIST_DIR}/imgui-emscripten.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/imgui-loader.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/imgui-no-samplers.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/imgui-no-default-font.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/imgui-macos-clipboard.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/imgui-phantom-column.patch"
|
||||
)
|
||||
|
||||
set(IMGUI_SOURCES
|
||||
imgui_widgets.cpp
|
||||
imgui_draw.cpp
|
||||
imgui_demo.cpp
|
||||
imgui.cpp
|
||||
imgui_tables.cpp
|
||||
misc/freetype/imgui_freetype.cpp
|
||||
backends/imgui_impl_opengl3.cpp
|
||||
)
|
||||
|
||||
list(TRANSFORM IMGUI_SOURCES PREPEND "${ImGui_SOURCE_DIR}/")
|
||||
|
||||
add_library(TracyImGui STATIC EXCLUDE_FROM_ALL ${IMGUI_SOURCES})
|
||||
target_include_directories(TracyImGui PUBLIC ${ImGui_SOURCE_DIR})
|
||||
target_link_libraries(TracyImGui PUBLIC
|
||||
TracyFreetype
|
||||
${CMAKE_DL_LIBS}
|
||||
)
|
||||
target_compile_definitions(TracyImGui PRIVATE "IMGUI_ENABLE_FREETYPE")
|
||||
target_compile_definitions(TracyImGui PUBLIC "IMGUI_USE_WCHAR32")
|
||||
#target_compile_definitions(TracyImGui PUBLIC "IMGUI_DISABLE_OBSOLETE_FUNCTIONS")
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND LEGACY)
|
||||
find_package(X11 REQUIRED)
|
||||
target_link_libraries(TracyImGui PUBLIC ${X11_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
target_compile_definitions(TracyImGui PRIVATE "IMGUI_DISABLE_DEBUG_TOOLS" "IMGUI_DISABLE_DEMO_WINDOWS")
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
target_link_libraries(TracyImGui PUBLIC "-framework ApplicationServices")
|
||||
endif()
|
||||
|
||||
# NFD
|
||||
|
||||
if(NOT NO_FILESELECTOR AND NOT EMSCRIPTEN)
|
||||
if(GTK_FILESELECTOR)
|
||||
set(NFD_PORTAL OFF)
|
||||
else()
|
||||
set(NFD_PORTAL ON)
|
||||
endif()
|
||||
|
||||
CPMAddPackage(
|
||||
NAME nfd
|
||||
GITHUB_REPOSITORY btzy/nativefiledialog-extended
|
||||
GIT_TAG 7bbbd9fe6b1d1549b41df138f614d1a44df9ba08
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
PATCHES
|
||||
"${CMAKE_CURRENT_LIST_DIR}/nfd-xdg-foreign-v2.patch"
|
||||
OPTIONS
|
||||
"BUILD_SHARED_LIBS OFF"
|
||||
"NFD_PORTAL ${NFD_PORTAL}"
|
||||
)
|
||||
endif()
|
||||
|
||||
# md4c
|
||||
|
||||
CPMAddPackage(
|
||||
NAME md4c
|
||||
GITHUB_REPOSITORY mity/md4c
|
||||
GIT_TAG 00788b157b2b6ef3efd8659b66f6521229f382d7
|
||||
OPTIONS
|
||||
"BUILD_SHARED_LIBS OFF"
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
)
|
||||
|
||||
if(NOT EMSCRIPTEN)
|
||||
|
||||
# base64
|
||||
|
||||
set(BUILD_SHARED_LIBS_SAVE ${BUILD_SHARED_LIBS})
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
CPMAddPackage(
|
||||
NAME base64
|
||||
GITHUB_REPOSITORY aklomp/base64
|
||||
GIT_TAG v0.5.2
|
||||
OPTIONS
|
||||
"BASE64_BUILD_CLI OFF"
|
||||
"BASE64_WITH_OpenMP OFF"
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
)
|
||||
set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_SAVE})
|
||||
|
||||
# tidy
|
||||
|
||||
CPMAddPackage(
|
||||
NAME tidy
|
||||
GITHUB_REPOSITORY htacg/tidy-html5
|
||||
GIT_TAG 5.8.0
|
||||
PATCHES
|
||||
"${CMAKE_CURRENT_LIST_DIR}/tidy-cmake.patch"
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
)
|
||||
|
||||
# usearch
|
||||
|
||||
CPMAddPackage(
|
||||
NAME usearch
|
||||
GITHUB_REPOSITORY unum-cloud/usearch
|
||||
GIT_TAG v2.26.2
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
)
|
||||
|
||||
# pugixml
|
||||
|
||||
pkg_check_modules(PUGIXML pugixml)
|
||||
if (PUGIXML_FOUND AND NOT DOWNLOAD_PUGIXML)
|
||||
add_library(TracyPugixml INTERFACE)
|
||||
target_include_directories(TracyPugixml INTERFACE ${PUGIXML_INCLUDE_DIRS})
|
||||
target_link_libraries(TracyPugixml INTERFACE ${PUGIXML_LINK_LIBRARIES})
|
||||
else()
|
||||
CPMAddPackage(
|
||||
NAME pugixml
|
||||
GITHUB_REPOSITORY zeux/pugixml
|
||||
GIT_TAG v1.16
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
)
|
||||
add_library(TracyPugixml INTERFACE)
|
||||
target_link_libraries(TracyPugixml INTERFACE pugixml)
|
||||
endif()
|
||||
|
||||
# libcurl
|
||||
|
||||
pkg_check_modules(LIBCURL libcurl>=7.87.0)
|
||||
if (LIBCURL_FOUND AND NOT DOWNLOAD_LIBCURL)
|
||||
add_library(TracyLibcurl INTERFACE)
|
||||
target_include_directories(TracyLibcurl INTERFACE ${LIBCURL_INCLUDE_DIRS})
|
||||
target_link_libraries(TracyLibcurl INTERFACE ${LIBCURL_LINK_LIBRARIES})
|
||||
else()
|
||||
CPMAddPackage(
|
||||
NAME libcurl
|
||||
GITHUB_REPOSITORY curl/curl
|
||||
GIT_TAG curl-8_22_0
|
||||
OPTIONS
|
||||
"BUILD_STATIC_LIBS ON"
|
||||
"BUILD_SHARED_LIBS OFF"
|
||||
"HTTP_ONLY ON"
|
||||
"CURL_ZSTD OFF"
|
||||
"CURL_USE_LIBPSL OFF"
|
||||
"CURL_USE_LIBSSH2 OFF"
|
||||
"CURL_BROTLI OFF"
|
||||
"USE_NGHTTP2 OFF"
|
||||
"USE_LIBIDN2 OFF"
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
)
|
||||
add_library(TracyLibcurl INTERFACE)
|
||||
target_link_libraries(TracyLibcurl INTERFACE libcurl_static)
|
||||
target_include_directories(TracyLibcurl INTERFACE ${libcurl_SOURCE_DIR}/include)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
endif()
|
||||
21
common/src-from-vcxproj.mk
Normal file
@@ -0,0 +1,21 @@
|
||||
# Extract the actual list of source files from a sibling Visual Studio project.
|
||||
|
||||
# Ensure these are simply-substituted variables, without changing their values.
|
||||
SRC := $(SRC)
|
||||
SRC2 := $(SRC2)
|
||||
SRC3 := $(SRC3)
|
||||
SRC4 := $(SRC4)
|
||||
|
||||
# Paths here are relative to the directory in which make was invoked, not to
|
||||
# this file, so ../win32/$(PROJECT).vcxproj refers to the Visual Studio project
|
||||
# of whichever tool is including this makefile fragment.
|
||||
|
||||
BASE := $(shell grep -E 'ClCompile.*cpp"' ../win32/$(PROJECT).vcxproj | sed -e 's/.*\"\(.*\)\".*/\1/' | sed -e 's@\\@/@g')
|
||||
BASE2 := $(shell grep -E 'ClCompile.*c"' ../win32/$(PROJECT).vcxproj | sed -e 's/.*\"\(.*\)\".*/\1/' | sed -e 's@\\@/@g')
|
||||
BASE4 := $(shell grep -E 'None.*S"' ../win32/$(PROJECT).vcxproj | sed -e 's/.*\"\(.*\)\".*/\1/' | sed -e 's@\\@/@g')
|
||||
|
||||
# The tool-specific makefile may request that certain files be omitted.
|
||||
SRC += $(filter-out $(FILTER),$(BASE))
|
||||
SRC2 += $(filter-out $(FILTER),$(BASE2))
|
||||
SRC3 += $(filter-out $(FILTER),$(BASE3))
|
||||
SRC4 += $(filter-out $(FILTER),$(BASE4))
|
||||
15
common/unix-debug.mk
Normal file
@@ -0,0 +1,15 @@
|
||||
ARCH := $(shell uname -m)
|
||||
|
||||
ifeq (1,$(shell $(CC) --version | grep clang > /dev/null && echo 1 || echo 0))
|
||||
ifeq (1,$(shell ld.mold --version > /dev/null 2> /dev/null && echo 1 || echo 0))
|
||||
LDFLAGS := -fuse-ld=mold
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef TRACY_NO_ISA_EXTENSIONS
|
||||
ifneq (,$(filter $(ARCH),aarch64 arm64))
|
||||
CFLAGS += -mcpu=native
|
||||
else
|
||||
CFLAGS += -march=native
|
||||
endif
|
||||
endif
|
||||
19
common/unix-release.mk
Normal file
@@ -0,0 +1,19 @@
|
||||
ARCH := $(shell uname -m)
|
||||
|
||||
ifeq (0,$(shell $(CC) --version | grep clang > /dev/null && echo 1 || echo 0))
|
||||
CFLAGS += -s
|
||||
else
|
||||
ifeq (1,$(shell ld.mold --version > /dev/null 2> /dev/null && echo 1 || echo 0))
|
||||
LDFLAGS := -s -fuse-ld=mold
|
||||
else
|
||||
LDFLAGS := -s
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef TRACY_NO_ISA_EXTENSIONS
|
||||
ifneq (,$(filter $(ARCH),aarch64 arm64))
|
||||
CFLAGS += -mcpu=native
|
||||
else
|
||||
CFLAGS += -march=native
|
||||
endif
|
||||
endif
|
||||
84
common/unix.mk
Normal file
@@ -0,0 +1,84 @@
|
||||
# Common code needed by most Tracy Unix Makefiles.
|
||||
|
||||
# Ensure these are simply-substituted variables, without changing their values.
|
||||
LIBS := $(LIBS)
|
||||
|
||||
ifndef NO_TBB
|
||||
# Tracy does not use TBB directly, but the implementation of parallel algorithms
|
||||
# in some versions of libstdc++ depends on TBB. When it does, you must
|
||||
# explicitly link against -ltbb.
|
||||
#
|
||||
# Some distributions have pgk-config files for TBB, others don't.
|
||||
ifeq (0,$(shell pkg-config --libs tbb >/dev/null 2>&1; echo $$?))
|
||||
LIBS += $(shell pkg-config --libs tbb)
|
||||
else ifeq (0,$(shell ld -ltbb -o /dev/null 2>/dev/null; echo $$?))
|
||||
LIBS += -ltbb
|
||||
endif
|
||||
endif
|
||||
|
||||
OBJDIRBASE := obj/$(BUILD)
|
||||
OBJDIR := $(OBJDIRBASE)/o/o/o
|
||||
|
||||
OBJ := $(addprefix $(OBJDIR)/,$(SRC:%.cpp=%.o))
|
||||
OBJ2 := $(addprefix $(OBJDIR)/,$(SRC2:%.c=%.o))
|
||||
OBJ3 := $(addprefix $(OBJDIR)/,$(SRC3:%.m=%.o))
|
||||
OBJ4 := $(addprefix $(OBJDIR)/,$(SRC4:%.S=%.o))
|
||||
|
||||
all: $(IMAGE)
|
||||
|
||||
$(OBJDIR)/%.o: %.cpp
|
||||
$(CXX) -c $(INCLUDES) $(CXXFLAGS) $(DEFINES) $< -o $@
|
||||
|
||||
$(OBJDIR)/%.d : %.cpp
|
||||
@echo Resolving dependencies of $<
|
||||
@mkdir -p $(@D)
|
||||
@$(CXX) -MM $(INCLUDES) $(CXXFLAGS) $(DEFINES) $< > $@.$$$$; \
|
||||
sed 's,.*\.o[ :]*,$(OBJDIR)/$(<:.cpp=.o) $@ : ,g' < $@.$$$$ > $@; \
|
||||
rm -f $@.$$$$
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
|
||||
|
||||
$(OBJDIR)/%.d : %.c
|
||||
@echo Resolving dependencies of $<
|
||||
@mkdir -p $(@D)
|
||||
@$(CC) -MM $(INCLUDES) $(CFLAGS) $(DEFINES) $< > $@.$$$$; \
|
||||
sed 's,.*\.o[ :]*,$(OBJDIR)/$(<:.c=.o) $@ : ,g' < $@.$$$$ > $@; \
|
||||
rm -f $@.$$$$
|
||||
|
||||
$(OBJDIR)/%.o: %.m
|
||||
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
|
||||
|
||||
$(OBJDIR)/%.d : %.m
|
||||
@echo Resolving dependencies of $<
|
||||
@mkdir -p $(@D)
|
||||
@$(CC) -MM $(INCLUDES) $(CFLAGS) $(DEFINES) $< > $@.$$$$; \
|
||||
sed 's,.*\.o[ :]*,$(OBJDIR)/$(<:.m=.o) $@ : ,g' < $@.$$$$ > $@; \
|
||||
rm -f $@.$$$$
|
||||
|
||||
$(OBJDIR)/%.o: %.S
|
||||
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
|
||||
|
||||
$(OBJDIR)/%.d : %.S
|
||||
@echo Resolving dependencies of $<
|
||||
@mkdir -p $(@D)
|
||||
@$(CC) -MM $(INCLUDES) $(CFLAGS) $(DEFINES) $< > $@.$$$$; \
|
||||
sed 's,.*\.o[ :]*,$(OBJDIR)/$(<:.m=.o) $@ : ,g' < $@.$$$$ > $@; \
|
||||
rm -f $@.$$$$
|
||||
|
||||
ifeq (yes,$(SHARED_LIBRARY))
|
||||
$(IMAGE): $(OBJ) $(OBJ2) $(OBJ4)
|
||||
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(DEFINES) $(OBJ) $(OBJ2) $(OBJ4) $(LIBS) -shared -o $@
|
||||
else
|
||||
$(IMAGE): $(OBJ) $(OBJ2) $(OBJ3) $(OBJ4)
|
||||
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(DEFINES) $(OBJ) $(OBJ2) $(OBJ3) $(OBJ4) $(LIBS) -o $@
|
||||
endif
|
||||
|
||||
ifneq "$(MAKECMDGOALS)" "clean"
|
||||
-include $(addprefix $(OBJDIR)/,$(SRC:.cpp=.d)) $(addprefix $(OBJDIR)/,$(SRC2:.c=.d)) $(addprefix $(OBJDIR)/,$(SRC3:.m=.d)) $(addprefix $(OBJDIR)/,$(SRC4:.S=.d))
|
||||
endif
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJDIRBASE) $(IMAGE)*
|
||||
|
||||
.PHONY: clean all
|
||||
@@ -1,29 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
set(NO_STATISTICS OFF)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
project(
|
||||
tracy-csvexport
|
||||
LANGUAGES C CXX
|
||||
VERSION ${TRACY_VERSION_STRING}
|
||||
)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/config.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/vendor.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/server.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/GitRef.cmake)
|
||||
|
||||
set(PROGRAM_FILES
|
||||
src/csvexport.cpp
|
||||
)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${PROGRAM_FILES} ${COMMON_FILES} ${SERVER_FILES})
|
||||
add_git_ref(${PROJECT_NAME})
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE TracyServer TracyGetOpt)
|
||||
set_property(DIRECTORY ${CMAKE_CURRENT_LIST_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME})
|
||||
|
||||
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"version": 10,
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "common",
|
||||
"hidden": true,
|
||||
"binaryDir": "${sourceDir}/build-${presetName}",
|
||||
"generator": "Ninja",
|
||||
"cacheVariables": {
|
||||
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "debug",
|
||||
"displayName": "Debug configuration",
|
||||
"inherits": "common",
|
||||
"binaryDir": "${sourceDir}/build",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "release",
|
||||
"displayName": "Release configuration",
|
||||
"inherits": "common",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
16
csvexport/build/unix/Makefile
Normal file
@@ -0,0 +1,16 @@
|
||||
all: release
|
||||
|
||||
debug:
|
||||
@$(MAKE) -f debug.mk all
|
||||
|
||||
release:
|
||||
@$(MAKE) -f release.mk all
|
||||
|
||||
clean:
|
||||
@$(MAKE) -f build.mk clean
|
||||
|
||||
db: clean
|
||||
@bear -- $(MAKE) -f debug.mk all
|
||||
@mv -f compile_commands.json ../../../
|
||||
|
||||
.PHONY: all clean debug release db
|
||||
12
csvexport/build/unix/build.mk
Normal file
@@ -0,0 +1,12 @@
|
||||
CFLAGS +=
|
||||
CXXFLAGS := $(CFLAGS) -std=gnu++17
|
||||
# DEFINES += -DTRACY_NO_STATISTICS
|
||||
INCLUDES := $(shell pkg-config --cflags capstone)
|
||||
LIBS := $(shell pkg-config --libs capstone) -lpthread
|
||||
PROJECT := csvexport
|
||||
IMAGE := $(PROJECT)-$(BUILD)
|
||||
|
||||
FILTER :=
|
||||
include ../../../common/src-from-vcxproj.mk
|
||||
|
||||
include ../../../common/unix.mk
|
||||
6
csvexport/build/unix/debug.mk
Normal file
@@ -0,0 +1,6 @@
|
||||
CFLAGS := -g3 -Wall
|
||||
DEFINES := -DDEBUG
|
||||
BUILD := debug
|
||||
|
||||
include ../../../common/unix-debug.mk
|
||||
include build.mk
|
||||
9
csvexport/build/unix/release.mk
Normal file
@@ -0,0 +1,9 @@
|
||||
CFLAGS := -O3
|
||||
ifndef TRACY_NO_LTO
|
||||
CFLAGS += -flto
|
||||
endif
|
||||
DEFINES := -DNDEBUG
|
||||
BUILD := release
|
||||
|
||||
include ../../../common/unix-release.mk
|
||||
include build.mk
|
||||
25
csvexport/build/win32/csvexport.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30907.101
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "csvexport", "csvexport.vcxproj", "{447D58BF-94CD-4469-BB90-549C05D03E00}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{447D58BF-94CD-4469-BB90-549C05D03E00}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{447D58BF-94CD-4469-BB90-549C05D03E00}.Debug|x64.Build.0 = Debug|x64
|
||||
{447D58BF-94CD-4469-BB90-549C05D03E00}.Release|x64.ActiveCfg = Release|x64
|
||||
{447D58BF-94CD-4469-BB90-549C05D03E00}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {3E51386C-43EA-44AC-9F24-AFAFE4D63ADE}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
210
csvexport/build/win32/csvexport.vcxproj
Normal file
@@ -0,0 +1,210 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{447D58BF-94CD-4469-BB90-549C05D03E00}</ProjectGuid>
|
||||
<RootNamespace>capture</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<VcpkgTriplet>x64-windows-static</VcpkgTriplet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
<PropertyGroup Label="Vcpkg">
|
||||
<VcpkgEnableManifest>true</VcpkgEnableManifest>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32_LEAN_AND_MEAN;NOMINMAX;_USE_MATH_DEFINES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\include;$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\include\capstone;$(VcpkgManifestRoot)\vcpkg_installed\$(VcpkgTriplet)\$(VcpkgTriplet)\include\capstone;$(VcpkgRoot)\installed\$(VcpkgTriplet)\include\capstone</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ws2_32.lib;capstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\debug\lib</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32_LEAN_AND_MEAN;NOMINMAX;_USE_MATH_DEFINES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\include;$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\include\capstone;$(VcpkgManifestRoot)\vcpkg_installed\$(VcpkgTriplet)\$(VcpkgTriplet)\include\capstone;$(VcpkgRoot)\installed\$(VcpkgTriplet)\include\capstone</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>ws2_32.lib;capstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<AdditionalLibraryDirectories>$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\lib</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\getopt\getopt.c" />
|
||||
<ClCompile Include="..\..\..\public\common\TracySocket.cpp" />
|
||||
<ClCompile Include="..\..\..\public\common\TracyStackFrames.cpp" />
|
||||
<ClCompile Include="..\..\..\public\common\TracySystem.cpp" />
|
||||
<ClCompile Include="..\..\..\public\common\tracy_lz4.cpp" />
|
||||
<ClCompile Include="..\..\..\public\common\tracy_lz4hc.cpp" />
|
||||
<ClCompile Include="..\..\..\server\TracyMemory.cpp" />
|
||||
<ClCompile Include="..\..\..\server\TracyMmap.cpp" />
|
||||
<ClCompile Include="..\..\..\server\TracyPrint.cpp" />
|
||||
<ClCompile Include="..\..\..\server\TracyTaskDispatch.cpp" />
|
||||
<ClCompile Include="..\..\..\server\TracyTextureCompression.cpp" />
|
||||
<ClCompile Include="..\..\..\server\TracyThreadCompress.cpp" />
|
||||
<ClCompile Include="..\..\..\server\TracyWorker.cpp" />
|
||||
<ClCompile Include="..\..\..\zstd\common\debug.c" />
|
||||
<ClCompile Include="..\..\..\zstd\common\entropy_common.c" />
|
||||
<ClCompile Include="..\..\..\zstd\common\error_private.c" />
|
||||
<ClCompile Include="..\..\..\zstd\common\fse_decompress.c" />
|
||||
<ClCompile Include="..\..\..\zstd\common\pool.c" />
|
||||
<ClCompile Include="..\..\..\zstd\common\threading.c" />
|
||||
<ClCompile Include="..\..\..\zstd\common\xxhash.c" />
|
||||
<ClCompile Include="..\..\..\zstd\common\zstd_common.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\fse_compress.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\hist.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\huf_compress.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstdmt_compress.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_compress.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_literals.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_sequences.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_superblock.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_double_fast.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_fast.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_lazy.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_ldm.c" />
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_opt.c" />
|
||||
<ClCompile Include="..\..\..\zstd\decompress\huf_decompress.c" />
|
||||
<ClCompile Include="..\..\..\zstd\decompress\zstd_ddict.c" />
|
||||
<ClCompile Include="..\..\..\zstd\decompress\zstd_decompress.c" />
|
||||
<ClCompile Include="..\..\..\zstd\decompress\zstd_decompress_block.c" />
|
||||
<ClCompile Include="..\..\..\zstd\dictBuilder\cover.c" />
|
||||
<ClCompile Include="..\..\..\zstd\dictBuilder\divsufsort.c" />
|
||||
<ClCompile Include="..\..\..\zstd\dictBuilder\fastcover.c" />
|
||||
<ClCompile Include="..\..\..\zstd\dictBuilder\zdict.c" />
|
||||
<ClCompile Include="..\..\src\csvexport.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\getopt\getopt.h" />
|
||||
<ClInclude Include="..\..\..\public\common\TracyAlign.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\TracyAlloc.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\TracyApi.h" />
|
||||
<ClInclude Include="..\..\..\public\common\TracyColor.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\TracyForceInline.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\TracyMutex.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\TracyProtocol.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\TracyQueue.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\TracySocket.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\TracyStackFrames.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\TracySystem.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\TracyUwp.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\TracyYield.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\tracy_lz4.hpp" />
|
||||
<ClInclude Include="..\..\..\public\common\tracy_lz4hc.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyCharUtil.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyEvent.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyFileRead.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyFileWrite.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyMemory.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyMmap.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyPopcnt.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyPrint.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracySlab.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyTaskDispatch.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyTextureCompression.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyThreadCompress.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyVector.hpp" />
|
||||
<ClInclude Include="..\..\..\server\TracyWorker.hpp" />
|
||||
<ClInclude Include="..\..\..\zstd\common\bitstream.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\compiler.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\cpu.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\debug.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\error_private.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\fse.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\huf.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\mem.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\pool.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\portability_macros.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\threading.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\xxhash.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\zstd_deps.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\zstd_internal.h" />
|
||||
<ClInclude Include="..\..\..\zstd\common\zstd_trace.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\clevels.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\hist.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstdmt_compress.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_internal.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_literals.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_sequences.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_superblock.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_cwksp.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_double_fast.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_fast.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_lazy.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_ldm.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_ldm_geartab.h" />
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_opt.h" />
|
||||
<ClInclude Include="..\..\..\zstd\decompress\zstd_ddict.h" />
|
||||
<ClInclude Include="..\..\..\zstd\decompress\zstd_decompress_block.h" />
|
||||
<ClInclude Include="..\..\..\zstd\decompress\zstd_decompress_internal.h" />
|
||||
<ClInclude Include="..\..\..\zstd\dictBuilder\cover.h" />
|
||||
<ClInclude Include="..\..\..\zstd\dictBuilder\divsufsort.h" />
|
||||
<ClInclude Include="..\..\..\zstd\zdict.h" />
|
||||
<ClInclude Include="..\..\..\zstd\zstd.h" />
|
||||
<ClInclude Include="..\..\..\zstd\zstd_errors.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\..\zstd\decompress\huf_decompress_amd64.S" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
371
csvexport/build/win32/csvexport.vcxproj.filters
Normal file
@@ -0,0 +1,371 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="src">
|
||||
<UniqueIdentifier>{729c80ee-4d26-4a5e-8f1f-6c075783eb56}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="server">
|
||||
<UniqueIdentifier>{cf23ef7b-7694-4154-830b-00cf053350ea}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="common">
|
||||
<UniqueIdentifier>{e39d3623-47cd-4752-8da9-3ea324f964c1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="getopt">
|
||||
<UniqueIdentifier>{ee9737d2-69c7-44da-b9c7-539d18f9d4b4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="zstd">
|
||||
<UniqueIdentifier>{44ea1742-0fd9-40ba-879c-031868509600}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="zstd\common">
|
||||
<UniqueIdentifier>{2d065bba-d78e-4e44-87f7-b44cf3248260}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="zstd\compress">
|
||||
<UniqueIdentifier>{a19ca3bc-2a17-49c5-a0d9-5916213de774}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="zstd\decompress">
|
||||
<UniqueIdentifier>{d4181058-2198-4931-ae31-b7eda0312458}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="zstd\dictBuilder">
|
||||
<UniqueIdentifier>{873c22fe-b4d7-480d-ad67-48271296f4c1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\server\TracyMemory.cpp">
|
||||
<Filter>server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\server\TracyWorker.cpp">
|
||||
<Filter>server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\server\TracyPrint.cpp">
|
||||
<Filter>server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\server\TracyThreadCompress.cpp">
|
||||
<Filter>server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\server\TracyTaskDispatch.cpp">
|
||||
<Filter>server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\server\TracyMmap.cpp">
|
||||
<Filter>server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\server\TracyTextureCompression.cpp">
|
||||
<Filter>server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\getopt\getopt.c">
|
||||
<Filter>getopt</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\csvexport.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\common\debug.c">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\common\entropy_common.c">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\common\error_private.c">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\common\fse_decompress.c">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\common\pool.c">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\common\threading.c">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\common\xxhash.c">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\common\zstd_common.c">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\decompress\huf_decompress.c">
|
||||
<Filter>zstd\decompress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\decompress\zstd_ddict.c">
|
||||
<Filter>zstd\decompress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\decompress\zstd_decompress.c">
|
||||
<Filter>zstd\decompress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\decompress\zstd_decompress_block.c">
|
||||
<Filter>zstd\decompress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\fse_compress.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\hist.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\huf_compress.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_compress.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_literals.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_sequences.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_superblock.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_double_fast.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_fast.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_lazy.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_ldm.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstd_opt.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\compress\zstdmt_compress.c">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\dictBuilder\cover.c">
|
||||
<Filter>zstd\dictBuilder</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\dictBuilder\divsufsort.c">
|
||||
<Filter>zstd\dictBuilder</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\dictBuilder\fastcover.c">
|
||||
<Filter>zstd\dictBuilder</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\zstd\dictBuilder\zdict.c">
|
||||
<Filter>zstd\dictBuilder</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\public\common\tracy_lz4.cpp">
|
||||
<Filter>common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\public\common\tracy_lz4hc.cpp">
|
||||
<Filter>common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\public\common\TracySocket.cpp">
|
||||
<Filter>common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\public\common\TracyStackFrames.cpp">
|
||||
<Filter>common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\public\common\TracySystem.cpp">
|
||||
<Filter>common</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\server\TracyCharUtil.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyEvent.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyFileWrite.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyMemory.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyPopcnt.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracySlab.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyVector.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyWorker.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyPrint.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyThreadCompress.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyTaskDispatch.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyFileRead.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyMmap.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\server\TracyTextureCompression.hpp">
|
||||
<Filter>server</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\getopt\getopt.h">
|
||||
<Filter>getopt</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\zstd.h">
|
||||
<Filter>zstd</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\zstd_errors.h">
|
||||
<Filter>zstd</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\bitstream.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\compiler.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\cpu.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\debug.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\error_private.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\fse.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\huf.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\mem.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\pool.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\threading.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\xxhash.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\zstd_deps.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\zstd_internal.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\zstd_trace.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\decompress\zstd_ddict.h">
|
||||
<Filter>zstd\decompress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\decompress\zstd_decompress_block.h">
|
||||
<Filter>zstd\decompress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\decompress\zstd_decompress_internal.h">
|
||||
<Filter>zstd\decompress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\hist.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_internal.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_literals.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_sequences.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_superblock.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_cwksp.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_double_fast.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_fast.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_lazy.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_ldm.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_ldm_geartab.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstd_opt.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\zstdmt_compress.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\zdict.h">
|
||||
<Filter>zstd</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\dictBuilder\cover.h">
|
||||
<Filter>zstd\dictBuilder</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\dictBuilder\divsufsort.h">
|
||||
<Filter>zstd\dictBuilder</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\common\portability_macros.h">
|
||||
<Filter>zstd\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\zstd\compress\clevels.h">
|
||||
<Filter>zstd\compress</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\tracy_lz4.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\tracy_lz4hc.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracyAlign.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracyAlloc.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracyApi.h">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracyColor.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracyForceInline.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracyMutex.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracyProtocol.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracyQueue.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracySocket.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracyStackFrames.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracySystem.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracyUwp.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\common\TracyYield.hpp">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\..\zstd\decompress\huf_decompress_amd64.S">
|
||||
<Filter>zstd\decompress</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -16,27 +16,20 @@
|
||||
#include "../../server/TracyFileRead.hpp"
|
||||
#include "../../server/TracyWorker.hpp"
|
||||
#include "../../getopt/getopt.h"
|
||||
#include "../../public/common/TracyVersion.hpp"
|
||||
#include "GitRef.hpp"
|
||||
|
||||
void print_usage_exit(int e)
|
||||
{
|
||||
fprintf(stderr, "tracy-csvexport %i.%i.%i / %s\n\n", tracy::Version::Major, tracy::Version::Minor, tracy::Version::Patch, tracy::GitRef);
|
||||
fprintf(stderr, "Extract statistics from a trace to a CSV format\n");
|
||||
fprintf(stderr, "Usage:\n");
|
||||
fprintf(stderr, " extract [OPTION...] <trace file>\n");
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, " -h, --help Print usage\n");
|
||||
fprintf(stderr, " -V, --version Show version information\n");
|
||||
fprintf(stderr, " -f, --filter arg Filter zone names (default: "")\n");
|
||||
fprintf(stderr, " -s, --sep arg CSV separator (default: ,)\n");
|
||||
fprintf(stderr, " -c, --case Case sensitive filtering\n");
|
||||
fprintf(stderr, " -e, --self Get self times\n");
|
||||
fprintf(stderr, " -u, --unwrap Report each cpu zone event\n");
|
||||
fprintf(stderr, " -g, --gpu Report each gpu zone event\n" );
|
||||
fprintf(stderr, " -m, --messages Report only messages\n");
|
||||
fprintf(stderr, " -p, --plot Report plot data (only with -u)\n");
|
||||
fprintf(stderr, " -t, --truncated_mean[=arg] Report truncated mean (arg is the percentile. Default is 90)\n");
|
||||
fprintf(stderr, " -h, --help Print usage\n");
|
||||
fprintf(stderr, " -f, --filter arg Filter zone names (default: "")\n");
|
||||
fprintf(stderr, " -s, --sep arg CSV separator (default: ,)\n");
|
||||
fprintf(stderr, " -c, --case Case sensitive filtering\n");
|
||||
fprintf(stderr, " -e, --self Get self times\n");
|
||||
fprintf(stderr, " -u, --unwrap Report each zone event\n");
|
||||
fprintf(stderr, " -m, --messages Report only messages\n");
|
||||
|
||||
exit(e);
|
||||
}
|
||||
@@ -48,10 +41,7 @@ struct Args {
|
||||
bool case_sensitive;
|
||||
bool self_time;
|
||||
bool unwrap;
|
||||
bool show_gpu;
|
||||
bool unwrapMessages;
|
||||
bool plot;
|
||||
int truncated_mean_percentile;
|
||||
};
|
||||
|
||||
Args parse_args(int argc, char** argv)
|
||||
@@ -61,34 +51,27 @@ Args parse_args(int argc, char** argv)
|
||||
print_usage_exit(1);
|
||||
}
|
||||
|
||||
Args args = { "", ",", "", false, false, false, false, false, false, 0};
|
||||
Args args = { "", ",", "", false, false, false, false };
|
||||
|
||||
struct option long_opts[] = {
|
||||
{ "help", no_argument, NULL, 'h' },
|
||||
{ "version", no_argument, NULL, 'V' },
|
||||
{ "filter", required_argument, NULL, 'f' },
|
||||
{ "sep", required_argument, NULL, 's' },
|
||||
{ "filter", optional_argument, NULL, 'f' },
|
||||
{ "sep", optional_argument, NULL, 's' },
|
||||
{ "case", no_argument, NULL, 'c' },
|
||||
{ "self", no_argument, NULL, 'e' },
|
||||
{ "unwrap", no_argument, NULL, 'u' },
|
||||
{ "gpu", no_argument, NULL, 'g' },
|
||||
{ "messages", no_argument, NULL, 'm' },
|
||||
{ "plot", no_argument, NULL, 'p' },
|
||||
{ "truncated_mean", optional_argument, NULL, 't' },
|
||||
{ NULL, 0, NULL, 0 }
|
||||
};
|
||||
|
||||
int c;
|
||||
while ((c = getopt_long(argc, argv, "hf:s:t:ceugmpV", long_opts, NULL)) != -1)
|
||||
while ((c = getopt_long(argc, argv, "hf:s:ceum", long_opts, NULL)) != -1)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case 'h':
|
||||
print_usage_exit(0);
|
||||
break;
|
||||
case 'V':
|
||||
printf( "tracy-csvexport %i.%i.%i / %s\n", tracy::Version::Major, tracy::Version::Minor, tracy::Version::Patch, tracy::GitRef );
|
||||
exit( 0 );
|
||||
case 'f':
|
||||
args.filter = optarg;
|
||||
break;
|
||||
@@ -104,18 +87,9 @@ Args parse_args(int argc, char** argv)
|
||||
case 'u':
|
||||
args.unwrap = true;
|
||||
break;
|
||||
case 'g':
|
||||
args.show_gpu = true;
|
||||
break;
|
||||
case 'm':
|
||||
args.unwrapMessages = true;
|
||||
break;
|
||||
case 'p':
|
||||
args.plot = true;
|
||||
break;
|
||||
case 't':
|
||||
args.truncated_mean_percentile = std::clamp<int>(optarg ? std::atoi(optarg) : 90, 1, 99);
|
||||
break;
|
||||
default:
|
||||
print_usage_exit(1);
|
||||
break;
|
||||
@@ -177,53 +151,6 @@ std::string join(const T& v, const char* sep) {
|
||||
return s.str();
|
||||
}
|
||||
|
||||
// Returns {pN, truncated_mean}
|
||||
std::pair<int64_t, int64_t> percentile_and_truncated_mean(std::vector<int64_t>& data, const double p)
|
||||
{
|
||||
assert(p >= 0.0 && p <= 1.0);
|
||||
|
||||
if (data.empty()) {
|
||||
return {0, 0};
|
||||
}
|
||||
|
||||
std::sort(data.begin(), data.end());
|
||||
|
||||
const std::size_t n = data.size();
|
||||
const double idx = p * (static_cast<double>(n) - 1.0);
|
||||
const std::size_t idxLow = static_cast<std::size_t>(std::floor(idx));
|
||||
const std::size_t idxHigh = std::min(idxLow + 1, n - 1);
|
||||
const double frac = idx - static_cast<double>(idxLow);
|
||||
|
||||
const double low = static_cast<double>(data[idxLow]);
|
||||
const double high = static_cast<double>(data[idxHigh]);
|
||||
|
||||
// percentile value
|
||||
const double pval_double = low + (high - low) * frac;
|
||||
const int64_t pval_int = static_cast<int64_t>(std::llround(pval_double));
|
||||
|
||||
// Compute truncated mean: average of all values <= pval_double
|
||||
int64_t sum = 0;
|
||||
std::size_t count = 0;
|
||||
for (std::size_t i = 0; i < n; ++i) {
|
||||
if (static_cast<double>(data[i]) <= pval_double) {
|
||||
sum += data[i];
|
||||
++count;
|
||||
} else {
|
||||
break; // sorted, so we can stop once we hit > pval_double
|
||||
}
|
||||
}
|
||||
|
||||
if (count == 0) {
|
||||
// should not happen for p in [0,1] unless data empty, but keep defensive behaviour
|
||||
return {pval_int, 0};
|
||||
}
|
||||
|
||||
const int64_t truncated_mean = sum / count;
|
||||
|
||||
return {pval_int, truncated_mean};
|
||||
}
|
||||
|
||||
|
||||
// From TracyView.cpp
|
||||
int64_t GetZoneChildTimeFast(
|
||||
const tracy::Worker& worker,
|
||||
@@ -314,68 +241,6 @@ int main(int argc, char** argv)
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
}
|
||||
|
||||
if (args.show_gpu)
|
||||
{
|
||||
auto& gpu_slz = worker.GetGpuSourceLocationZones();
|
||||
tracy::Vector<decltype( gpu_slz.begin() )> gpu_slz_selected;
|
||||
gpu_slz_selected.reserve( gpu_slz.size() );
|
||||
|
||||
uint32_t total_cnt = 0;
|
||||
for (auto it = gpu_slz.begin(); it != gpu_slz.end(); ++it)
|
||||
{
|
||||
if (it->second.total != 0)
|
||||
{
|
||||
++total_cnt;
|
||||
if (args.filter[0] == '\0')
|
||||
{
|
||||
gpu_slz_selected.push_back_no_space_check( it );
|
||||
}
|
||||
else
|
||||
{
|
||||
auto name = get_name( it->first, worker );
|
||||
if (is_substring( args.filter, name, args.case_sensitive))
|
||||
{
|
||||
gpu_slz_selected.push_back_no_space_check( it );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<const char*> columns;
|
||||
columns = {"name", "src_file", "Time from start of program", "GPU execution time"};
|
||||
|
||||
std::string header = join(columns, args.separator);
|
||||
printf("%s\n", header.data());
|
||||
|
||||
const auto last_time = worker.GetLastTime();
|
||||
for (auto& it : gpu_slz_selected)
|
||||
{
|
||||
std::vector<std::string> values( columns.size() );
|
||||
|
||||
values[0] = get_name( it->first, worker );
|
||||
|
||||
const auto& srcloc = worker.GetSourceLocation( it->first );
|
||||
values[1] = worker.GetString( srcloc.file );
|
||||
|
||||
const auto& zone_data = it->second;
|
||||
for (const auto& zone_thread_data : zone_data.zones)
|
||||
{
|
||||
tracy::GpuEvent* gpu_event = zone_thread_data.Zone();
|
||||
const auto start = gpu_event->GpuStart();
|
||||
const auto end = gpu_event->GpuEnd();
|
||||
|
||||
values[2] = std::to_string( start );
|
||||
|
||||
auto timespan = end - start;
|
||||
values[3] = std::to_string( timespan );
|
||||
|
||||
std::string row = join( values, args.separator );
|
||||
printf( "%s\n", row.data() );
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto& slz = worker.GetSourceLocationZones();
|
||||
tracy::Vector<decltype(slz.begin())> slz_selected;
|
||||
slz_selected.reserve(slz.size());
|
||||
@@ -405,7 +270,7 @@ int main(int argc, char** argv)
|
||||
if (args.unwrap)
|
||||
{
|
||||
columns = {
|
||||
"name", "src_file", "src_line", "ns_since_start", "exec_time_ns", "thread", "value"
|
||||
"name", "src_file", "src_line", "ns_since_start", "exec_time_ns", "thread"
|
||||
};
|
||||
}
|
||||
else
|
||||
@@ -414,12 +279,6 @@ int main(int argc, char** argv)
|
||||
"name", "src_file", "src_line", "total_ns", "total_perc",
|
||||
"counts", "mean_ns", "min_ns", "max_ns", "std_ns"
|
||||
};
|
||||
|
||||
if(args.truncated_mean_percentile)
|
||||
{
|
||||
columns.push_back("percentile_ns");
|
||||
columns.push_back("truncated_mean_ns");
|
||||
}
|
||||
}
|
||||
std::string header = join(columns, args.separator);
|
||||
printf("%s\n", header.data());
|
||||
@@ -454,12 +313,6 @@ int main(int argc, char** argv)
|
||||
}
|
||||
values[4] = std::to_string(timespan);
|
||||
values[5] = std::to_string(tId);
|
||||
if (worker.HasZoneExtra(*zone_event)) {
|
||||
const auto& text = worker.GetZoneExtra(*zone_event).text;
|
||||
if (text.Active()) {
|
||||
values[6] = worker.GetString(text);
|
||||
}
|
||||
}
|
||||
|
||||
std::string row = join(values, args.separator);
|
||||
printf("%s\n", row.data());
|
||||
@@ -471,11 +324,10 @@ int main(int argc, char** argv)
|
||||
values[3] = std::to_string(time);
|
||||
values[4] = std::to_string(100. * time / last_time);
|
||||
|
||||
const auto sz = zone_data.zones.size();
|
||||
values[5] = std::to_string(sz);
|
||||
|
||||
const auto avg = time / sz;
|
||||
values[5] = std::to_string(zone_data.zones.size());
|
||||
|
||||
const auto avg = (args.self_time ? zone_data.selfTotal : zone_data.total)
|
||||
/ zone_data.zones.size();
|
||||
values[6] = std::to_string(avg);
|
||||
|
||||
const auto tmin = args.self_time ? zone_data.selfMin : zone_data.min;
|
||||
@@ -483,6 +335,7 @@ int main(int argc, char** argv)
|
||||
values[7] = std::to_string(tmin);
|
||||
values[8] = std::to_string(tmax);
|
||||
|
||||
const auto sz = zone_data.zones.size();
|
||||
const auto ss = zone_data.sumSq
|
||||
- 2. * zone_data.total * avg
|
||||
+ avg * avg * sz;
|
||||
@@ -491,49 +344,10 @@ int main(int argc, char** argv)
|
||||
std = sqrt(ss / (sz - 1));
|
||||
values[9] = std::to_string(std);
|
||||
|
||||
if(args.truncated_mean_percentile)
|
||||
{
|
||||
std::vector<int64_t> samples;
|
||||
samples.reserve( zone_data.zones.size() );
|
||||
for(const auto& zone_thread_data : zone_data.zones)
|
||||
{
|
||||
const auto zone_event = zone_thread_data.Zone();
|
||||
auto timespan = zone_event->End() - zone_event->Start();
|
||||
if(args.self_time)
|
||||
timespan -= GetZoneChildTimeFast( worker, *zone_event );
|
||||
samples.push_back( timespan );
|
||||
}
|
||||
|
||||
std::pair<int64_t, int64_t> pN = percentile_and_truncated_mean(samples, args.truncated_mean_percentile / 100.0);
|
||||
values[10] = std::to_string(pN.first);
|
||||
values[11] = std::to_string(pN.second);
|
||||
}
|
||||
|
||||
std::string row = join(values, args.separator);
|
||||
printf("%s\n", row.data());
|
||||
}
|
||||
}
|
||||
|
||||
if(args.plot && args.unwrap)
|
||||
{
|
||||
auto& plots = worker.GetPlots();
|
||||
for(const auto& plot : plots)
|
||||
{
|
||||
std::vector<std::string> values(columns.size());
|
||||
values[0] = worker.GetString(plot->name);
|
||||
|
||||
for(const auto& val : plot->data)
|
||||
{
|
||||
if (args.unwrap)
|
||||
{
|
||||
values[3] = std::to_string(val.time.Val());
|
||||
values[6] = std::to_string(val.val);
|
||||
}
|
||||
std::string row = join(values, args.separator);
|
||||
printf("%s\n", row.data());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
370
doc/design.svg
Normal file
@@ -0,0 +1,370 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
id="svg8"
|
||||
version="1.1"
|
||||
viewBox="0 0 139.17125 37.041668"
|
||||
height="140"
|
||||
width="526.00159">
|
||||
<defs
|
||||
id="defs2">
|
||||
<marker
|
||||
style="overflow:visible"
|
||||
id="marker6660"
|
||||
refX="0"
|
||||
refY="0"
|
||||
orient="auto">
|
||||
<path
|
||||
transform="matrix(-0.4,0,0,-0.4,-4,0)"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
id="path6658" />
|
||||
</marker>
|
||||
<marker
|
||||
style="overflow:visible"
|
||||
id="marker6158"
|
||||
refX="0"
|
||||
refY="0"
|
||||
orient="auto">
|
||||
<path
|
||||
transform="matrix(-0.4,0,0,-0.4,-4,0)"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
id="path6156" />
|
||||
</marker>
|
||||
<marker
|
||||
style="overflow:visible"
|
||||
id="Arrow1Send"
|
||||
refX="0"
|
||||
refY="0"
|
||||
orient="auto">
|
||||
<path
|
||||
transform="matrix(-0.2,0,0,-0.2,-1.2,0)"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
id="path4694" />
|
||||
</marker>
|
||||
<marker
|
||||
style="overflow:visible"
|
||||
id="marker5984"
|
||||
refX="0"
|
||||
refY="0"
|
||||
orient="auto">
|
||||
<path
|
||||
transform="matrix(-0.4,0,0,-0.4,-4,0)"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
id="path5982" />
|
||||
</marker>
|
||||
<marker
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker5482"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path5480"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(-0.4,0,0,-0.4,-4,0)" />
|
||||
</marker>
|
||||
<marker
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker5472"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path5470"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(-0.4,0,0,-0.4,-4,0)" />
|
||||
</marker>
|
||||
<marker
|
||||
style="overflow:visible"
|
||||
id="marker5378"
|
||||
refX="0"
|
||||
refY="0"
|
||||
orient="auto">
|
||||
<path
|
||||
transform="matrix(-0.4,0,0,-0.4,-4,0)"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
id="path5376" />
|
||||
</marker>
|
||||
<marker
|
||||
style="overflow:visible"
|
||||
id="marker5308"
|
||||
refX="0"
|
||||
refY="0"
|
||||
orient="auto">
|
||||
<path
|
||||
transform="matrix(-0.4,0,0,-0.4,-4,0)"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
id="path5306" />
|
||||
</marker>
|
||||
<marker
|
||||
style="overflow:visible"
|
||||
id="Arrow1Mend"
|
||||
refX="0"
|
||||
refY="0"
|
||||
orient="auto">
|
||||
<path
|
||||
transform="matrix(-0.4,0,0,-0.4,-4,0)"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
id="path4688" />
|
||||
</marker>
|
||||
<marker
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker5170"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path5168"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(-0.8,0,0,-0.8,-10,0)" />
|
||||
</marker>
|
||||
<marker
|
||||
orient="auto"
|
||||
refY="0"
|
||||
refX="0"
|
||||
id="marker4963"
|
||||
style="overflow:visible">
|
||||
<path
|
||||
id="path4961"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
transform="matrix(-0.8,0,0,-0.8,-10,0)" />
|
||||
</marker>
|
||||
<marker
|
||||
style="overflow:visible"
|
||||
id="marker6158-2"
|
||||
refX="0"
|
||||
refY="0"
|
||||
orient="auto">
|
||||
<path
|
||||
transform="matrix(-0.4,0,0,-0.4,-4,0)"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
|
||||
d="M 0,0 5,-5 -12.5,0 5,5 Z"
|
||||
id="path6156-2" />
|
||||
</marker>
|
||||
</defs>
|
||||
<metadata
|
||||
id="metadata5">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
transform="translate(-18.388332,-17.864582)"
|
||||
id="layer1">
|
||||
<g
|
||||
id="g4666">
|
||||
<rect
|
||||
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect4607"
|
||||
width="17.197916"
|
||||
height="6.614583"
|
||||
x="18.520834"
|
||||
y="20.510416" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:2.82222223px;line-height:6.61458302px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="20.968229"
|
||||
y="24.869841"
|
||||
id="text4611"><tspan
|
||||
id="tspan4609"
|
||||
x="20.968229"
|
||||
y="24.869841"
|
||||
style="stroke-width:0.26458332px">Thread 1</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g4661">
|
||||
<rect
|
||||
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect4607-4"
|
||||
width="17.197916"
|
||||
height="6.6145835"
|
||||
x="18.520834"
|
||||
y="32.416668" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:2.82222223px;line-height:6.61458349px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="20.979254"
|
||||
y="36.776093"
|
||||
id="text4611-8"><tspan
|
||||
id="tspan4609-9"
|
||||
x="20.979254"
|
||||
y="36.776093"
|
||||
style="stroke-width:0.26458332px">Thread 2</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g4671">
|
||||
<rect
|
||||
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect4607-8"
|
||||
width="17.197916"
|
||||
height="6.6145835"
|
||||
x="18.520832"
|
||||
y="44.322918" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:2.82222223px;line-height:6.61458349px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="20.951002"
|
||||
y="48.682343"
|
||||
id="text4611-89"><tspan
|
||||
id="tspan4609-6"
|
||||
x="20.951002"
|
||||
y="48.682343"
|
||||
style="stroke-width:0.26458332px">Thread 3</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g5096">
|
||||
<ellipse
|
||||
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path4644"
|
||||
cx="67.775978"
|
||||
cy="36.3787"
|
||||
rx="10.583333"
|
||||
ry="4.6302085" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:2.82222223px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="67.733261"
|
||||
y="35.623535"
|
||||
id="text4648"><tspan
|
||||
id="tspan4646"
|
||||
x="67.733261"
|
||||
y="35.623535"
|
||||
style="text-align:center;text-anchor:middle;stroke-width:0.26458332px">Tracy</tspan><tspan
|
||||
x="67.733261"
|
||||
y="39.151314"
|
||||
style="text-align:center;text-anchor:middle;stroke-width:0.26458332px"
|
||||
id="tspan4650">client</tspan></text>
|
||||
</g>
|
||||
<path
|
||||
id="path4673"
|
||||
d="m 37.041666,24.479166 19.84375,7.937502"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker5472)" />
|
||||
<path
|
||||
id="path4675"
|
||||
d="m 37.041666,46.968751 19.84375,-6.614584"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker5482)" />
|
||||
<path
|
||||
id="path4677"
|
||||
d="M 37.041667,36.385417 H 55.5625"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker5378)" />
|
||||
<path
|
||||
id="path5059"
|
||||
d="M 84.666667,17.864582 V 54.90625"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1.05833327, 2.11666654;stroke-dashoffset:0;stroke-opacity:1" />
|
||||
<g
|
||||
id="g5106">
|
||||
<ellipse
|
||||
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path4644-1"
|
||||
cx="101.98283"
|
||||
cy="36.56768"
|
||||
rx="10.583333"
|
||||
ry="4.6302085" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:2.82222223px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="101.90772"
|
||||
y="35.812515"
|
||||
id="text4648-2"><tspan
|
||||
id="tspan4646-5"
|
||||
x="101.90772"
|
||||
y="35.812515"
|
||||
style="text-align:center;text-anchor:middle;stroke-width:0.26458332px">Tracy</tspan><tspan
|
||||
x="101.90772"
|
||||
y="39.340294"
|
||||
style="text-align:center;text-anchor:middle;stroke-width:0.26458332px"
|
||||
id="tspan4650-1">server</tspan></text>
|
||||
</g>
|
||||
<path
|
||||
id="path5108"
|
||||
d="M 79.375,37.708333 H 89.958333"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6660)" />
|
||||
<path
|
||||
id="path5110"
|
||||
d="M 89.958333,35.0625 H 79.375"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker5308)" />
|
||||
<g
|
||||
transform="translate(-2.64619,-1.3704153)"
|
||||
id="g6152">
|
||||
<ellipse
|
||||
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="path6114"
|
||||
cx="128.98439"
|
||||
cy="33.692333"
|
||||
rx="4.6302085"
|
||||
ry="1.2756696" />
|
||||
<path
|
||||
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
d="m 124.36251,41.677042 c -0.004,0.01582 -0.007,0.03168 -0.008,0.04754 5.3e-4,0.704384 2.07327,1.275328 4.62995,1.275373 2.55689,3.5e-5 4.62988,-0.570931 4.63048,-1.275373 -10e-4,-0.01585 -0.003,-0.03171 -0.006,-0.04754"
|
||||
id="path6114-1" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 124.35417,33.739583 v 8.021022"
|
||||
id="path6138" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 133.61458,33.739582 v 8.051744"
|
||||
id="path6140" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:2.82222223px;line-height:6.61458302px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="126.89217"
|
||||
y="39.409225"
|
||||
id="text6144"><tspan
|
||||
id="tspan6142"
|
||||
x="126.89217"
|
||||
y="39.409225"
|
||||
style="stroke-width:0.26458332px">DB</tspan></text>
|
||||
</g>
|
||||
<path
|
||||
id="path6154"
|
||||
d="m 113.77082,36.385418 h 6.61459"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6158)" />
|
||||
<g
|
||||
transform="translate(2.6458333,1.2715659e-6)"
|
||||
id="g6241">
|
||||
<rect
|
||||
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
id="rect6232"
|
||||
width="17.197916"
|
||||
height="5.291667"
|
||||
x="137.58333"
|
||||
y="33.739582" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:2.82222223px;line-height:6.61458302px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="140.8851"
|
||||
y="37.164005"
|
||||
id="text6236"><tspan
|
||||
id="tspan6234"
|
||||
x="140.8851"
|
||||
y="37.164005"
|
||||
style="stroke-width:0.26458332px">Display</tspan></text>
|
||||
</g>
|
||||
<path
|
||||
id="path6154-3"
|
||||
d="m 132.29166,36.385417 h 6.61459"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6158-2)" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 15 KiB |
BIN
doc/issues/dxt1+alpha.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
@@ -164,7 +164,7 @@ namespace dtl {
|
||||
return trivial;
|
||||
}
|
||||
|
||||
void enableTrivial () {
|
||||
void enableTrivial () const {
|
||||
this->trivial = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
// Template implementations of the tracy::Platform* hooks. Pair with the
|
||||
// platform header (see CustomPlatform.h) and link this into your final
|
||||
// binary.
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "CustomPlatform.h"
|
||||
|
||||
namespace tracy
|
||||
{
|
||||
|
||||
uint32_t PlatformGetThreadId()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void PlatformGetHostname( char* buf, size_t size )
|
||||
{
|
||||
const char* placeholder = "(?)";
|
||||
if( size == 0 ) return;
|
||||
const size_t n = strlen( placeholder );
|
||||
const size_t copy = n < size - 1 ? n : size - 1;
|
||||
memcpy( buf, placeholder, copy );
|
||||
buf[copy] = '\0';
|
||||
}
|
||||
|
||||
const char* PlatformGetUserLogin()
|
||||
{
|
||||
return "(?)";
|
||||
}
|
||||
|
||||
const char* PlatformGetUserFullName()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool PlatformSafeMemcpy( void* dst, const void* src, size_t size )
|
||||
{
|
||||
// Stub: report failure so Tracy skips the snapshot. Real impls use SEH
|
||||
// on Win32, pipe(2) on POSIX, or an equivalent probe-and-copy primitive.
|
||||
(void)dst; (void)src; (void)size;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Stubs forward to the C runtime. Swap in the allocator you actually want.
|
||||
|
||||
void* PlatformMalloc( size_t size ) { return malloc( size ); }
|
||||
void PlatformFree( void* ptr ) { free( ptr ); }
|
||||
void* PlatformRealloc( void* ptr, size_t size ) { return realloc( ptr, size ); }
|
||||
|
||||
void PlatformAllocatorInit() {}
|
||||
void PlatformAllocatorThreadInit() {}
|
||||
void PlatformAllocatorFinalize() {}
|
||||
void PlatformAllocatorThreadFinalize(){}
|
||||
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
// Template platform header for unsupported targets.
|
||||
//
|
||||
// Copy into your project, fill in the sections you need, and point Tracy at
|
||||
// it via -DTRACY_PLATFORM_HEADER="\"my_platform.h\"". Provide the
|
||||
// implementations in any TU linked into your final binary (see
|
||||
// CustomPlatform.cpp).
|
||||
//
|
||||
// Use this only for the TRACY_HAS_CUSTOM_* hooks and matching Platform*
|
||||
// declarations — don't set unrelated TRACY_* options here. Some are checked
|
||||
// before this header is included, so the result would depend on which TU
|
||||
// consulted them; set those at the build system level instead.
|
||||
//
|
||||
// For platform-specific features without a custom hook (call stacks,
|
||||
// context switches, crash handling, system tracing, etc.), disable them at
|
||||
// the build system level with the matching TRACY_NO_* macro.
|
||||
|
||||
#ifndef __MY_TRACY_PLATFORM_H__
|
||||
#define __MY_TRACY_PLATFORM_H__
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace tracy
|
||||
{
|
||||
|
||||
// --- Thread id --------------------------------------------------------------
|
||||
//
|
||||
// Required if defaults in TracySystem.cpp do not matches your platform.
|
||||
// Note pthread_self() is NOT suitable, it returns a library handle, not a kernel id.
|
||||
//#define TRACY_HAS_CUSTOM_THREAD_ID
|
||||
uint32_t PlatformGetThreadId();
|
||||
|
||||
|
||||
// --- User info --------------------------------------------------------------
|
||||
//
|
||||
// Identifies the machine and user in the trace header. Return placeholder
|
||||
// strings (e.g. "(?)") from any of these if your platform has no equivalent
|
||||
// notion.
|
||||
//#define TRACY_HAS_CUSTOM_USER_INFO
|
||||
void PlatformGetHostname( char* buf, size_t size );
|
||||
const char* PlatformGetUserLogin();
|
||||
const char* PlatformGetUserFullName();
|
||||
|
||||
|
||||
// --- Safe memory copy -------------------------------------------------------
|
||||
//
|
||||
// Tracy uses this to snapshot potentially-unmapped memory during sampling.
|
||||
// Must not crash on unreadable input — return false instead. Plain memcpy()
|
||||
// is NOT a valid implementation.
|
||||
//#define TRACY_HAS_CUSTOM_SAFE_COPY
|
||||
bool PlatformSafeMemcpy( void* dst, const void* src, size_t size );
|
||||
|
||||
|
||||
// --- Allocator --------------------------------------------------------------
|
||||
//
|
||||
// Replaces Tracy's internal allocator. Drop in the system allocator, an
|
||||
// in-house one, or any third-party allocator you like. Malloc/Free/Realloc
|
||||
// must be thread-safe; ThreadInit is an optional prime, not a precondition.
|
||||
// Finalize must also tear down the calling thread's per-thread state, the
|
||||
// way rpmalloc_finalize() does — Tracy does not call ThreadFinalize for the
|
||||
// shutdown thread before Finalize.
|
||||
//#define TRACY_HAS_CUSTOM_ALLOCATOR
|
||||
void* PlatformMalloc( size_t size );
|
||||
void PlatformFree( void* ptr );
|
||||
void* PlatformRealloc( void* ptr, size_t size );
|
||||
void PlatformAllocatorInit();
|
||||
void PlatformAllocatorThreadInit();
|
||||
void PlatformAllocatorFinalize();
|
||||
void PlatformAllocatorThreadFinalize();
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,9 +1,9 @@
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <cassert>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <numeric>
|
||||
#include <math.h>
|
||||
|
||||
#include <CL/cl.h>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#define kSimdWidth 4
|
||||
|
||||
#if !defined(__arm__) && !defined(__arm64__) && !defined(__EMSCRIPTEN__) && !defined(_M_ARM64)
|
||||
#if !defined(__arm__) && !defined(__arm64__) && !defined(__EMSCRIPTEN__)
|
||||
|
||||
// ---- SSE implementation
|
||||
|
||||
@@ -141,14 +141,8 @@ VM_INLINE float hmin(float4 v)
|
||||
// Returns a 4-bit code where bit0..bit3 is X..W
|
||||
VM_INLINE unsigned mask(float4 v)
|
||||
{
|
||||
#if defined(_M_ARM64)
|
||||
static const uint32_t values[4] = { 1u, 2u, 4u, 8u };
|
||||
const uint32x4_t movemask = vld1q_u32( values );
|
||||
const uint32x4_t highbit = vdupq_n_u32( 0x80000000u );
|
||||
#else
|
||||
static const uint32x4_t movemask = { 1, 2, 4, 8 };
|
||||
static const uint32x4_t highbit = { 0x80000000, 0x80000000, 0x80000000, 0x80000000 };
|
||||
#endif
|
||||
uint32x4_t t0 = vreinterpretq_u32_f32(v.m);
|
||||
uint32x4_t t1 = vtstq_u32(t0, highbit);
|
||||
uint32x4_t t2 = vandq_u32(t1, movemask);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#if DO_FLOAT3_WITH_SIMD
|
||||
|
||||
|
||||
#if !defined(__arm__) && !defined(__arm64__) && !defined(_M_ARM64)
|
||||
#if !defined(__arm__) && !defined(__arm64__)
|
||||
|
||||
// ---- SSE implementation
|
||||
|
||||
@@ -223,14 +223,8 @@ VM_INLINE float3 cross(float3 a, float3 b)
|
||||
// Returns a 3-bit code where bit0..bit2 is X..Z
|
||||
VM_INLINE unsigned mask(float3 v)
|
||||
{
|
||||
#if defined(_M_ARM64)
|
||||
static const uint32_t values[4] = { 1u, 2u, 4u, 8u };
|
||||
const uint32x4_t movemask = vld1q_u32( values );
|
||||
const uint32x4_t highbit = vdupq_n_u32( 0x80000000u );
|
||||
#else
|
||||
static const uint32x4_t movemask = { 1, 2, 4, 8 };
|
||||
static const uint32x4_t highbit = { 0x80000000, 0x80000000, 0x80000000, 0x80000000 };
|
||||
#endif
|
||||
uint32x4_t t0 = vreinterpretq_u32_f32(v.m);
|
||||
uint32x4_t t1 = vtstq_u32(t0, highbit);
|
||||
uint32x4_t t2 = vandq_u32(t1, movemask);
|
||||
|
||||
@@ -72,11 +72,7 @@ namespace
|
||||
#if defined _M_IX86 || defined _M_X64
|
||||
#pragma intrinsic(_mm_pause)
|
||||
inline void Pause() { _mm_pause(); }
|
||||
#elif defined(_M_ARM64)
|
||||
inline void Pause() { __yield(); }
|
||||
#else
|
||||
inline void Pause() { /* No ops*/ }
|
||||
#endif
|
||||
#endif
|
||||
#elif defined __i386__ || defined __x86_64__
|
||||
inline void Pause() { __asm__ __volatile__("pause;"); }
|
||||
#else
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.18)
|
||||
project(CUDAGraphDemo LANGUAGES CXX CUDA)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CUDA_STANDARD 17)
|
||||
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24")
|
||||
set(CMAKE_CUDA_ARCHITECTURES native)
|
||||
endif()
|
||||
|
||||
set(TRACY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../.."
|
||||
CACHE PATH "Root of the Tracy repository")
|
||||
set(TRACY_PUBLIC "${TRACY_PATH}/public")
|
||||
|
||||
find_package(CUDAToolkit REQUIRED)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
# cuda-graph-demo.cu embeds Tracy via #include <TracyClient.cpp> (unity build),
|
||||
# so no separate TracyClient library is needed — just expose the public headers.
|
||||
add_executable(cuda-graph-demo cuda-graph-demo.cu)
|
||||
target_include_directories(cuda-graph-demo PRIVATE ${TRACY_PUBLIC})
|
||||
target_link_libraries(cuda-graph-demo PRIVATE
|
||||
CUDA::cupti CUDA::cuda_driver Threads::Threads ${CMAKE_DL_LIBS})
|
||||
|
||||
# ctest-related integration below
|
||||
# to run the binaries via ctest:
|
||||
# ctest --test-dir <cmake-build-dir> -R <binary-name> -C <build-config>
|
||||
|
||||
enable_testing()
|
||||
add_test(NAME cuda-graph-demo COMMAND cuda-graph-demo)
|
||||
|
||||
# On Windows, CUPTI's DLL must be on PATH at runtime.
|
||||
if(WIN32)
|
||||
set(_cupti_dir "$<TARGET_FILE_DIR:CUDA::cupti>")
|
||||
set_target_properties(cuda-graph-demo PROPERTIES
|
||||
VS_DEBUGGER_ENVIRONMENT "PATH=${_cupti_dir};$ENV{PATH}")
|
||||
set_tests_properties(cuda-graph-demo PROPERTIES
|
||||
ENVIRONMENT "PATH=${_cupti_dir};$ENV{PATH}")
|
||||
endif()
|
||||
@@ -1,11 +0,0 @@
|
||||
TRACY_PATH=<path-to-tracy>
|
||||
CUDA_TOOLKIT_PATH=/usr/local/cuda
|
||||
CUDA_CUPTI_PATH=${CUDA_TOOLKIT_PATH}/extras/CUPTI
|
||||
|
||||
# pass -v to nvcc for verbose build information
|
||||
nvcc -O2 -std=c++17 cuda-graph-demo.cu \
|
||||
-o cuda-graph-demo \
|
||||
-I "${TRACY_PATH}/public" \
|
||||
-I "${CUDA_CUPTI_PATH}/include" -I "${CUDA_TOOLKIT_PATH}/include" \
|
||||
-L "${CUDA_CUPTI_PATH}/lib64" -L "${CUDA_TOOLKIT_PATH}/lib64" \
|
||||
-lcupti -lcuda
|
||||
@@ -1,146 +0,0 @@
|
||||
#include <cuda_runtime.h>
|
||||
|
||||
// WARN: for simplicity, we enable and "embed" the Tracy client directly into the code
|
||||
#define TRACY_ENABLE
|
||||
#include <TracyClient.cpp>
|
||||
|
||||
#include <tracy/Tracy.hpp>
|
||||
#include <tracy/TracyCUDA.hpp>
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <vector>
|
||||
|
||||
#define CUDA_CHECK(call) \
|
||||
do { \
|
||||
cudaError_t err__ = (call); \
|
||||
if (err__ != cudaSuccess) { \
|
||||
std::fprintf(stderr, "CUDA error %s at %s:%d: %s\n", \
|
||||
cudaGetErrorName(err__), __FILE__, __LINE__, \
|
||||
cudaGetErrorString(err__)); \
|
||||
std::exit(EXIT_FAILURE); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
__global__ void saxpy(float a, const float* x, float* y, int n)
|
||||
{
|
||||
int i = blockIdx.x * blockDim.x + threadIdx.x;
|
||||
if (i < n) y[i] = a * x[i] + y[i];
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
// CUPTI-backed Tracy context. Auto-captures all CUDA activity from the
|
||||
// point StartProfiling() is called until StopProfiling(). The background
|
||||
// collector thread flushes activity into Tracy; the explicit Collect()
|
||||
// calls below just force a flush at known phase boundaries.
|
||||
auto* cudaCtx = TracyCUDAContext();
|
||||
{
|
||||
constexpr char ctxName[] = "CUDA Graph Demo";
|
||||
TracyCUDAContextName(cudaCtx, ctxName, sizeof(ctxName) - 1);
|
||||
}
|
||||
TracyCUDAStartProfiling(cudaCtx);
|
||||
|
||||
constexpr int N = 1 << 16; // small N => kernel is short => launch overhead dominates
|
||||
constexpr int KERNELS_PER_GRAPH = 32; // chain length captured into the graph
|
||||
constexpr int OUTER_ITERS = 2000; // how many times we replay the chain
|
||||
|
||||
// allocate device buffers
|
||||
float *dX = nullptr, *dY = nullptr;
|
||||
CUDA_CHECK(cudaMalloc(&dX, N * sizeof(float)));
|
||||
CUDA_CHECK(cudaMalloc(&dY, N * sizeof(float)));
|
||||
|
||||
std::vector<float> hX(N, 1.0f);
|
||||
CUDA_CHECK(cudaMemcpy(dX, hX.data(), N * sizeof(float), cudaMemcpyHostToDevice));
|
||||
|
||||
cudaStream_t stream = nullptr;
|
||||
CUDA_CHECK(cudaStreamCreate(&stream));
|
||||
|
||||
const dim3 block(256);
|
||||
const dim3 grid((N + block.x - 1) / block.x);
|
||||
|
||||
cudaEvent_t evStart, evStop;
|
||||
CUDA_CHECK(cudaEventCreate(&evStart));
|
||||
CUDA_CHECK(cudaEventCreate(&evStop));
|
||||
|
||||
// warm-up (so first-launch lazy-init and/or JIT doesn't bias the measurement)
|
||||
saxpy<<<grid, block, 0, stream>>>(0.0f, dX, dY, N);
|
||||
CUDA_CHECK(cudaStreamSynchronize(stream));
|
||||
|
||||
// baseline: launch each kernel directly on the stream
|
||||
float msStream = 0.0f;
|
||||
{
|
||||
ZoneScopedN("stream-launches");
|
||||
CUDA_CHECK(cudaMemsetAsync(dY, 0, N * sizeof(float), stream));
|
||||
CUDA_CHECK(cudaEventRecord(evStart, stream));
|
||||
for (int outer = 0; outer < OUTER_ITERS; ++outer) {
|
||||
for (int k = 0; k < KERNELS_PER_GRAPH; ++k) {
|
||||
saxpy<<<grid, block, 0, stream>>>(1.0e-6f, dX, dY, N);
|
||||
}
|
||||
}
|
||||
CUDA_CHECK(cudaEventRecord(evStop, stream));
|
||||
CUDA_CHECK(cudaEventSynchronize(evStop));
|
||||
CUDA_CHECK(cudaEventElapsedTime(&msStream, evStart, evStop));
|
||||
TracyCUDACollect(cudaCtx);
|
||||
}
|
||||
|
||||
// capture: record the same kernel chain into a graph
|
||||
cudaGraph_t graph = nullptr;
|
||||
cudaGraphExec_t graphExec = nullptr;
|
||||
{
|
||||
ZoneScopedN("graph-capture");
|
||||
// cudaStreamCaptureModeRelaxed allows the calling thread to perform
|
||||
// unrelated CUDA work during capture; ThreadLocal is stricter if you need
|
||||
// isolation. Most short, single-stream captures work fine in either mode.
|
||||
CUDA_CHECK(cudaStreamBeginCapture(stream, cudaStreamCaptureModeRelaxed));
|
||||
for (int k = 0; k < KERNELS_PER_GRAPH; ++k) {
|
||||
saxpy<<<grid, block, 0, stream>>>(1.0e-6f, dX, dY, N);
|
||||
}
|
||||
CUDA_CHECK(cudaStreamEndCapture(stream, &graph));
|
||||
|
||||
// Instantiate once -> reusable executable graph.
|
||||
CUDA_CHECK(cudaGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0));
|
||||
|
||||
// The template graph isn't needed once instantiated.
|
||||
CUDA_CHECK(cudaGraphDestroy(graph));
|
||||
}
|
||||
|
||||
// replay: launch the instantiated graph OUTER_ITERS times
|
||||
float msGraph = 0.0f;
|
||||
{
|
||||
ZoneScopedN("graph-launches");
|
||||
CUDA_CHECK(cudaMemsetAsync(dY, 0, N * sizeof(float), stream));
|
||||
CUDA_CHECK(cudaEventRecord(evStart, stream));
|
||||
for (int outer = 0; outer < OUTER_ITERS; ++outer) {
|
||||
CUDA_CHECK(cudaGraphLaunch(graphExec, stream));
|
||||
}
|
||||
CUDA_CHECK(cudaEventRecord(evStop, stream));
|
||||
CUDA_CHECK(cudaEventSynchronize(evStop));
|
||||
CUDA_CHECK(cudaEventElapsedTime(&msGraph, evStart, evStop));
|
||||
TracyCUDACollect(cudaCtx);
|
||||
}
|
||||
|
||||
// sanity check: y[i] = OUTER_ITERS * KERNELS_PER_GRAPH * 1e-6 * x[i]
|
||||
std::vector<float> hY(N);
|
||||
CUDA_CHECK(cudaMemcpy(hY.data(), dY, N * sizeof(float), cudaMemcpyDeviceToHost));
|
||||
const float expected = float(OUTER_ITERS) * float(KERNELS_PER_GRAPH) * 1.0e-6f;
|
||||
|
||||
std::printf("Stream launches: %8.3f ms (%d kernels)\n",
|
||||
msStream, OUTER_ITERS * KERNELS_PER_GRAPH);
|
||||
std::printf("Graph launches: %8.3f ms (%d graph launches x %d kernels)\n",
|
||||
msGraph, OUTER_ITERS, KERNELS_PER_GRAPH);
|
||||
std::printf("Speedup : %8.2fx\n", msStream / msGraph);
|
||||
std::printf("hY[0] = %.6e (expected %.6e)\n", hY[0], expected);
|
||||
|
||||
// shutdown
|
||||
CUDA_CHECK(cudaGraphExecDestroy(graphExec));
|
||||
CUDA_CHECK(cudaEventDestroy(evStart));
|
||||
CUDA_CHECK(cudaEventDestroy(evStop));
|
||||
CUDA_CHECK(cudaStreamDestroy(stream));
|
||||
CUDA_CHECK(cudaFree(dX));
|
||||
CUDA_CHECK(cudaFree(dY));
|
||||
|
||||
TracyCUDAStopProfiling(cudaCtx);
|
||||
TracyCUDAContextDestroy(cudaCtx);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.29)
|
||||
project(dyna LANGUAGES C CXX)
|
||||
|
||||
option(TRACY_ENABLE "Enable Tracy" ON)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
set(CMAKE_COLOR_DIAGNOSTICS ON)
|
||||
|
||||
include(cmake/CPM.cmake)
|
||||
|
||||
if(TRACY_ENABLE)
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
||||
add_compile_options(-fno-omit-frame-pointer)
|
||||
else()
|
||||
message(WARNING "Tracy builds should be RelWithDebInfo!")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
CPMAddPackage(
|
||||
NAME glad
|
||||
VERSION 2.0.8
|
||||
GIT_REPOSITORY https://github.com/Dav1dde/glad.git
|
||||
GIT_TAG v2.0.8
|
||||
)
|
||||
|
||||
add_subdirectory(${glad_SOURCE_DIR}/cmake ${CMAKE_CURRENT_BINARY_DIR}/glad)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../.. client/)
|
||||
|
||||
glad_add_library(glad_gl_core_33 STATIC API gl:core=3.3)
|
||||
|
||||
find_package(SDL3 REQUIRED)
|
||||
find_package(SDL3_image REQUIRED)
|
||||
|
||||
add_executable(dyna
|
||||
src/main.cpp
|
||||
src/datapath.cpp
|
||||
src/timer.cpp
|
||||
src/gfx.cpp
|
||||
src/texture.cpp
|
||||
src/entity.cpp
|
||||
src/world.cpp
|
||||
src/map.cpp
|
||||
src/player.cpp
|
||||
src/monster.cpp
|
||||
src/bomb.cpp
|
||||
src/bonus.cpp
|
||||
src/game.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(dyna
|
||||
PRIVATE
|
||||
glad_gl_core_33
|
||||
SDL3::SDL3
|
||||
SDL3_image::SDL3_image
|
||||
Tracy::TracyClient
|
||||
)
|
||||
|
||||
target_include_directories(dyna PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||
|
||||
# Mirror the data/ tree next to the executable so the game finds its assets
|
||||
# when launched from the build directory (paths are resolved via SDL_GetBasePath).
|
||||
add_custom_command(TARGET dyna POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/data
|
||||
$<TARGET_FILE_DIR:dyna>/data
|
||||
COMMENT "Copying data/ next to dyna executable"
|
||||
)
|
||||
|
||||
file(GENERATE OUTPUT .gitignore CONTENT "*")
|
||||
@@ -1,7 +0,0 @@
|
||||
Dyna.net copyright 2005 by Bartosz Taudul and Ralf Wrześniewski.
|
||||
|
||||
This program (including source code and the asset it uses) is NOT licensed
|
||||
for any use other than being an example of how to integrate Tracy Profiler.
|
||||
|
||||
The license terms written in other parts of this repository DO NOT apply
|
||||
here.
|
||||
@@ -1,24 +0,0 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors
|
||||
|
||||
set(CPM_DOWNLOAD_VERSION 0.43.1)
|
||||
set(CPM_HASH_SUM "1c40fc102ce9625d7de7eb14f541cab30cc3138dca627f0b0ec40293ce6c2934")
|
||||
|
||||
if(CPM_SOURCE_CACHE)
|
||||
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
|
||||
elseif(DEFINED ENV{CPM_SOURCE_CACHE})
|
||||
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
|
||||
else()
|
||||
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
|
||||
endif()
|
||||
|
||||
# Expand relative path. This is important if the provided path contains a tilde (~)
|
||||
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)
|
||||
|
||||
file(DOWNLOAD
|
||||
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
|
||||
${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM}
|
||||
)
|
||||
|
||||
include(${CPM_DOWNLOAD_LOCATION})
|
||||
|
Before Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 93 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 768 B |
|
Before Width: | Height: | Size: 144 KiB |
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 54 KiB |