Many of the zones would have a negative running time due to a missing `cs->IsEndValid()` check. This could end reporting context switches before the zone start, due to `cs->End()` returning -1. This happened when systrace dropped event, or when using Fibers and `TracyFiberEnter` is called on the new thread once the fiber has been scheduled. (The manual actually does not really hint this is wrong, we should probably fix the manual or the server code.) In both cases, we assume runtime to be 0 for that context switch. Since we have no actual information. Both options (counting full runtime or no runtime) are wrong, and most of the code handling `!cs->IsEndValid()` uses `Start` instead so that's what I did. This is still a net improvement over displaying negative values. If we want to change this handling, we'd need to review the other places that do `it->IsEndValid() ? it->End() : it->Start()` as well. It also seems two different concepts were being mixed: 1. Do we have any context switch data at all ? (`it != ctx->v.end()` ie `count != 0`) 2. Do we have complete data for the last context switch (`eit != ctx->v.end()`) This led to some places of the code not displaying or counting running time at all, notably when hovering a zone. I think most of the time we wanted 1, as it reports correctly and assumes the last context switch is still running, which is a fair assumption if we didn't see one putting the thread to sleep. I also fixed a case where we were overcounting runtime when range start was during a sleep.
Tracy Profiler
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, Zig, C#, OCaml, Odin, etc.), GPU (All major graphic APIs: OpenGL, Vulkan, Direct3D 11/12, Metal, OpenCL, CUDA.), memory allocations, locks, context switches, automatically attribute screenshots to captured frames, and much more.
- Documentation for usage and build process instructions
- Releases containing the documentation (
tracy.pdf) and compiled Windows x64 binaries (Tracy-<version>.7z) as assets - Changelog
- Interactive demo
An Introduction to Tracy Profiler in C++ - Marcos Slomp - CppCon 2023
Introduction to Tracy Profiler v0.2
New features in Tracy Profiler v0.3
New features in Tracy Profiler v0.4
New features in Tracy Profiler v0.5
New features in Tracy Profiler v0.6
New features in Tracy Profiler v0.7
New features in Tracy Profiler v0.8



