Valgrind Tools

The Valgrind Tool Suite v3.12.0 is included with Ref-OS-IoT (see http://www.valgrind.org). Valgrind's tools allow advanced analysis of how your programs perform memory management, threading and other features. The tools included in this port of the suite are:

  • Memcheck
  • Cachegrind
  • Callgrind
  • Massif
  • Helgrind
  • DRD

To analyse a process simply call valgrind with parameters for the analysis tool and the process under test. For example, to analyse the memory management of the OS function 'date' enter the following to the command line.

valgrind --tool=memcheck date

The terminal will show statistics and, depending on the tool, an analysis file will be generated in the current folder.

root@intel-5xx-64:~# valgrind --tool=memcheck date
==1069== Memcheck, a memory error detector
==1069== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==1069== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==1069== Command: date
==1069==
Wed Apr  5 23:56:04 UTC 2017
==1069==
==1069== HEAP SUMMARY:
==1069==     in use at exit: 128 bytes in 1 blocks
==1069==   total heap usage: 9 allocs, 8 frees, 8,996 bytes allocated
==1069==
==1069== LEAK SUMMARY:
==1069==    definitely lost: 128 bytes in 1 blocks
==1069==    indirectly lost: 0 bytes in 0 blocks
==1069==      possibly lost: 0 bytes in 0 blocks
==1069==    still reachable: 0 bytes in 0 blocks
==1069==         suppressed: 0 bytes in 0 blocks
==1069== Rerun with --leak-check=full to see details of leaked memory
==1069==
==1069== For counts of detected and suppressed errors, rerun with: -v
==1069== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

For more information on Valgrind and its uses check http://www.valgrind.org/docs/manual/manual.html

 

For more complete information about compiler optimizations, see our Optimization Notice.