Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dotnet-trace] TimeoutException on collect #376

Closed
unaizorrilla opened this issue Jul 2, 2019 · 9 comments
Closed

[dotnet-trace] TimeoutException on collect #376

unaizorrilla opened this issue Jul 2, 2019 · 9 comments

Comments

@unaizorrilla
Copy link

Hi,

When I try to collect trace file using dotnet trace collect --process-id [pid] tool throw the following error (above). The PID I use is the same as Task Manager show, but just for cuirious dotnet trace list-processes don't show this id.

[SDK Version]
3.0.100-preview6-012264

[Configuration]
Release

[ERROR] System.TimeoutException: The operation has timed out.
at System.IO.Pipes.NamedPipeClientStream.ConnectInternal(Int32 timeout, CancellationToken cancellationToken, Int32 startTime)
at System.IO.Pipes.NamedPipeClientStream.Connect(Int32 timeout)
at Microsoft.Diagnostics.Tools.RuntimeClient.DiagnosticsIpc.IpcClient.GetTransport(Int32 processId) in //src/Microsoft.Diagnostics.Tools.RuntimeClient/DiagnosticsIpc/IpcClient.cs:line 35
at Microsoft.Diagnostics.Tools.RuntimeClient.DiagnosticsIpc.IpcClient.SendMessage(Int32 processId, IpcMessage message, IpcMessage& response) in /
/src/Microsoft.Diagnostics.Tools.RuntimeClient/DiagnosticsIpc/IpcClient.cs:line 80
at Microsoft.Diagnostics.Tools.RuntimeClient.EventPipeClient.CollectTracing(Int32 processId, SessionConfiguration configuration, UInt64& sessionId) in //src/Microsoft.Diagnostics.Tools.RuntimeClient/Eventing/EventPipeClient.cs:line 51
at Microsoft.Diagnostics.Tools.Trace.CollectCommandHandler.Collect(IConsole console, Int32 processId, FileInfo output, UInt32 buffersize, String providers, String profile, TraceFileFormat format) in /
/src/Tools/dotnet-trace/CommandLine/Commands/CollectCommand.cs:line 100

@jorive
Copy link
Member

jorive commented Jul 2, 2019

What version of dotnet-trace and the application runtime you were trying to trace were you using? It might be a compatibility issue. We have changed the runtime and tooling between preview versions and they are not compatible. Could you please try preview7 for the tooling and runtime?

@unaizorrilla
Copy link
Author

Hi José,

.NET Core Version 3.0.100-preview6-012264
DotNet Trace Version 1.0.4-preview6.19311.1

@sywhang
Copy link
Contributor

sywhang commented Jul 2, 2019

If the process ID didn’t show up in list-processes command it means that process didn’t create a named pipe to read so that would explain the timeout. Could you please check and make sure that the process you’re trying to trace is a .NET Core app using version 3.0 preview 5 or later?

@unaizorrilla
Copy link
Author

Hi @sywhang

Yeap, my fault ! I'm playing with dotnet-trace and the collect is working for a simple asp.net core 3 preview 6 but, when I open netperf on VS always show "no code was running during the selected time range"

image

Some info:

.NET Core Version 3.0.100-preview6-012264

DotNetTrace Version 1.0.4-preview6.19311.1

@sywhang
Copy link
Contributor

sywhang commented Jul 4, 2019

Which version of VS are you using?

You might want to try out using PerfView - https://github.com/microsoft/perfview - to open the trace.

@noahfalk Do you happen to know if VS's netperf support already shipped?

@unaizorrilla
Copy link
Author

VS Version 16.1.5

I try to open trace.diagsession on PerfView but show nothing!

@josalem
Copy link
Contributor

josalem commented Jul 10, 2019

If I recall, there was an issue in preview 6 with managed stacks in netperf output (see: dotnet/coreclr#25014). That might be causing the behavior you are seeing. That was subsequently fixed in later previews.

@noahfalk
Copy link
Member

Preview 6 had issue https://github.com/dotnet/coreclr/issues/25046 that broke CPU sampling with dotnet-trace (it has also been subsequently fixed). I recently updated the known issues list to include it.

It was unfortunate, but Preview 6 wound up being a bad preview to test the CPU sampling scenario with. Some options that should work better:
a) Use Preview 5 (https://devblogs.microsoft.com/dotnet/introducing-diagnostics-improvements-in-net-core-3-0/)
b) Wait for Preview 7 which I think will be out soon (next week?)
c) Use daily .net core builds and a very recent build of the .net diagnostics tools:
dotnet tool install --global dotnet-trace --version 3.0.0-preview7.19359.1 --add-source https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json

@sywhang
Copy link
Contributor

sywhang commented Aug 5, 2019

Closing this issue since it seems like we already addressed the problem :) Please feel free to reopen otherwise!

@sywhang sywhang closed this as completed Aug 5, 2019
@dotnet dotnet locked as resolved and limited conversation to collaborators Jun 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants