oxidecomputer / oxidecomputer/hubris
Developer-visible task state readout
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.6k
- Forks
- 239
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 23
Description
It would be nice to have a way for tasks to append some sort information to the output of humility tasks. For instance, to indicate that the network link managed by a task is up. This could remove a lot of squinting at ringbuffers/readvar.
My sketch of a design:
- Extend the debugger-to-task DBI with a new symbol, something like
HUMILITY_TASK_STATUS. - Tasks can declare this symbol at top level (
static no_mangle). - Any value stored in such a global variable will be read out by Humility and printed using the standard DWARF pretty-printing mechanism.
So, to continue the network stack example, one could do this:
struct NetStatus {
link: LinkState,
mac: [u8; 6],
}
enum LinkState { Up, Down, Confused }
#[no_mangle]
static HUMILITY_TASK_STATUS: StaticCell<NetStatus> = StaticCell::new(NetStatus {
link: LinkState::Down,
mac: [0xFF; 6],
});
...and then subsequently update it:
HUMILITY_TASK_STATUS.borrow_mut().mac = generated_mac;
and then over in Humility we'd extend the task status output, maybe only on request, to be something like
11 net 339 2 wait: send to gimlet_seq/gen19 NetStatus { link: Up, mac: [1, 2, 3, 4, 5, 6] }
@mkeeter and I were talking about this recently, and I believe I've previously run it by @bcantrill.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the debugger-to-task DBI and the existing Humility task status output. Determine how a HUMILITY_TASK_STATUS symbol could be declared by Rust tasks and read through DWARF pretty-printing. Done means task status output can include the declared value, such as the NetStatus example, without requiring ringbuffers or readvar.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- embedded-iot
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100