PDC video, TechEd Iceland, VS2010, profiling, Silverlight 4

PDC video, TechEd Iceland, VS2010, profiling, Silverlight 4

Rate This
  • Comments 13

(I know I promised this eons ago, so apologies in advance... on the flipside, I'm posting from my vacation in Paris, so hopefully that earns me 1-2 brownie points back.)

First, my PDC slides and the video. This is the same talk that I gave at TechEd Iceland for profiling. 

I was recently reminded to post instructions on profiling Silverlight 4 with VS2010.

At PDC, I announced that Silverlight 4 came with the new CoreCLR capability of being profile-able by the VS2010 profilers: this means that for the first time, we give you the power to profile the managed and native code (user or platform) used by a Silverlight application. woohoo. kudos to the CLR team.

Sidenote: From silverlight 1-3, one could only use things like xperf (see XPerf: A CPU Sampler for Silverlight) which is very powerful to see the layout/text/media/gfx/etc pipelines, but only gives the native callstack.)

However, the version of VS2010 available at PDC unfortunately had a bug: it could not profile Silverlight. My PDC profile demo was saved from a VS2010 build with the fix... thus the delay in my posting instructions. I'm not sure when you'll get next the public drop of VS2010... but you'll run into a new problem: SL4 Beta did not publish symbols to the Microsoft Symbol Server.

I'll be sure to post a status on all of this by Mix (feel free to remind me).

If you happen to read this at a later point, when you have all the drops and symbols, then: Hello! What is the future like? You can use the below instructions:

  1. admin-level VS prompt
  2. cd /
  3. vsperfclrenv /sampleon
  4. set CORECLR_ENABLE_PROFILING=1
  5. set CORECLR_PROFILER=%COR_PROFILER%
  6. vsperfcmd /start:sample /output:myProfile.vsp
  7. vsperfcmd /launch:"c:\Program Files\Internet Explorer\iexplore.exe" /timer:100000
  8. **    navigate, play with app, Shut down.
  9. vsperfcmd /shutdown
  10. before viewing, turn on the symbols server in VS2010 through: Tools-->Options-->Debugging-->Symbols-->check microsoft symbols server.
    (In the video, the symbols just point to a folder where I cache the internal symbols locally... not sure, but I don't think you guys can do that too.)
  11. Open file in VS2010
    (Double-clicking in explorer will not work. VS2010 --> File --> open --> pick file.)
Cheers, and have fun! 
Seema
Comments
  • Hi Seema.

    This scenario doesn't work for x64 OS.

    C:\>vsperfcmd /launch:"c:\Program Files\Internet Explorer\iexplore.exe" /timer:1

    00000

    Microsoft (R) VSPerf Command Version 10.0.21006 x86

    Copyright (C) Microsoft Corp. All rights reserved.

    Error VSP1335: Could not launch c:\Program Files\Internet Explorer\iexplore.exe.

    Profiling 64-bit processes is not supported by this version of the profiling to

    ols. Please use the profiling tools from the x64 directory.

    Will it be accessable at VS2010 Release?

  • The PM for VS2010 Profiling features responds:

    "64-bit support is definitely there. You should be able to find x64 tools under  <x86 program files>\<Visual Studio>\Team Tools\Performance Tools\x64."

    let us know if that works for you, S

  • Hi, Seema.  I'm trying this with SL4 RC (e.g., build 50303), with VS 2010 RC.  Everything seems to work when I follow your instructions, except that when I open the resulting .vsp file, it says "No Call Tree Data is Available".  I can get call tree data if I "Show All Code" (instead of "Just My Code"), but when I do that, I just get a list of a bunch of IE internals, like CReBar::s_WndProc() and __VEC_memcpy() and other stuff that's sorta vaguely interesting, but not real helpful.  I can't find my own code anywhere in the stack.  Anything obvious that I might be doing wrong?

  • I have the same problem.  I've followed the instructions but I just get "No Call Tree Data Is Available."

  • Likewise I have the same problem of "No Call Tree Data Is Available".  Had lots of problems getting the profiler to work until I realised my path points to both the x64 and x86 profiler on x64 Windows 7.  Has anyone got it to work on 64 bit or do I have to go back to a 32 bit Windows install?

  • Well, the same situation with Silverlight 4 RTM ((.

    Can we profile Silverlight application from VS2010 RTM?

  • Pinging internally around for updated directions for VS2010 RTM.... stay tuned.

    -Seema

  • @sergey - you would do well to look at this, if you have not seen it. Excellent blog on profiling using VS2010 RTM and SL4:

    www.nachmore.com/.../profiling-silverlight-4-with-visual-studio-2010

    HTH

  • i tried all these steps and went to msn.com and could do everythign but not silverlight application.  When i launch a silverlight application it prompts for installing silverlight even i have it already.

  • Since Silverlight isn't supported for 64bit, using the 64bit version of the profiler isn't going to do you any good. Use the 32bit version of IE instead.

    Here's what you need to do to profile your app

    1.admin-level VS prompt

    2.cd /

    3.vsperfclrenv /sampleon

    4.set CORECLR_ENABLE_PROFILING=1

    5.set CORECLR_PROFILER=%COR_PROFILER%

    6.vsperfcmd /start:sample /output:myProfile.vsp

    7.vsperfcmd /launch:"c:\Program Files (x86)\Internet Explorer\iexplore.exe" /timer:100000

    NOTE: Go to the x86 version of Program Files ("C:\Program Files (x86)" and not "C:\Program Files")

    8.**    navigate, play with app, Shut down.

    9.vsperfcmd /shutdown

    10.before viewing, turn on the symbols server in VS2010 through: Tools-->Options-->Debugging-->Symbols-->check microsoft symbols server.

    (In the video, the symbols just point to a folder where I cache the internal symbols locally... not sure, but I don't think you guys can do that too.)

    11.Open file in VS2010

    (Double-clicking in explorer will not work. VS2010 --> File --> open --> pick file.)

  • Hello Seema, in your talk/video are the sea horses an Image control or a Path Control? It doesn't look like an image control as the background of the sea horse looks transparent, if its a path control, then its not a rect clip so it should not be using GPU.

  • From the Future! Still facing this problem and I could not find much on the drops and symbols.

    I could not yet test this out since I have no idea what file to open in the final step. Could you please help me out?

    Have been bugged by this for weeks now!

  • Hi Seema,

    I'm working in a huge data driven Silvelight application. We've problem that application is consuming huge CPU utilization even if user doesn't have any action in screen. Sometimes it's reaching 70% and remains same until we close application. What could be the reason? How to profile CPU utilization issues and find root cause for the same? One more issue that the application is being tested in thin client (CITRIX server) and it's having the same high CPU utilization issue. Our expectation is application should be used by more than 20 users but for 2 users it's showing high CPU (close to 80%) utilization. Please advice me in this regard.

Page 1 of 1 (13 items)
Leave a Comment
  • Please add 5 and 2 and type the answer here:
  • Post