【发布时间】:2011-09-13 02:50:55
【问题描述】:
我正在尝试测量 Visual Studio 2010 中控制台应用程序项目的某些功能和方法的性能。
我将分析方法配置为检测。问题是性能监视器不起作用。我得到的输出消息是:
Profiling started.
Instrumenting w:\MyProject\ProfilingTest\Build\Debug\ProfilingTest.exe in place
Info VSP3049: Small functions will be excluded from instrumentation.
Microsoft (R) VSInstr Post-Link Instrumentation 10.0.40219 x64
Copyright (C) Microsoft Corp. All rights reserved.
File to Process:
w:\MyProject\ProfilingTest\Build\Debug\ProfilingTest.exe --> w:\MyProject\ProfilingTest\Build\Debug\ProfilingTest.exe
Original file backed up to w:\MyProject\ProfilingTest\Build\Debug\ProfilingTest.exe.orig
Successfully instrumented file w:\MyProject\ProfilingTest\Build\Debug\ProfilingTest.exe.
The process cannot access the file 'w:\MyProject\ProfilingTest\Build\Debug\ProfilingTest.exe' because it is being used by another process.
Data written to w:\MyProject\ProfilingTest\ProfilingTest110611(17).vsp.
Profiling finished.
File contains no data buffers
File contains no data buffers
Analysis failed
The process cannot access the file 'w:\MyProject\ProfilingTest\Build\Debug\ProfilingTest.exe' because it is being used by another process.
Profiling complete.
我认为“万恶之源”是: 该进程无法访问文件“...”,因为它正被另一个进程使用。
是否有人在尝试分析在 Visual Studio 2010 中开发的本机应用程序并解决这些问题时遇到过此类问题?
稍后添加: 如果我没有选择要分析的项目,而是直接选择构建的可执行文件,我成功地进行了分析,没有收到进程阻塞,我什至收到了文件分析。但是,监控应用程序在分析结束时崩溃。我怀疑与IDE有关,但我不能确定。
【问题讨论】:
-
呃,也许你的杀毒软件有干扰?
-
嗯。它可能是。我必须检查...
-
我在被忽略的文件上添加了防病毒位置。还是不行。
-
您是从探查器运行可执行文件,还是从 IDE 运行它然后尝试使用探查器? ...在您启动分析器之前,其他东西启动了应用程序或正在使用它。
-
实际上,我昨晚尝试直接检测可执行文件,而不是检测项目(来自向导)。有效。我怀疑 IDE 在监视时阻止了 exe 文件。在这两种情况下发生的情况是,在执行结束后,Visual Studio 的性能监视器会崩溃。
标签: c++ visual-studio-2010 profiling