Open noahfalk opened 2 years ago
Tagging subscribers to this area: @dotnet/area-system-io See info in area-owners.md if you want to be subscribed.
Author: | noahfalk |
---|---|
Assignees: | - |
Labels: | `enhancement`, `area-System.IO` |
Milestone: | - |
I am very supportive of this idea. 👍
or how we'd visualize it.
If we are able to connect the event with a CPU sample (by for example using the stack trace), we could extend the current speedscope exporter logic and emit OPEN/CLOSE events for the IO events as if they were just another method on the call stack.
Example:
void M()
{
File.WriteAllText("test.txt", "test");
}
Currently:
Open M
Open File.WriteAllText
Close File.WriteAllText
Close M
After:
Open M
Open File.WriteAllText
Open FILE_WRITE
Close FILE_WRITE
Close File.WriteAllText
Close M
For Chromium, we could do the same and assign a new category to it, so perhaps it would get different color that typical CPU work.
It would be nice if we logged EventSource events when starting/finishing file IO operations so that profilers could understand where execution is IO bound rather than CPU bound. ETW provides events in a windows-specific context but doing it via EventSource would let us collect similar data using EventPipe as a uniform xplat tracing option. I haven't dived into the details of figuring out what the exact events should be or how we'd visualize it. This issue is just to track the idea.