summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2022-04-11 10:15:06 -0400
committerTom Rini <[email protected]>2022-04-11 10:15:06 -0400
commitc45d38d6515811c05469fe4df6d351d7e4f990f0 (patch)
treef965f66f82242027746ba8bba0abb442aeed09be /doc
parentb598957206e541b3f8876ae34a15fac6da90dcef (diff)
parent02fc867810866904966d45c3e290810c4a196543 (diff)
Merge branch '2022-04-11-initial-valgrind-support'
To quote the author: This series adds support for running valgrind against U-Boot's internal malloc. This allows for much more useful reports to be generated. Some example output of valgrind run against u-boot/master with this branch applied may be found at [1]. Note that valgrind gives up around acpi. This feature still needs a lot of work on suppressions/hints to filter out the noise properly. [1] https://gist.githubusercontent.com/Forty-Bot/199bf06f9cdd6871e54f8f484c16e111/raw/2a2f99108eef84b48e27a54332f3f71f4e2e5342/gistfile1.txt
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 f8804e1f414..e1119492b45 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
-------