4

I am attempting to profile a MEX (.mexw64) file using Visual Studio Community Edition 2019.

This MEX file was created from a C++ file that we wrote, and was compiled using GCC and G++, with debugging symbols enabled. (-g, not -g3 if that matters)

Here were my steps:

1: Open MATLAB

2: Run the script until the point before the MEX is called using a breakpoint

3: Attach MATLAB to VS using Analyze, then Performance Profiler..., then Choose Target, and selecting Running Process and choosing MATLAB (R2016b)

3.5: Select "CPU usage data" from the two options.

4: Start collection

5: Quickly go back to MATLAB, start the script

6: Wait for MEX call to finish (about 6 seconds total)

7: Choose "Stop collection" in Visual Studio

The result is that it says "Preparing data. The output window may contain additional information".

When I choose "Open Details" I just get a window that says "Preparing CPU usage data...74%" and it hasn't budged in half an hour.

Anyone have any thoughts on how to fix this?

EDIT: It looks like if I select a time slice from that 6 seconds that wasn't where the MEX call was made, it does actually work and provide some info. (Seems like lots of dlls that MATLAB uses) but that doesn't help me at all since I need info about the MEX file and that's it.

Tyler Shellberg
  • 1,086
  • 11
  • 28

0 Answers0