Importing Valgrind logs

You can import Valgrind logs from text files exported from the IDE or copied from a target where a Valgrind tool was run on an application.

If you run Valgrind through the command line instead of the IDE, you can copy the resulting log file from the target to the host by using the Target File System Navigator.
To import Valgrind logs:
  1. Select File > Import > QNX > Valgrind Log, then click Next.
    Alternatively, if the Analysis Sessions view is open, you can right-click anywhere in it and choose Import Session, select Valgrind Log from the wizard list, then click Next.
  2. In the Import from File field, specify the file containing the log that you're importing.

    You can enter an absolute host path or click Browse to open a popup window that lets you choose a file from the workspace or local filesystem, using a file selector.

    Memcheck and Helgrind each produce one log file named valgrind_pid.txt. So you should select a file with this type of name to import a log written by one of those tools. Massif and Cachegrind each produce two log files. One is named similarly to what's produced by the other two tools but contains only information and warning messages from the Valgrind binary and no session data. You should instead select the other file, which has a name beginning with the tool name (e.g., massif_pid.txt), for importing data.


    Importing Massif session data isn't fully supported at the present time. You can import a Massif log file but the data aren't graphed in the Heap Chart view like they are when you run the tool from the IDE. Instead, the raw text output is listed in the Console view and the heap trees from detailed snapshots are shown in a flat list in the Valgrind view; although, the heap tree button (Icon: Heap tree) to show the memory breakdown isn't available. Thus, it's possible to see but difficult to interpret the stack traces of the program's heap allocations.

    Cachegrind session data also aren't presented properly when imported. In this case, the Valgrind view doesn't work because nothing is shown, so you must read the raw text output in the Console view.

  3. Optional: Click Next to proceed to the Source Lookup window, then specify the source code paths.
    The Source Lookup Path panel lists the paths that the IDE should search to find source code that's related to memory errors or heap data but wasn't compiled on the host. This UI control behaves the same as the Source tab in the launch configuration, meaning you don't need to define these paths if your source code was built on the host.
  4. Click Finish.
    The IDE begins importing the log data into a new session. A new entry appears in Analysis Sessions, with the imported text file listed under the Logs heading. The session header contains the Import string followed by a new, unique session number.

When the import operation finishes, you can view the results from the earlier analysis session. The raw output from the analysis tool is displayed in the Console view, while a more readable format of the output is presented in the Valgrind view.

The following list tells you where to find information about interpreting the output for specific tools: