views:

99

answers:

4

Can anyone provide me with link to a website/book in which would be well explainded how to use profiler in VS2010 for native code? I tried to search the web but all I'm getting is tutorials from Microsoft and those tutorials use C#.
Thank you.

A: 

At least the last time I looked, the built-in profiler was for managed code only. I believe Visual Studio 6 was the last to support profiling of native code. There are quite a few other profilers that support native code with newer compilers though.

Jerry Coffin
@Jerry could you please list those other profilers please and what do you mean by saying that they support newer compilers? Is there newer compiler than the one from VS2010?
There is nothing we can do
@A-ha: I meant compilers newer than VS6 (that last one that included a profiler for native code). A previous question covered other profilers: http://stackoverflow.com/questions/153559/what-are-some-good-profilers-for-native-c-on-windows
Jerry Coffin
@Jerry except that it include a profiler? http://social.msdn.microsoft.com/Forums/en/vcprerelease/thread/92728711-5d34-482c-8be0-e5f488a3b725http://msdn.microsoft.com/en-us/library/d3bbz7tz.aspx Is it missing some fundamental feature that precludes it from your definition of profiler that I'm not getting?
Marc Bollinger
@Jerry: The profiler built-in (to VS2008 TeamSystem, at least) does work with native C++. I just ran it.
John Dibling
@Marc, @John: Yes, I should have been more specific -- I believe (though I haven't tested it) that the TS profiler has always worked with native code. A native profiler was included in VS 6 Pro, but was dropped in VS.NET, and only re-constituted in *much* more expensive versions that (I'm guessing) the OP doesn't have.
Jerry Coffin
@Jerry, that's quite possible, I didn't check which flavors of VS the profiler is included with. Surely not the free/cheapest ones.
John Dibling
@Jerry gotcha, makes sense. @John with regard to "free/cheapest", AFAICT, it's _only_ the most expensive. VS 2008 Professional definitely does not come with the built-in profiler.
Marc Bollinger
@Marc: As of VS 2008, it was included in only the single most expensive edition. Doing a bit of checking, in VS 2010, it's included in both the "Premium" and "Ultimate" editions. http://www.microsoft.com/visualstudio/en-us/products
Jerry Coffin
A: 

It doesn't seem like it should be that different, accoding to some of the documentation:

Note that [using sampling/instrumentation to collect memory data] is the only feature in the Profiler that is only available for .NET Framework-compliant code. For the rest of the features, Visual Studio Profiler has complete parity between native C/C++ and .NET-based applications.

Marc Bollinger
A: 

Here are the basic steps (in VS2008 TeamSystem):

  1. Open you C++ project
  2. Do Analyze>Launch Performance Wizard...
  3. Select the project you want to profile, Next>
  4. Select Instrumentation, Next>
  5. Finish, Wizard closes
  6. Analyze>Profiler>Launch With Profiling
  7. Program runs...
  8. When program ends, you get a profile report.

In the MSDN Library, the head-end for the documentation is here.

John Dibling
A: 

Only the super-turbo-team-deathstar edition of vs2010 comes with a profiler

This question has a list of the free alternatives.

Martin Beckett