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

Shuttle Explorer #163

Merged
merged 3 commits into from
Sep 30, 2024
Merged

Shuttle Explorer #163

merged 3 commits into from
Sep 30, 2024

Conversation

Aurel300
Copy link
Contributor

@Aurel300 Aurel300 commented Sep 23, 2024

Added mechanism to emit annotated schedules from Shuttle. Added VS Code extension "Shuttle Explorer" to visualise such annotated schedules.

  • cfg flag to disable annotations completely (to avoid performance cost of checking a thread-local repeatedly)
  • document and clean up extension

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Aurel300 Aurel300 force-pushed the feature/shuttle-explorer branch 2 times, most recently from 3c483db to 0ee5e79 Compare September 26, 2024 22:52
src/lib.rs Outdated Show resolved Hide resolved
src/scheduler/annotation.rs Outdated Show resolved Hide resolved
src/annotations/mod.rs Show resolved Hide resolved
src/annotations/mod.rs Outdated Show resolved Hide resolved
src/annotations/mod.rs Outdated Show resolved Hide resolved

let task_id_num = usize::from(task_id);
assert!(task_id_num < state.tasks.len());
state.tasks[task_id_num].first_step = state.tasks[task_id_num].first_step.min(state.events.len());
Copy link
Member

Choose a reason for hiding this comment

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

We only have to do this once, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This min will only do something once, yes. However, it should be the first step of this task, not its creator, so we can't do it when the task is created (because its first step will either be later, or it might even never take a step).

state.tasks[task_id_num].last_step = state.tasks[task_id_num].last_step.max(state.events.len());

use std::backtrace::Backtrace;
let bt = Backtrace::capture(); // TODO: config to disable
Copy link
Member

Choose a reason for hiding this comment

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

This does seem quite expensive (to compute at least). We should fast-follow with an option to disable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The option to disable is to disable backtraces. If we want this to be configurable separately from RUST_BACKTRACE, we can use force_capture and our own flag. I added a comment.

src/annotations/mod.rs Outdated Show resolved Hide resolved
src/annotations/mod.rs Outdated Show resolved Hide resolved
@Aurel300 Aurel300 force-pushed the feature/shuttle-explorer branch 2 times, most recently from 7d5f4bd to 4df00ca Compare September 27, 2024 16:00
jorajeev
jorajeev previously approved these changes Sep 27, 2024
Cargo.toml Outdated Show resolved Hide resolved
shuttle-explorer/README.md Show resolved Hide resolved
shuttle-explorer/README.md Show resolved Hide resolved
{
usize::from(*self).serialize(serializer)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit-ish:

Should all the serde stuff be moved somewhere else and put behind a feature flag "serde" (and "annotation" would enable "serde" as well)? It doesn't belong here and it also might be useful for other stuff to have a way to get serde for the types.

src/annotations/mod.rs Outdated Show resolved Hide resolved
src/annotations/mod.rs Show resolved Hide resolved
src/scheduler/annotation.rs Outdated Show resolved Hide resolved
src/sync/mutex.rs Show resolved Hide resolved
@sarsko sarsko merged commit e82b18d into awslabs:main Sep 30, 2024
5 checks passed
@Aurel300 Aurel300 deleted the feature/shuttle-explorer branch October 1, 2024 07:10
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.

3 participants