Profiling only the namespaces that I need with VS2010
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::
fun开发者_StackOverflowctions.
What might be wrong?
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.
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:
vsinstr.exe /dumpfuncs /exclude:std::* /exclude:`std::* > foo.txt
精彩评论