Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio CPU Profiler / No Data

Today my CPU Usage Performance profiler in Visual Studio stopped working. I start it, it seems like it's working, you can see the graph of the CPU going up and down but when it finishes I get no data with the message:

"There is no data in the current set of filters."

I have tried every combination of categories and filters with no luck. I restarted Visual Studio, I rebooted the workstation, I tried against a new hello world project. Other performance tools seem to work (e.g. the .NET Object Allocation Tracking tool works). To (try) to rule out that it was something specific in my project I was able to successfully run it on a 2nd workstation against the same set of code. I have also run VS without extensions and also in regular mode after disabling everything I've added in (like ReSharper).

Edit: Additionally I just found this in the Windows Event Viewer.

System.Runtime.InteropServices.COMException: The method or operation is not implemented., System.Object get_Value()
   at EnvDTE.Property.get_Value()
   at Microsoft.VisualStudio.PerformanceTools.ProjectTarget.LoadBinaryProject(IVsHierarchy hier)
   at Microsoft.VisualStudio.PerformanceTools.ProjectTarget.LoadProjInfo()

This also just popped up in the Event Viewer under "Windows Error Reporting" that referenced a Watson VSTelem.Out error:

Fault bucket 125730739576, type 5
Event Name: PerfWatsonVS12Data
Response: Not available

Another oddity is, I just ran a profile session for maybe 20 seconds, however when it's done VS says "Diagnostic session: 127:47 minutes" which would be the about the time I first time I tried it this morning if it never stopped. I did a repair of Visual Studio from the installer and the profile worked for 1 session after, the 2nd session then reverted to the aforementioned behavior again.

I'm currently using:

  • Visual Studio 16.8.5 16.9.1 16.9.2 16.9.3 16.9.4 16.11.2
  • .NET Core SDK: 5.0.201
  • Windows 10 Version 2004 Build 19041.867

Any thoughts on fixes?

enter image description here

Edit: According to the following link, it might be related to a Windows Update and a bug in my NVidia driver:

  • https://developercommunity.visualstudio.com/t/no-data-in-cpu-usage-tool-windows-update-related/1384519
like image 842
b.pell Avatar asked Mar 11 '21 00:03

b.pell


People also ask

How does Visual Studio analyze CPU usage?

Collect CPU usage dataSelect Debug > Performance Profiler. Under Available tools, select CPU Usage, and then select Start. After the app starts, the diagnostic session begins and displays CPU usage data.

How do I run a performance profiler in Visual Studio?

Open the Performance Profiler by choosing Debug > Performance Profiler (or Alt + F2). For more information on using the CPU Usage or Memory usage tool in the Performance Profiler vs. the debugger-integrated tools, see Run profiling tools with or without the debugger.

How do I read a CPU profile?

Click the Record button in the upper left corner of the profiler tab, move the mouse up and click the button labelled "click" on the page, and then stop the recording (by pressing the record button again). You'll see the CPU profile shown in figure 2.

How do I show diagnostic tools in Visual Studio?

When you start debugging in Visual Studio by selecting Debug > Start Debugging, or pressing F5, the Diagnostic Tools window appears by default. To open it manually, select Debug > Windows > Show Diagnostic Tools. The Diagnostic Tools window shows information about events, process memory, and CPU usage.


1 Answers

Microsoft confirmed the problem, as soon as a solution or workaround is found - report it. Follow the forum https://developercommunity.visualstudio.com/t/profiling-cpu-still-states-no-user-code-was-runnin/607535?from=email&viewtype=all#T-ND1373491

like image 150
Alex Avatar answered Oct 16 '22 19:10

Alex