-
Notifications
You must be signed in to change notification settings - Fork 46
Collect a .NET Core SQL Driver Trace
Malcolm Stewart edited this page Aug 22, 2022
·
21 revisions
BID Traces rely on the Event Tracing for Windows (ETW) infrastructure. This is what Windows drivers use. However, .NET Core apps are not targeted specifically at Windows and therefore use the .NET Event Tracing infrastructure. Fortunately, the .NET Core run-time provides the DOTNET-TRACE command to collect these traces on non-Windows operating systems.
- If you are tracing Microsoft drivers specifically for Windows: Collect a SQL Driver BID Trace
- If you are tracing Microsoft ODBC Drivers for Linux: Collect a SQL Driver BID Trace - near the bottom
- If you are tracing Microsoft JDBC Drivers: https://docs.microsoft.com/en-us/sql/connect/jdbc/tracing-driver-operation?view=sql-server-ver15
- The name of the trace event is Microsoft.Data.SqlClient.EventSource.
- You can use this in PerfView on Windows to trace .NET Core apps on Windows.
- This is also the trace name used in the examples below.
Download the dotnet tool: Install .NET on Linux distributions - .NET
e.g. for Ubuntu using apt-get:
sudo apt-get install -y dotnet-runtime-6.0
Installing dotnet-trace:
dotnet tool install --global dotnet-trace
SSH is used for the command windows.
WinSCP is used to copy the files to the Windows machine.
Download PerfView: Releases · microsoft/perfview (github.com)