-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Conversation
Instead of just showing the state number it would be good to show a textual representation with the number in parenthesis (I know they map to arbitrary code but it's better to show that and it's helpful for the terminal states as well). |
Decoding the Task flags would also be amazing: 000002494aa455e0 00007ffe5a0db4b0 72 [02000400] System.Threading.Tasks.UnwrapPromise`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib]] |
You're referring to the async method state? Can you give me an example of what you mean by textual representation? Do you mean actually pull the relevant line of code out of the source file based on the PDB? I'm not planning to do that, but I'd welcome a PR from you that did :) |
Yeah... I actually experimented with that, but I lacked a particularly good representation for it, at least in the single-line case, e.g. the
example becomes something like:
which is long and throws off the column alignment. Suggestion? |
I guess there are only 2 states: Waiting (number)
Maybe we only show the flags that matter to people and the internal flags stay hidden. We can use a single character for each of the states and show that? What are the relevant states? WaitingForActivation, Completed, Cancelled, what else? |
There are three:
The -2 case won't show up by default, since it's filtering out completed objects and you'd need to explicitly bring them back in with the That just leaves -1 vs >= 0, and I don't think it's worth adding a bunch of "Waiting" into the output to differentiate the -1 from the >= 0 case. |
It does look nicer than seeing a bunch of numbers though. |
By default if it's showing up in the list, it's not in a completed state (meaning it's not yet transitioned to any of the RanToCompletion/Faulted/Canceled final states)... if it were, we'd have filtered it out. The list of states are the combination of: coreclr/src/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs Lines 171 to 186 in 2c2cab3
and coreclr/src/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs Lines 6243 to 6287 in 2c2cab3
and coreclr/src/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs Lines 6294 to 6319 in 2c2cab3
|
But you're not asking for the numbers to be replaced, are you? You were suggesting we just add "Waiting" in addition but still show the numbers? So you'd still be "seeing a bunch of numbers" :) |
Yea, but it's secondary. |
I'm still trying to understand what value this would add. You're asking for this:
to instead be:
just adding repetitive text? What does that help? |
When you add the -completed flag it wouldn't be repeated anymore right? |
Any that hadn't yet been GC'd would be added to the list and they wouldn't have Waiting (they'd have a negative number). Is your desire just to visually separate completed from non-completed when the -complete flag is there, beyond having a negative value? Would a "*" meaning completed be sufficient? Adding all this "Waiting" text just looks like a lot of noise to me. |
What if we we boiled states down to:
and we only showed any of them when you use -completed, since otherwise they're all pending? |
That sounds like a good compromise. Do you think the number is immediately useful? |
Yes. It tells you where it's waiting. In my experience it's one of the more useful pieces of information here. Or did you mean for non-async method tasks? It's not as useful there. |
@davidfowl, I've addressed the request in the following way (locally... will push shortly)... By default, since only non-completed objects are shown, we don't show any English version of status (i.e. nothing's changed here):
If you bring in
If you then also ask to see
|
- Add a stats summary at the beginning of the output - Improved single-line-per-entry default behavior for increased readability - Add option to include all tasks, not just async state machine objects - Include state value for each async object, the state field for async state machines or the state flags for other tasks - Support following continuation chains, rendered as "async stacks" - Support resolving delegate names so that Task.Run and related items have the associated method name displayed - Optional (experimental) DGML rendering of the graph - Optionally include completed tasks, by default filtering them out - Optionally display the fields of state machines
@dotnet-bot test this please |
Something seems to be wrong with the PR, getting very strange infrastructures issues. Going to close the PR and open a replacement. |
Some examples. This is based on creating a new ASP.NET Core Web Application, and updating its Index page with the following (silly) code:
When I then make two requests to this from the browser (both of which will hang), attach WinDBG, and load SOS, I'm able to run commands like the following:
Basic
dumpasync
Note:
Adding -tasks
Note:
Adding -stacks
Note:
Adding -dgmlPath
and opening the .dgml file in Visual Studio:
cc: @noahfalk, @mikem8361
Fixes https://github.com/dotnet/coreclr/issues/20434