public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sean Anderson <seanga2@gmail.com>
To: Tom Rini <trini@konsulko.com>, u-boot@lists.denx.de
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Simon Glass <sjg@chromium.org>, Sean Anderson <seanga2@gmail.com>
Subject: [PATCH v3 3/3] doc: sandbox: Document how to run sandbox with valgrind
Date: Wed, 23 Mar 2022 14:04:50 -0400	[thread overview]
Message-ID: <20220323180451.48950-4-seanga2@gmail.com> (raw)
In-Reply-To: <20220323180451.48950-1-seanga2@gmail.com>

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>

---

(no changes since v1)

 doc/arch/sandbox.rst | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/doc/arch/sandbox.rst b/doc/arch/sandbox.rst
index f8804e1f41..e1119492b4 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
 -------
-- 
2.35.1


  parent reply	other threads:[~2022-03-23 18:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-23 18:04 [PATCH v3 0/3] malloc: Enable profiling dlmalloc with valgrind Sean Anderson
2022-03-23 18:04 ` [PATCH v3 1/3] Add valgrind headers to U-Boot Sean Anderson
2022-04-11 14:17   ` Tom Rini
2022-03-23 18:04 ` [PATCH v3 2/3] malloc: Annotate allocator for valgrind Sean Anderson
2022-04-11 14:17   ` Tom Rini
2022-03-23 18:04 ` Sean Anderson [this message]
2022-04-11 14:17   ` [PATCH v3 3/3] doc: sandbox: Document how to run sandbox with valgrind Tom Rini
2022-03-30 18:13 ` [PATCH v3 0/3] malloc: Enable profiling dlmalloc " Sean Anderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220323180451.48950-4-seanga2@gmail.com \
    --to=seanga2@gmail.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox