Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

native_layer: Add support for creating async task tracks #18

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

dflemstr
Copy link
Collaborator

This is valuable when having a lot of async/concurrent operations. By emitting tracks for async tasks, we can correlate spans emitted from that same task in that they preserve some parent/child semantics. To have the Perfetto UI not break completely, these tracks all have to have the same name so that they are collapsed in the UI.

@@ -66,7 +73,7 @@ impl SequenceId {
#[cfg(feature = "tokio")]
pub fn for_task(id: task::Id) -> SequenceId {
let mut h = hash::DefaultHasher::new();
(TRACK_UUID_NS, TASK_NS, id).hash(&mut h);
(SEQUENCE_ID_NS, TASK_NS, id).hash(&mut h);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accidental typo in a previous PR, but shouldn't have mattered too much as SequenceId and TrackUuid are already in separate namespaces.

@dflemstr dflemstr force-pushed the dflemstr/create-async-tracks branch from 5225b86 to 7677a0a Compare November 22, 2024 12:19
target_os = "android",
target_os = "emscripten",
target_os = "fuchsia"
))]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Started getting annoying deprecation warnings for these so might as well fix them while passing through

@dflemstr dflemstr merged commit a63c75f into main Nov 22, 2024
5 checks passed
@dflemstr dflemstr deleted the dflemstr/create-async-tracks branch November 22, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants