[XPTI][SYCL] Add APIs to control stream detail level#21680
Draft
againull wants to merge 5 commits intointel:syclfrom
Draft
[XPTI][SYCL] Add APIs to control stream detail level#21680againull wants to merge 5 commits intointel:syclfrom
againull wants to merge 5 commits intointel:syclfrom
Conversation
Implement optional subscriber lifecycle callbacks that are invoked once per subscriber instance (when loaded/unloaded), distinct from the per-stream xptiTraceInit/xptiTraceFinish callbacks. Changes: - Add xpti_subscriber_handle_t opaque handle type - Add xptiSubscriberInit(handle) called when subscriber is loaded - Add xptiSubscriberFinish(handle) called when subscriber is unloaded - Update framework to invoke callbacks if present - Add example implementations to basic_collector - Update documentation with usage information These callbacks are optional and backward compatible with existing subscribers that do not implement them.
This commit introduces two new APIs that allow subscribers to request different levels of optional data emission from producers on a per-stream basis: - xptiSetSubscriberStreamDetailLevel: Subscribers set their desired detail level for a specific stream - xptiGetEffectiveStreamDetailLevel: Producers query the effective detail level to determine what optional data to emit Key features: - Four ordered detail levels: NONE, BASIC, NORMAL (default), VERBOSE - Aggregation rule: effective level is the maximum across all subscribers - Lock-free atomic reads for the get API (optimized for hot path) - Recalculation only on set (cold path during initialization) - Backward compatible: defaults to NORMAL level Implementation details: - Uses fixed-size atomic array indexed by stream_id for O(1) lock-free reads - Effective levels cached per stream and updated only when subscribers change their requests - Comprehensive documentation in XPTI_Framework.md with usage examples
Apply stream detail level control to SYCL RT while preserving full backward compatibility with existing sycl.debug stream subscribers. Changes: - Use dual-path checks (Level >= VERBOSE || isDebugStream()) for verbose metadata emission in commands.cpp and queue_impl.cpp - This ensures verbose metadata is emitted when either: * A subscriber requests VERBOSE on sycl stream (new approach), OR * A subscriber registers for sycl.debug stream (old approach) - Update documentation to describe detail level control feature - Add metadata table showing which detail level provides each field Backward compatibility: - Existing tools using sycl.debug continue to work unchanged - New tools can request BASIC level for minimal overhead (PTI use case) - Both approaches can coexist during migration period
4c335c6 to
ac9c6bc
Compare
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.
Uh oh!
There was an error while loading. Please reload this page.