locked
Profile Fails RRS feed

  • Question

  • Problem:

    1. Create a simple project. e.g.

     

        namespace profiletest
        {
          class Program
          {
            static void Main(string[] args)
            {
              for (int i = 0; i < 100000; i++)
              {
                Console.Write(".");
              }
            }
          }
        }

    2. Create and exectued a profile session.

    3. Everything runs fine, but upon completion of the process I get the following error:

       Performance report c:\profiletest\profiletest060811.vsp contains no data

    The file profiletest060811.vsp exists and is 212 KB long, but Visual Studio will not display anything after the error.

    If I run the exact same project on a different computer it profies without any problems.

    I formatted my hard drive and reinstalled Windows XP and Visual Studio Team for Developers. Same problem.

    My only guess is that it has something to do with my new hardware that I got a couple weeks ago. On my old hardware I was able to profile fine.

    I can using instrumenting without any problems on the above project, but when I run it on my real project I get the error "value too big or small for int64".

    Has anyone seen anything similar?

    Thanks,

    Lee Jensen

    Friday, August 11, 2006 9:02 PM

Answers

  • Lee,

    I can confirm that sampling mode (in default settings) does not work with Intel Core Duo processors.

    This is fixed in our upcoming SP1 release. However, if you want a workaround for now, try changing the setting properties of the performance session to sample on Instructions Retired as opposed to clock cycles. This changes sampling a little bit, but ends up giving you close to the same results that will work just find for general performance analysis.

     

    Thanks,

    Ian

    Tuesday, August 15, 2006 7:40 PM

All replies

  • Hi Lee,

        What type of profiling you are doing (sampling or instrumentation)? As its a small method , i might wanted to do instrumentation then it will able to capture some profiling as sampling profiling captures program state by sampling at specified intervals (such as clock cycles or page faults) and instrumentation profiling inserts probes into your code to catch every single function call made by your program.

    Hope that helps

    Thanks,
    Anjana [MSFT]
    Microsoft Developer Support
    This posting is provided "AS IS" with no warranties, and confers no rights.

    Monday, August 14, 2006 7:29 PM
  • Sorry to leave out the crucial piece of information. I am trying to run sampling. It doesn't matter what the project is that I try and profile (with sampling) on my computer it always ends up with the same "Performance report <filename> contains no data" error.

    I can run instrumentation on the simple project given above and it works fine, but if I run it on any project that actually does something I get the above mentioned "value too big or small for int64" error.

    So basically, for whatever reason profiling does not work on my particular computer. I formatted the system and installed XP with only VSS 5.0 and VS Team 2005 on it and I still get this same behaviour.  I can profile the same projects on other  computers without problem. To me this seams to indicate that there is some hardware issue with the profilier. The computer in question has the following specs:

    Dell Latitude D820
    2 GB RAM
    Core Duo Processor x86 Family 6 Model 14 Stepping 8 GenuineIntel ~2161 Mhz

    Although it would seem that if it was hardware related that others would be seeing the same problem. However, I am at a loss as to what it could be or what else I can try.

    Can some else please confirm that they are successful at profiling with an Intel Core Duo processor?

    Thanks again,

    Lee Jensen

    Monday, August 14, 2006 8:33 PM
  • Lee,

    I can confirm that sampling mode (in default settings) does not work with Intel Core Duo processors.

    This is fixed in our upcoming SP1 release. However, if you want a workaround for now, try changing the setting properties of the performance session to sample on Instructions Retired as opposed to clock cycles. This changes sampling a little bit, but ends up giving you close to the same results that will work just find for general performance analysis.

     

    Thanks,

    Ian

    Tuesday, August 15, 2006 7:40 PM
  • Wow! Not compatible with Intel hardware. Strange that it was a known problem, but there was no documentation (that I could find). I don't mean to sound critical, but I wasted a lot of time on this one. I appreciate the profilier being in the box so that I don't have to shell out $1000 to IBM. Intel must have pulled a wicked curve on you for this to have happened.

    Is this also responsible for the failure in instrumentation mode?

    Thanks for confirming my suspicion. At least now I know, and perhaps the next guy will find the answer with less effort.

    Lee Jensen

    Monday, August 21, 2006 8:21 PM
  • Hi Ian,

     

    Can you let me know how I need to configure the profiler to work on an Intel Core Duo proc, you say it doesn't work "in defaults setttings", so presumably you can get it working with custom settings?

     

    Thanks in advance,

     

    Kevin

    Friday, September 29, 2006 7:49 AM
  • Kevin,

    So the way to get the profiler working in sampling mode with a Dual Proc is to do the following.

    1. Right click on your performance session in the performance explorer window and go to properties

    2. In the profperties page go to the sampling tab

    3. In the "sample event" drop down box change from "Clock Cycles" to "Performance Counter"

    4. Now in the treeview in the bottom part select the "instruction retired" event under Generic Events->General

    Now instuctions retired is a little different from clock cycles, but for general purpose sampling profiling they function almost exactly the same. Note that this will be fixed in the upcoming SP.

    ~Ian

    Friday, September 29, 2006 4:31 PM
  • Thanks Ian, that works a treat for my test app which is a console app.

    However, I'm actually trying to profile an NT service so I need to use the command line tools to attach to a managed process, is there a way to do this using those tools? I was thinking there would be a way to do it using VSPerfCmd but it isn't obvious to me?

     

    Thanks for your help,

     

    Kevin

    Friday, September 29, 2006 7:30 PM
  • Don't worry you can do the same thing from the command line. Although, I will admit that it is fairly hard to use (we're cleaning these up for our next release).

    First off, try running vsperfcmd /querycounters to see the counters that are available on the system. In addition to querying the counters this command will show you the command lines that you need to add to vsperfcmd to use these counters. Show below is an example of querycounters running on my dev box:

    Friendly named counters for current platform:
                     InstructionsRetired /COUNTER:g,0x1
                         NonHaltedCycles /COUNTER:g,0x2
                              ITLBMisses /COUNTER:g,0x5
                         BranchesRetired /COUNTER:g,0x6
                    MispredictedBranches /COUNTER:g,0x7
                       64kAliasConflicts /COUNTER:P4,FLAME,0x02,0x05,0x0008
                        PageWalkDTLBMiss /COUNTER:P4,BPU,0x01,0x04,0x0001
                       L3CacheReadMisses /COUNTER:P4,BPU,0x0c,0x07,0x0200
                   L3CacheReadReferences /COUNTER:P4,BPU,0x0c,0x07,0x0238
                        PageWalkITLBMiss /COUNTER:P4,BPU,0x01,0x04,0x0002

    So now you can add on the /COUNTER switch to your call to vsperfcmd along with a comma and a reload parameter (the reload parameter tells you how often you need to sample). So check out my example command line below:

    vsperfcmd /start:sample /output:test.vsp /counter:g,0x1,100000

    That command will start in sampling mode and sample every 100000 instructions retired. Also note that the /counter switch have a little different meaning in trace mode. In trace mode you have multiple counter commands added to vsperfcmd and you don't need to specify a reload parameter. Then on every instrumented data point (function entry and exits by default) you will sample the value for all the specificed performance counters.

     

    ~Ian

     

    Friday, September 29, 2006 9:13 PM
  • Thanks for the quick response once again Ian, much appreciated.

     

    That worked for, minor change, I found I had to use the /counter option on the vsperfcmd /attach, I had an error message when I used it on vsperfcmd /start.

     

    One final quesiton, I played around a little with the rate, I bumped it up to 1,000,000, it seemed to give a good result for me but the ouptput was a lot smaller. Presumably this needs to be smaller when your profiling session is shorter in duration, I'm profilling a messaging product for a few minutes at 100,000 the output file was getting pretty big. I'd be interested in your thoughts.

     

    Thanks again,

     

    Kevin

    Saturday, September 30, 2006 9:00 AM