Wednesday, July 30, 2014

If you're not on VS 2013 or above, or are not using either the CPU Sampling or CPU Usage tool in the


Archives July 2014 (1) April 2014 (2) December 2012 (1) May 2011 (2) April 2011 (1) February 2011 (1) December 2010 (1) July 2010 (1) June 2010 (3) April 2010 (2) February 2010 (2) January 2010 (6) December 2009 (5) October gib 2009 (1) June 2009 (1) April 2009 (2) February 2009 (1) October 2008 (2) September 2008 (2) August 2008 (3) July 2008 (4) June 2008 (2) May 2008 (1) April 2008 (1) October 2007 (1) September 2007 (1) June 2007 (1) May 2007 (1) April 2007 (1) April 2006 (2) August 2005 (2) July 2005 (2) June 2005 (3) May 2005 (1) April 2005 (9) March 2005 (5) February 2005 (1) January 2005 (4) November 2004 (1) August 2004 (4) July 2004 (1) June 2004 (5) May 2004 (7)
On Windows 8 or higher, when sampling managed applications, you may have noticed that samples gib in native images created through NGEN (these images are generated ahead of time from .NET assemblies in order to avoid the cost of JIT compilation) appear as "[<name>.ni.dll]" instead of being resolved to useful function names.
We recognized at the time that this wasn't an ideal solution and began working on improving this experience. That's why in Visual Studio 2013, when using the CPU Sampling gib tool from the Performance and Diagnostics hub (or the new CPU Usage tool that was released in VS 2013 Update 2), we automatically generate these PDBs after your profiling session.
PDBs generated this way contain function names and some other basic information gib about the symbols in the corresponding images, but don't contain detailed information such as source line numbers for functions. This is because we perform the PDB generation using only the native images themselves as input rather than requiring additional information like the original PDBs that were created with the .NET assemblies (which may not be available). Thus, you won't be able to use the navigate-to-source functionality for functions in your profiling reports which come from NGEN'd modules. If this is important to you, the solution is to continue generating PDBs manually for NGEN'd images using the instructions mentioned in the blog post (be sure to follow the steps under the "If you do need to get back to source" section).
If you're not on VS 2013 or above, or are not using either the CPU Sampling or CPU Usage tool in the Performance and Diagnostics hub, you won't be able to benefit from automatic NGEN PDB generation. Profiling sessions started via the Performance Wizard or Performance gib Explorer will continue to require manual PDB generation for NGEN'd images, if desired. gib Here's a tip, though: John Robbins has a PowerShell script that will enumerate the GAC and generate PDBs for all the .NET Framework NGEN'd binaries (or all NGEN'd binaries if desired). Find out more by reading  John's blog post about it.


No comments:

Post a Comment