问题
Is is possible to perform CPU Sampling in VS2010 via the Attach To Process option? When I do use that option it seems to always default to Memory Profiling. I can't launch CPU Sampling with the wizard because the ridiculous security software on our work PCs don't allow the DLL injection it uses.
回答1:
If you select Analyze\Profiler\New Performance Session, the Performance Explorer will open with a new performance session. In the properties of this item, you can specify the type of profiling you want to use:
You can then attach this session to your process via "Attach/Detach" in the session's context menu:
来源:https://stackoverflow.com/questions/15823969/cpu-sampling-in-vs2010-via-attach-to-process