trace_region on Android and Windows#58
Open
ryantrem wants to merge 7 commits intomicrosoft:masterfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request implements platform-specific
trace_regionclasses for Android and Windows, providing cross-platform tracing support for performance analysis. Each implementation uses the native tracing APIs on its platform (Android NDK ATrace, Apple os_signpost, Windows ETW TraceLogging) and ensures that trace regions can be correlated across threads and viewed in their respective profiling tools. The changes also improve move semantics, logging, and runtime feature detection.Platform-specific tracing implementations:
Source/Android/arcana/tracing/trace_region.h):trace_regionusing the NDK ATrace async API, supporting cross-thread trace regions and runtime detection of async tracing support for devices below API 29. Logging to logcat is enabled at thelogtrace level. [1] [2]Apple (
Source/Apple/arcana/tracing/trace_region.h):trace_regionusing os_signpost, with detailed instructions for capturing and viewing traces in Instruments. Supports cross-thread correlation using uniqueos_signpost_id_t.Windows (
Source/Windows/arcana/tracing/trace_region.h):trace_regionusing ETW TraceLogging, emitting activity start/stop pairs with unique GUIDs for cross-thread correlation. Provides instructions for capturing and analyzing traces with WPA or PerfView. Debug logging is sent to OutputDebugStringA.Improvements to trace_region API and semantics:
trace_region, ensuring safe transfer of region ownership without emitting duplicate end events. [1] [2]std::stringto ensure correct lifetime and matching for begin/end events across threads. [1] [2]Runtime and logging enhancements:
dlsymfor compatibility with older devices.These changes provide robust, cross-platform tracing primitives that integrate with each platform's native profiling tools, improving the ability to analyze and debug performance issues.