I have the following C++ code.
#include
using namespace std;
int testfunction(int input)
{
if (input > 0) {
return 1;
}
You need to run your program after the monitor starts:
> vsinstr /coverage hello.exe> start vsperfmon /coverage /output:mytestrun.coverage> hello.exe> vsperfcmd /shutdownWhen you run step 3, you should see some notification in vsperfmon.exe that hello.exe has started.
If you plan on doing multiple test runs, you only need to run steps 2-4. In other words, you only need to instrument your binary (step 1) once after it's built.