Commit Graph

136 Commits

Author SHA1 Message Date
Bartosz Taudul
da5c8153bc Disable capture-daemon directory lock on windows. 2026-09-06 01:48:06 +02:00
Bartosz Taudul
d288c38c98 Add a per-directory lock file to the capture daemon.
Only one daemon can write to a given output directory at a time. The
lock holds the daemon PID and is removed on a clean exit; a lock whose
owner is verifiably gone is taken over on the next start, and a lock
whose owner cannot be read or that reads as alive must be removed by
hand.
2026-09-06 01:07:47 +02:00
Bartosz Taudul
4cbec36af6 Remove undefined source list variables from the capture build. 2026-09-06 01:07:46 +02:00
Bartosz Taudul
db6a46cf3e Extract shared capture-side tool code into TracyUtil. 2026-09-06 01:07:46 +02:00
Bartosz Taudul
ebf5ebd9bd Replace the output file safely in tracy-capture.
The old pre-flight truncated the output at startup with -f, so an
interrupted capture lost the trace, and the probe fopen followed a
symlink. The existing file is now moved to FILE~ for the duration of
the capture and restored if the trace cannot be written.
2026-09-06 01:07:45 +02:00
Bartosz Taudul
89f12318a1 Fix empty rate sample list read in the daemon stats. 2026-09-06 01:07:45 +02:00
Bartosz Taudul
fa4336dd26 Fix empty rate sample list read in the progress line.
HasData() flips when the connection is established, but the rate
list is only filled by the worker periodic stats update, whose first
entry arrives ~200ms later, so the first render could read an empty
list.
2026-09-06 01:07:45 +02:00
Bartosz Taudul
a7926283a8 Wait for capture workers to disconnect before saving. 2026-08-09 18:32:17 +02:00
Bartosz Taudul
69fead1c16 Add CMake presets for the rest of utils. 2026-07-07 01:43:43 +02:00
Bartosz Taudul
5877db5411 Move NO_ISA_EXTENSIONS option to config.cmake. 2026-03-31 23:15:14 +02:00
Bartosz Taudul
eb81bdc3f8 NO_STATISTICS is not an option in most of the tools. 2026-03-31 23:15:14 +02:00
Bartosz Taudul
fddbb5d990 Print tracy version in all tools. 2026-03-28 21:38:47 +01:00
Bartosz Taudul
53fa2ba67b Fix includes. 2026-03-02 23:58:16 +01:00
Bartosz Taudul
80c849a2aa Fix client identification in tracy-capture-daemon
Use '<pid>_<ip>_<port>' string as client ID instead of IP+port hash.
This allows:
- Same program restarting (new PID) to be recognized as new client
- Multiple instances of same program (different PIDs) to capture separately
2026-03-02 23:00:42 +01:00
Bartosz Taudul
e6aae0c18e Add tracy-capture-daemon for multi-client capture
A discovery-and-capture daemon that listens for UDP broadcasts from
Tracy clients, automatically connects to discovered clients, and
captures each to a separate file.

Features:
- Continuous discovery until Ctrl+C
- Per-client capture threads
- Terminal display with per-client stats
- Output files named: <program>_<ip>_<port>.tracy
- Collision handling with _1, _2 suffix
- Graceful shutdown on signal

Based on the multicapture design by Grégoire Roussel, but simplified
to output separate files instead of merging (use tracy-merge for that).

Co-authored-by: Grégoire Roussel <gregoire.roussel@wandercraft.eu>
2026-03-02 22:32:45 +01:00
Bartosz Taudul
03f01b9c49 Include fixes. 2026-03-02 21:34:35 +01:00
Bartosz Taudul
2341dee04a Refactor capture utilities into CaptureOutput
Extract common output functions from capture.cpp into a proper library:

- InitTerminalDetection()/IsTerminal() - terminal detection
- AnsiPrintf() - printf with ANSI escape codes
- WaitForConnection() - blocks until connected, returns error code
- PrintCaptureProgress() - prints throughput/memory/time stats
- PrintWorkerFailure() - prints failure details with callstack

Functions are declared in CaptureOutput.hpp and implemented in
CaptureOutput.cpp. Both tracy-capture and future tools can share
this code.

Co-authored-by: Grégoire Roussel <gregoire.roussel@wandercraft.eu>
2026-03-02 21:28:22 +01:00
Jakub Konka
e5646b1f6a capture: Display current query backlog 2026-01-23 15:26:07 +01:00
Bartosz Taudul
880c600506 Remove queue delay calibration.
This value is not used for anything, it was just a number displayed in
the UI without much meaning to anyone.

Operations on the queue during early init may not work correctly, stopping
some programs from running past the calibration loop.
2025-07-11 23:23:31 +02:00
Marco Treglia
ad61037925 Add install target for binaries in capture and csvexport 2025-02-19 09:41:32 +01:00
Bartosz Taudul
1c1faeff2d Replace parallel STL with PPQSort.
PPQSort is supposedly quite fast: https://github.com/GabTux/PPQSort

More importantly, it does not depend on TBB fuckery, so there's no longer
a need to link with an external library that people may or may not have.

The NO_PARALLEL_STL option is out, as it was provided solely to deal with
TBB being not available. Sequential sorting is still used on emscripten.
2024-09-26 14:41:59 +02:00
Bartosz Taudul
a636950eb5 Fix wrong printf. 2024-07-17 17:55:19 +02:00
Bartosz Taudul
d9fe3ed9a6 Add CMake option to not use parallel STL. 2024-06-08 00:20:12 +02:00
Bartosz Taudul
455738a266 Default to zstd level 3 with 4 streams in tracy-capture. 2024-06-02 15:35:07 +02:00
Bartosz Taudul
5730884678 Print memory limit in capture utility, if appropriate. 2024-05-05 21:21:19 +02:00
Bartosz Taudul
c31bf6f7f8 Add blue ANSI color macro. 2024-05-05 21:21:19 +02:00
Bartosz Taudul
ee56e1fcd5 Allow setting memory limit in capture utility. 2024-05-05 21:21:19 +02:00
Bartosz Taudul
6748d11a2f Fix capture utility. 2024-05-05 21:12:50 +02:00
Bartosz Taudul
377e41fe61 Make memUsage an atomic. 2024-05-04 14:28:55 +02:00
Bartosz Taudul
a1a7e63d93 Disable assembly in zstd. 2024-04-30 13:44:07 +02:00
Lectem
2530dceac4 CMake: Selecte executable project as startup project for VS 2024-04-14 18:13:51 +02:00
Lectem
a577a86b5c CMake: ASM should be listed last in project() so that it can use the C/C++ compiler executable as assembler
From the project() CMake documentation:
> If enabling ASM, list it last so that CMake can check whether compilers for other languages like C work for assembly too.
2024-04-14 18:13:17 +02:00
Bartosz Taudul
7f8a2e2c9a Remove old build files. 2024-03-21 23:04:40 +01:00
Bartosz Taudul
148eac2c24 Link with getopt. 2024-03-21 23:04:39 +01:00
Bartosz Taudul
4bfd6f42bc Add CMake build files for the rest of the utilites. 2024-03-21 23:04:39 +01:00
Bartosz Taudul
eca841dfe3 Properly call make from within makefiles. 2023-05-23 22:42:53 +02:00
Bartosz Taudul
dbcffb8c4f Print active time in the capture utility. 2023-03-03 22:51:04 +01:00
Che-Yu Wu
ceb474e072 Wait on HasData condition to avoid infinite loop.
Tracy worker resets the IsConnected to false when finishing the
capture. If it finishes too quick, the waiting loop in capture.cpp
might never see IsConnected = true.
2023-01-25 11:23:04 +00:00
Bartosz Taudul
7eba104e12 Sleep in capture when waiting for connection. 2022-10-19 22:00:40 +02:00
Bartosz Taudul
73fe208b97 Remove unused variable. 2022-09-29 21:02:05 +02:00
Bartosz Taudul
06c7984a16 Move all client headers and sources to public/ directory. 2022-07-17 15:47:38 +02:00
MACHIZAUD Andréa
84319911c5 Use $(ProjectDir) for vcpkg msbuild without integration paths. 2022-06-18 17:28:56 +02:00
MACHIZAUD Andréa
5e9b007e90 Uses $(VcpkgManifestRoot) for vcpkg msbuild integration paths. 2022-06-18 17:28:56 +02:00
MACHIZAUD Andréa
6aec95e739 Fix vcxproj support without vcpkg integrate install 2022-06-13 22:30:56 +02:00
Bartosz Taudul
411b3137b5 Merge pull request #365 from theblackunknown/msvc+vcpkg-manifest
Using vcpkg manifest for Windows
2022-06-04 16:44:27 +02:00
MACHIZAUD Andréa
fa8bcdfb30 Inject appropriate path for manifest install 2022-06-04 16:26:22 +02:00
Graydon Hoare
0d4a4f6d9b Support TRACY_NO_LTO build flag. 2022-05-19 23:40:27 -07:00
MACHIZAUD Andréa
599098912e Remove superfluous vcxproj setup thanks to vcpkg integration 2022-05-09 10:42:11 +02:00
MACHIZAUD Andréa
3adc55d66d Fix weird path ? 2022-05-09 10:42:11 +02:00
MACHIZAUD Andréa
1fabf9dfa5 Update vcxproj vcpkg path 2022-05-09 10:42:11 +02:00