VSIntr no data is collected

533 Views Asked by At

I am trying to instrument our application looking for performance optimizations, but I cannot manage to get any data out of it. I am mainly interested in function running times and how many times where they were called.

Can you point to the flaw in my process please?

Here is what I do:

1. VSInstr MyAssembly.dll

This creates the instumented dll (like twice the size) and backs up the original. I get a warning about strong-named things so step 2

2. sn -Ra MyAssembly.dll TheKeyFile.snk

Says resigning is successfull

3. VsPerfCLREnv /traceon

Setting up environment variables

4. Running the program. I go right before the step I want to investigate.

5. VsPerfCmd /start:trace /output:../Reports/Report.vsp

Starting the trace

6. Clicking the button to do the process (app creation) and waiting to finish

7. VSPerfCmd /shutdown

Stop tracing.

8. VSPerfCLREnv /off

Reset environment to normal

At the end of all this I check the Report.vsp file. It is a 148KB file which when opened in VS2017 throws these two error popups and fails to open anything:

  • File contains no data buffers
  • Failed to analyse report
1

There are 1 best solutions below

0
On

The solution was to

  • Use /globaltraceon instead of /traceon
  • First run VsPerfCmd /start:trace and only start the service afterwards
  • Call VSPerfCmd /processon:[PID] to attach to process
  • Stop the service when finished ( /shutdown won't complete otherwise)

So the steps looked like this:

  1. VSInstr MyAssembly.dll
  2. sn -Ra MyAssembly.dll TheKeyFile.snk
  3. VsPerfCLREnv /globaltraceon
  4. Set service on Manual startup
  5. Restart computer
  6. VsPerfCmd /start:trace /output:Reports/Report.vsp
  7. Start service manually
  8. VsPerfCmd /processon: (look up in Task Manager)
  9. Do whatever you want to measure
  10. Stop service
  11. VsPerfCmd /shutdown