0

I'm trying to use visual studio performance profiler for the first time and I'm interested in a specific function of mine which is successfully detected by the profiler. However, when I click on it I get "Source information is not available" .

How do I fix this?

enter image description here

All external functions from libraries are visible. Any function that is in "lab.cpp" won't show. I mean, not even "main" is available. This is the only file I edit, I write all my code in there:

enter image description here

Jeaninez - MSFT
  • 2,068
  • 1
  • 3
  • 12
John Katsantas
  • 511
  • 5
  • 16
  • The first step would be to make sure that the executable is exactly up to date with the source files. You can try to rebuild everything. You may have a compilation error you didn't notice, and you may be profiling an outdated build. – François Andrieux Sep 21 '21 at 19:44
  • @FrançoisAndrieux Well, I'm clueless so I'll mention everything. I just write my code and hit "Local windows debugger" in release mode. That's all I ever do in VS. I tried "rebuild solution" right now if that's what you mean. Still the same error. – John Katsantas Sep 21 '21 at 19:49

2 Answers2

3

In case someone else has the same problem, I solved it by setting the "Debug Information Format" which was previously empty in my cpp file's(the file containing the functions) General Properties:

enter image description here

John Katsantas
  • 511
  • 5
  • 16
  • 1
    Great, please remember to accept your answer as this will help other forum members, and thank you for sharing the solution. – Tianyu Sep 27 '21 at 07:18
0

The accepted answer for this question says that you just need to add a Debug Information Format in Release, for me doing this was not enough. I needed to add a Debug Information Format and turn on "Generate Debug Info" in Release.

I recommend creating a new configuration called "Release with Debug Info" using the Configuration Manager (which you can get to from the Configuration combobox/dropdown), copying the settings from "Release" into "Release with Debug Info" and then making the two changes documented in this answer in the new configuration.

jwezorek
  • 6,542
  • 1
  • 26
  • 40