Closed talex5 closed 7 months ago
Using a prototype visualiser, this is what examples/net
looks like with these events:
are the green zones representing times where a fiber is actually running?
Yes, that's right.
That's fairly cool, I don't think I've seen that in any "classic" trace visualizer (perfetto, tracy, etc.). It means you emit a lot of events though, don't you?
We only switch fibers when a fiber suspends, and we need to log why it's suspending anyway, so it's not a lot more events.
This adds tracing of cancellation contexts and OS operations, and documents and cleans up the API a bit.
When reading events, instead of the consumer providing one function per event, we now use a single function taking a variant. This makes the API easier to use and lets the caller decide whether they want to handle all events (checked by the compiler) or just some of them.
Note: eio_posix yields before each operation to avoid starvation. However, if it needed to block then it did another yield afterwards when retrying, which isn't necessary and clutters up the traces. This commit also removes that.
(based on #554)