Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2015 -- CPU Usage Profiling Not Working?

I recently upgraded from Visual Studio 2013 Community to Visual Studio 2015 Community.

I've heavily relied on the "CPU Usage" Tool that can be found by doing the following:

  1. Click "Debug"
  2. Click "Start Diagnostic Tools without Debugging"
  3. Click "CPU Usage" Check box
  4. Click "Start" button

When the program is complete, it is supposed to show you the functions and the time spent in each. What I get instead is just the name of my executable that I can keep expanding instead of seeing the function names -- It doesn't know the names of the functions.

This worked fine on Visual Studio 2013... I would be able to see the function names and everything worked. I tried creating a new "test" solution/project to see whether this works and I get the same results: No function names.

Does this work for anybody? I also installed VS2015 on a fresh development box and still have no results. This seems like Microsoft shipped with a Visual Studio bug.

Note: I'm writing a C++ console application. I've tried this on debug and release builds and ensured that I'm building with debug information.

like image 645
BobLoblaw293892389 Avatar asked Aug 09 '15 16:08

BobLoblaw293892389


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. When you're finished collecting data, select Stop Collection.

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.

What is CPU profiling?

CPU Profiler shows what functions consume what percent of CPU time This information can provide you a better understanding of how your application is executed, and how exactly resources are allocated.


1 Answers

It's in the Visual Studio 2015 Update 1 release notes, so I suspect it was broken in the initial release:

Profile your CPU Usage while debugging

Now, you can get a detailed per-function profile of your CPU Usage while you are debugging. You can turn CPU Profiling on and off while debugging and view the results when you are in a break state, which allows you to view a per-function breakdown of CPU Usage of code that executed between breakpoints and during steps. (To use this functionality, open the Diagnostic Tools window (Debug -> Diagnostic Tools), switch to the CPU tab, and then click the "CPU Profiling" button.)

like image 81
Stefan Mohr Avatar answered Sep 17 '22 15:09

Stefan Mohr