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.
The primary function of this PR is to add support for dynamic markers to the trace event profiler plugin. These are "Profiler.Default" markers where the actual name and category are passed as metadata and are typically emitted by APIs where the marker name is specified at runtime such as
Profiler.BeginSample().
There are a number of other changes in this PR, each of which has been entered as a separate commit so they can be cherry picked if not all are desired:
Visual Studio project file updates:
Fixed issue where maximum memory for capture couldn't be set higher than 2 GiB due to use of 32bit int in calculations. uint64_t is now used to support larger buffer sizes.
Fixed issue where the current total memory usage value wasn't being decreased when event blocks were being freed resulting in it increasing constantly and captures being aborted incorrectly if it passed the upper memory use limit after multiple captures despite memory being deallocated
Fixed issue where timestamps in events were being truncated to 32bit (signed) so any capture longer than 35 minutes was having it's timestamps wrapped round causing issues.
Added a memory barrier before writing the trace file to ensure all event data written by capturing threads is visible to the writing thread. This is a speculative change as I haven't observed any issues with memory visibility but I added it while tracking other issues down and thought leaving it in there couldn't hurt.