locked
Instrumentaion profiling ASP.net application: File contains no data error RRS feed

  • Question

  • Hi,

    I am working on a project to profile our 32-bit ASP.net application using instrumentaion mode -- pre-build assemblies. It's puzzled that i couldn't get profile data everytime i ran the Profiler. I got File contains no data error most of the time.

    Here are the steps i take: Run with 32-bit profiler tool

    1.vsperfclrenv /globaltraceon
    2. iisreset /stop
    3. vsinstr.exe  <a.dll>
    4. vsinstr <b.dll>
    5. iisreset /start
    6. vsperfcmd /cs /start:trace /output:c:\temp\test.vsp /user:"[w3wp worker user]"
    7. start to run my test
    8. vsperfcmd /attach:pid
    9. iisreset /stop
    10 vsperfcmd /shutdown
    11. vsperfreport c:\temp\test.vsp /summary:all /packsymbols
    12. iisreset /start

    OS: Windows server 2008 sp1 VMWare, 64-bit
    Visual Studio Team System 2008

    UsingProcess Monitor, i could see both dlls being loaded during the tests, and they were instrumented successfully without any error.

    It also seems puzzled me that from an artical from MSDN, vsperfcmd /attach switch can only use with sampling mode, but i didn't get any error when i used it with instrumentaion mode, and if skip step 8(not run vsperfcmd /attach), i've always got 'File contains no data' error.

    Anything wrong with the steps?

    Any suggestion would be appreciated
    Thanks very much,
    JK

    Monday, November 16, 2009 11:21 PM

Answers

  • Hi JK,

    Thanks for your feedback.

    I do not think attaching to w3wp.exe process and then running Load Test could collect the profile data in this scenario. Instead, I recommend you attach to the VSTestHost.exe process. If we still want to attach to w3wp.exe process, we need to create a Web application, add reference to a.dll and b.dll, then, create a performance session on the web application.

    Best regards,


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    • Marked as answer by liurong luo Monday, November 23, 2009 5:22 AM
    Thursday, November 19, 2009 4:25 AM

All replies

  • Hello,

    Welcome to Visual Studio Profiler forum.

    Visual Studio Profiler collects data in a process called VsPerfMon.exe. It communicates with VS Performance Monitor through various global shared objects. These objects created only after we started VsPerfMon.exe. If we execute the target binary before we start the monitor, then, the "no data was collected" error happens.

    To correctly profile the pre-built assemblies, we need to start the Monitor process, please add vsperfmon command after step 4.

    For more information about Profiling ASP.NET application, please refer to the following off road blog:
    http://blogs.msdn.com/graycode/articles/AspNetOffRoadProfilingArticle.aspx

    Best regards.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    Tuesday, November 17, 2009 3:01 AM
  • Thanks for the prompt reply!

    I followed the insturctions as the referenced article using vsperfmon instead of vsperfcmd, but still got the same error.

    I've noticed one thing though, after ran the command  from an elevated (Run as Administrator) cmd prompt: vsperfmon /trace /output:c:\temp\test.vsp /user:"[w3 worker process user]", i got

    The current account does not have privileges to lock memory
    Started in Stand Alone Mode
    Filename: c:\temp\test5.vsp

    What is the 'current account' referring? The account running profiler? Or the user account of w3 worker process? Is this the reason no data being collected? I tried to use 'vsperfcmd /attach:[pid] ' after start vsperfmon, still no success. UAC was turned off.

    Would you give me more idea what's wrong?

    Thanks,
    JK
    Tuesday, November 17, 2009 4:42 AM
  • I enalbed the Lock Memory setting for the user account which ran the profiler, and no complaint about privilages to lock memory showed up again. But i'm still not getting any data.

    Here are the steps i did followed as in the Off Road blog:

    1. vsperfclrenv /globaltraceon
    2. reboot
    3. vsinstr <a.dll>
    4. vsinstr <b.dll>
    5. vsperfmon /cs /trace /output:<filePath> /user:"wss_admin"   -- this is the user which runs w3wp.exe showed from Task Manager. I should use this account instead of 'NETWORK SERVICE", is that correct?
    6. run my tests
    7. start another cmd prompt and run iisreset /stop
    8. vsperfcmd /shutdown
    9. vsperfreport <filePath> /summary:all /packsymbols
    10. iisreset /start

    Got 'File contains no data' after step 9.

    Any suggestions what else should i try?

    Thanks a millioin!

    JK
    Tuesday, November 17, 2009 7:37 AM
  • Thanks for your feedback!

    Please use Network Service account and have a try again.

    I also recommend you profile the Web application through Visual Studio IDE. We could find the Performance Wizard by clicking Analyze menu. After the performance session has been created, we could add the related assembly (a.dll and b.dll) to the performance session by right-clicking Add Targets.

    Please have a try and let me know the result.
    Best regards,


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    Tuesday, November 17, 2009 8:27 AM
  • Thanks Roahn.

    I tried using Network Service as the user of w3wp.exe, but still got no data.

    I'm not sure profiling through VS IDE would be a good approach in my case. I am running Load Test, which runs bounch of service calls and ultimately execute lot of code in the pre-build instrumented assemblies, from another client machine. If profiler runs from VS IDE, i'll have to create a performance session for my load test, but the button 'Create performance session for this test' is disabled. How can i integrate the performance session with my test?

    And if there is a way to profile my pre-build assemblies from vs IDE with running my load test/unit test, could you give me more detailed instructions?
    What's wrong with running from cmd line?

    Thanks again,
    JK

    Tuesday, November 17, 2009 9:00 PM
  • Hi JK,

    Thanks for your feedback.

    I do not think attaching to w3wp.exe process and then running Load Test could collect the profile data in this scenario. Instead, I recommend you attach to the VSTestHost.exe process. If we still want to attach to w3wp.exe process, we need to create a Web application, add reference to a.dll and b.dll, then, create a performance session on the web application.

    Best regards,


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    • Marked as answer by liurong luo Monday, November 23, 2009 5:22 AM
    Thursday, November 19, 2009 4:25 AM