为什么我无法通过附加到dllhost.exe来使用vsperfmon进行配置文件? [英] Why cant I profile using vsperfmon by attaching to dllhost.exe?

查看:140
本文介绍了为什么我无法通过附加到dllhost.exe来使用vsperfmon进行配置文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个本机C ++项目,该项目使用COM与VB.NET中的单独项目进行通信.通过将项目附加到引用本机dll的单独exe上,我过去能够成功地分析本机项目.我现在正在尝试通过连接到dllhost.exe来分析本机项目.此配置有效,因为我能够通过dllhost进行调试,但是如果我尝试对代码进行概要分析(或在调试时仅将概要分析器附加到dllhost),概要文件将停止,并得到以下输出:

I have a native C++ project that uses COM to communicate with a separate project in VB.NET. I have been able to successfully profile the native project in the past by attaching the project to a separate exe that references the native dll. I'm now trying to profile the native project by connecting to dllhost.exe. This configuration works, since I'm able to debug through dllhost, but if I try and profile the code (or just attach the profiler to dllhost while I'm debugging), the profiler stops and I get the following output:

PRF0010: Launch Aborted - Unable to start vsperfmon.exe
Error VSP1712: Invalid File: C:\...\MyProj110609.vsp
PRF0025: No data was collected.

我知道分析器可以工作,因为我可以使用其他配置来获得结果.我也知道调试配置有效.有什么问题的想法吗?

I know the profiler works since I can get results using a different configuration. I also know the debug configuration works. Any idea on what's going wrong?

推荐答案

经过研究,我发现使用dllhost进行操作的唯一方法是使用命令行探查器.转到VS 2010命令提示符,然后输入

After some research, I found that the only way to do it with dllhost was to use the command line profiler. Go to the VS 2010 command prompt, and type in

VSPerfCmd /start:sample /output:c:\TestFile.vsp
VSPerfCmd /attach:[PID]

其中,c:\TestFile.vsp是输出文件的名称和路径,而[PID]是dllhost的配置文件ID.运行任何您想要分析的内容,完成后,键入

where c:\TestFile.vsp is the name and path of the output file, and [PID] is the profile ID of dllhost. Run whatever you want to profile, and when you're done, type in

VSPerfCmd /detach:[PID]
VSPerfCmd /shutdown

,您将获得效果报告.

这篇关于为什么我无法通过附加到dllhost.exe来使用vsperfmon进行配置文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆