-
Notifications
You must be signed in to change notification settings - Fork 37
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
Shuttle Explorer #163
Conversation
3c483db
to
0ee5e79
Compare
|
||
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()); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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).
src/annotations/mod.rs
Outdated
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
7d5f4bd
to
4df00ca
Compare
{ | ||
usize::from(*self).serialize(serializer) | ||
} | ||
} |
There was a problem hiding this comment.
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.
4df00ca
to
9a5f91d
Compare
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)By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.