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 0/3] malloc: Enable profiling dlmalloc with valgrind
Date: Wed, 23 Mar 2022 14:04:47 -0400	[thread overview]
Message-ID: <20220323180451.48950-1-seanga2@gmail.com> (raw)

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

Changes in v3:
- Fix some warnings by converting some macros to use
  VALGRIND_DO_CLIENT_REQUEST_STMT
- Fix an additional rEALLOc branch missing VALGRIND_RESIZEINPLACE_BLOCK

Changes in v2:
- Fix one branch of rEALLOc missing a VALGRIND_*_BLOCK call
- Add some additional suppressions for cALLOc and rEALLOc
- Simplify calloc clearing logic
- Drop incorrect sbrk patch

Sean Anderson (3):
  Add valgrind headers to U-Boot
  malloc: Annotate allocator for valgrind
  doc: sandbox: Document how to run sandbox with valgrind

 Kconfig                     |   14 +
 Licenses/README             |    1 +
 Licenses/bzip2-1.0.6.txt    |   30 +
 common/dlmalloc.c           |   31 +-
 common/malloc_simple.c      |   10 +
 doc/arch/sandbox.rst        |   14 +-
 include/malloc.h            |    4 +
 include/valgrind/memcheck.h |  251 ++
 include/valgrind/valgrind.h | 7106 +++++++++++++++++++++++++++++++++++
 scripts/u-boot.supp         |   53 +
 10 files changed, 7509 insertions(+), 5 deletions(-)
 create mode 100644 Licenses/bzip2-1.0.6.txt
 create mode 100644 include/valgrind/memcheck.h
 create mode 100644 include/valgrind/valgrind.h
 create mode 100644 scripts/u-boot.supp

-- 
2.35.1


             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 Sean Anderson [this message]
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 ` [PATCH v3 3/3] doc: sandbox: Document how to run sandbox with valgrind Sean Anderson
2022-04-11 14:17   ` 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-1-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