使用 VS2010 仅分析我需要的命名空间
vsinstr.exe 可以选择仅包含需要分析的命名空间。
通过这个选项,我可以获得 vsp 文件。
cl /Zi helloclass.cpp /link /Profile
vsinstr helloclass.exe /include:Fpga::*
vsperfcmd /start:trace /output:trace.vsp
helloclass
vsperfcmd /shutdown
但是,它仍然包含 std::
命名空间。
添加
我尝试使用 /exclude:std::*,并且我得到了太多的功能,包括 <代码>std:: 函数。
可能出了什么问题?
vsinstr.exe has the option to include only the namespaces that needs to profile.
With this option, I could get the vsp file.
cl /Zi helloclass.cpp /link /Profile
vsinstr helloclass.exe /include:Fpga::*
vsperfcmd /start:trace /output:trace.vsp
helloclass
vsperfcmd /shutdown
However, it still contains the std::
namespaces.
ADDED
I tried with /exclude:std::*, and I get way too many functions including the std::
functions.
What might be wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据 http://msdn.microsoft.com /en-us/library/ms182402%28v=vs.80%29.aspx
/include
不接受通配符,请尝试使用/exclude:std::*< /code>
编辑:尝试添加
/exclude:::__*
或/exclude:__*
以摆脱以 __ 开头的全局命名空间函数。尚未对此进行测试,文档也不清楚,但值得一试。According to http://msdn.microsoft.com/en-us/library/ms182402%28v=vs.80%29.aspx
/include
doesn't accept wildcards, try using/exclude:std::*
EDIT: Try adding
/exclude:::__*
or/exclude:__*
to get rid of global namespace functions starting with __. Haven't tested this, and the documentation isn't clear, but worth a try.根据 https://msdn.microsoft.com VS 2010(及至 2015 年)的 /en-us/library/ms182402%28v=vs.100%29.aspx vsinstr.exe 不支持代码覆盖率
/include
。因此,清理结果的唯一方法是使用
/exclude:std::*
。您还可以在检测过程本身之前检查将检测哪些函数,并使用
/dumpfuncs
选项来节省时间,如下所示:According to https://msdn.microsoft.com/en-us/library/ms182402%28v=vs.100%29.aspx vsinstr.exe for VS 2010 (and up to 2015) doesn't support
/include
for code coverage.So the only way to clean the results is using
/exclude:std::*
.You can also check what functions will be instrumented prior to instrumentation process itself and save your time by using
/dumpfuncs
option as the following: