简体   繁体   中英

Running the Visual Studio Profiler from the command line

As part of an automated profiling system, i want to run the visual studio profiler from the command line.

According to all of the online documentation, i need to execute the following:

VSPerfCmd \start:sample /output:test.vsp /launch:Test.exe

VSPerfCmd is in my system path, and Test.exe is a HelloWorld C++ program compiled with VS2019 and located in the current directory. I am running the 32-bit version of the profiler and Test.exe is a 32-bit application. I get this error:

Error VSP1005: Command line error: Switch /launch:Test.exe is invalid. Aborting.

One of the guides in found mentioned running

VSPerfCLREnv /sampleon

before starting the profiler in sampling mode. However my version of the VSPerfCLREnv command does not recognize this parameter. Using the /Admin parameter for VSPerfCmd i installed and started the Profiler service, i am unable to start the kernel driver in the same way, but considering Test.exe is just a HelloWorld program, i don't think i would need it.

Has anyone used the command line profiler in VS2019 and can share how they made it work?

It seems that VSPerfCmd is no longer useable in Sampling mode in Windows 8 or above. Instead VSperf is used for sampling and VSPerfCmd for tracing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM