aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSean Anderson <seanga2@gmail.com>2022-03-23 14:04:50 -0400
committerTom Rini <trini@konsulko.com>2022-04-11 10:00:30 -0400
commit02fc867810866904966d45c3e290810c4a196543 (patch)
treef965f66f82242027746ba8bba0abb442aeed09be /doc
parentbdaeea1b6863b0ec80f2d4bc15d50b8d16efa708 (diff)
downloadu-boot-02fc867810866904966d45c3e290810c4a196543.zip
u-boot-02fc867810866904966d45c3e290810c4a196543.tar.gz
u-boot-02fc867810866904966d45c3e290810c4a196543.tar.bz2
doc: sandbox: Document how to run sandbox with valgrind
This documents how to get more detailed results from valgrind made possible by the last two commits. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'doc')
-rw-r--r--doc/arch/sandbox.rst14
1 files changed, 10 insertions, 4 deletions
diff --git a/doc/arch/sandbox.rst b/doc/arch/sandbox.rst
index f8804e1..e111949 100644
--- a/doc/arch/sandbox.rst
+++ b/doc/arch/sandbox.rst
@@ -477,14 +477,20 @@ Using valgrind / memcheck
It is possible to run U-Boot under valgrind to check memory allocations::
- valgrind u-boot
+ valgrind ./u-boot
+
+For more detailed results, enable `CONFIG_VALGRIND`. There are many false
+positives due to `malloc` itself. Suppress these with::
+
+ valgrind --suppressions=scripts/u-boot.supp ./u-boot
If you are running sandbox SPL or TPL, then valgrind will not by default
notice when U-Boot jumps from TPL to SPL, or from SPL to U-Boot proper. To
-fix this, use::
-
- valgrind --trace-children=yes u-boot
+fix this, use `--trace-children=yes`. To show who alloc'd some troublesome
+memory, use `--track-origins=yes`. To uncover possible errors, try running all
+unit tests with::
+ valgrind --track-origins=yes --suppressions=scripts/u-boot.supp ./u-boot -Tc 'ut all'
Testing
-------