4 ms·
Their ring logger was really enlightening to me about the value of Rust enums. Heterogeneous log events are dropped into the ring with some holding only the fac
by jeffrallen 3y ago
Their ring logger was really enlightening to me about the value of Rust enums. Heterogeneous log events are dropped into the ring with some holding only the fact that something happened, and others holding additional data about what happened. Then Humility is able to print out the contents of the ring either online or in crash dumps. This is how you get logging in nostdlib Rust without ending up without half of a badly implemented printf. Instead, Humility, which has the full stdlib available, formats the enums for the firmware.
- vlovich123 3y agoLink?
- mkeeter 3y agoThe embedded side is here: https://github.com/oxidecomputer/hubris/blob/master/lib/ringbuf/src/lib.rs https://github.com/oxidecomputer/hubris/blob/master/lib/ring... And the debugger is here: https://github.com/oxidecomputer/humility/blob/master/cmd/ringbuf/src/lib.rs https://github.com/oxidecomputer/humility/blob/master/cmd/ri... I also gave a talk at this year's Open Source Firmware Conference that covers a bunch of debug strategies: https://www.osfc.io/2023/talks/unplugging-the-debugger-live-and-post-mortem-debugging-in-a-remote-system/ https://www.osfc.io/2023/talks/unplugging-the-debugger-live-... (conference videos aren't online yet, but should be posted early next week)