Valgrind
...
- Valgrind is a programming tool for memory debugging, memory leak detection, and profiling
- It
...
...
...
...
...
...
...
...
...
Build steps
Follow the link for RPi build steps- RDK-B R-Pi Build guide
Installation
By
...
adding
...
the
...
below
...
changes,
...
we
...
can
...
install
...
valgrind
...
in
...
RPI-target
In the <image_recipe.bbappend>
Code Block |
---|
|
IMAGE_INSTALL_APPENDappend += " valgrind" in the <image_recipe.bbappend> |
Valgrind also needs some of the previously defined features, specifically:
$YOCTO_BUILD/conf/local.conf:
Code Block |
---|
|
EXTRA_IMAGE_FEATURES += " dbg-pkgs tools-debug " |
Execution
Command to check memory leak
...
Code Block |
---|
|
valgrind --tool=memcheck --leak-check=full --show-reachable=yes --num-callers=20 --track-fds=yes /usr/bin/<component>
|
Code Block |
---|
|
--tool=memcheck: "To the check the memory"
--leak-check=full: "each individual leak will be shown in detail"
--show-reachable=yes: "When enabled, the leak detector also shows "reachable" and "indirectly lost" blocks"
--num-callers=20: "Specifies the maximum number of entries shown in stack traces that identify program locations"
--track-fds=yes: "When enabled, Valgrind will print out a list of open file descriptors on exit."
/usr/bin/<component>: "Component's binary path" |
Use case:
Sample output of valgrind to reproduce leak for created memory leak
...
...
...
Attached valgrind results for reference,
valgrind_pandm.txt