views:

86

answers:

1

I've been trying to get some instrumented profiling going for one method (and children) in a large C# 2.0 application using the built in VSTS 2005 or 2008 performance tools.

However, I can't find any form of the /include command that will work - the profiler just keeps failing to find the method. The docs are so bad that all I can do is guess how it works. So I guess I should be using our fully qualifed name (/include:Company.Product.Class.Method). The MSDN entry says to use C++ syntax (/include:Company::Product::Class::Method) which sounds plain wrong and of course doesn't work. I've tried all the obvious variations, and all fail.

Can anybody enlighten me as to the correct syntax for this command, please?

(the method is in an assembly that is used by the main .exe - I've therefore also tried adding both the .exe and the assembly to the Targets explicitly to make sure that it looks in the right place for the method, but that also doesn't help)

+1  A: 

Have you tried to profile from within the IDE?

  1. Create a unit test against the method you want to test.
  2. Setup the code in the unit test providing the arguments of your method - if there are any.
  3. Run the test.
  4. From the Test Results pane, right click the test and select "Create Performance Session..."
  5. Run through the Wizard.
  6. If needed configure other Performance Test parameters through Performance Exploer.
  7. Launch you profiling session.

Once you have a profile session running from within the IDE, you can try running it out of the IDE. In case you haven't already seen, Using the Profiling Tools From the Command-Line provides links to several topics regarding profiling from the command line.

Alfred Myers
Thanks Alfred - that looks like a handy approach, and certainly very useful for simple performance tuning. However, I need to profile the method in situ (i.e. find out how often it's called, what it's calling and how long it's taking in a genuine "release" situation)
Jason Williams