Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
The existing GPUVis backend isn't suitable for live-profiling and carries heavy overhead per traced event (a memory allocation and a system call). This makes gathering accurate data for quantitative analysis impossible.
This PR adds a new backend for FEX's profiler interface based on Tracy, a nanosecond resolution profiler with support for live tracing and a rich feature set. Notably, statistics and histograms are generated from profiled zones out-of-the-box.
To use this backend, one of the environment variables
FEX_PROFILE_TARGET_NAME
or
FEX_PROFILE_TARGET_PATH
must be defined to select the application underprofile by name or by path suffix.
Here's an example screenshot of the profiler view while running God of War (a very JIT-time heavy title). I'll post more screenshots as comments below.
Usage
ENABLE_FEXCORE_PROFILER=ON
andFEXCORE_PROFILER_BACKEND=tracy
External/tracy/profiler
using CMake and run usingtracy-profiler -a ::
FEX_PROFILE_TARGET_NAME=Celeste.bin.x86_64
(matches app name) orFEX_PROFILE_TARGET_PATH=amd64/SuperMeatBoy
(matches a path suffix)Future work
Plotting data
Tracy supports plotting data and creating pretty graphs out of it, which is easy to implement but will need new Profiler interfaces.
Frame markers
Integration with GL/Vulkan library forwarding allows us to detect where frames end, which is useful to recognize stuttering in a recorded profile.