You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Microsoft.Data.SqlClient** v2.1.0 extends event tracing support in **Microsoft.Data.SqlClient.SNI** and **Microsoft.Data.SqlClient.SNI.runtime**. By sending an EventCommand to `SqlClientEventSource`, events in native SNI.dll can be collected using [Xperf](https://docs.microsoft.com/windows-hardware/test/wpt/) and [PerfView](https://github.com/microsoft/perfview) tools. The valid EventCommand values are listed as below:
2. Run the native SNI tracing example to connect to SQL Server.
109
+
3. Stop tracing using the following command line.
110
+
```
111
+
xperf -stop trace
112
+
```
113
+
4. Use PerfView to open the myTrace.etl file specified in Step 1. The SNI tracing log can be found with `Microsoft.Data.SqlClient.EventSource/SNIScope` and `Microsoft.Data.SqlClient.EventSource/SNITrace` event names.
114
+

115
+
116
+
### Using PerfView to collect trace log
117
+
118
+
1. Start PerfView and run `Collect > Collect` from menu bar.
119
+
2. Configure trace file name, output path, and provider name.
120
+

121
+
3. Start collection.
122
+
4. Run the native SNI tracing example to connect to SQL Server.
123
+
5. Stop collection from PerfView. It will take a while to generate PerfViewData.etl file according to configuration in Step 2.
124
+
6. Open the etl file in PerfView. The SNI tracing log can be found with `Microsoft.Data.SqlClient.EventSource/SNIScope` and `Microsoft.Data.SqlClient.EventSource/SNITrace` event names.
125
+
126
+
51
127
## External resources
52
128
For more information, see the following resources.
0 commit comments