public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 0/9] dm: core: Support collecting and reporting stats
@ 2022-05-08 10:39 Simon Glass
  2022-05-08 10:39 ` [PATCH 1/9] dm: core: Rename dm_dump_all() Simon Glass
                   ` (8 more replies)
  0 siblings, 9 replies; 25+ messages in thread
From: Simon Glass @ 2022-05-08 10:39 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, U-Boot Custodians, Simon Glass, Bin Meng,
	Heinrich Schuchardt, Marek Behún, Marek Vasut, Ovidiu Panait,
	Pali Rohár, Patrick Delaunay, Pavel Herrmann,
	Ricardo Salveti, Stefan Roese

Driver model can use a lot of memory, as it is the core of all drivers
and devices in U-Boot. Add a command to show how much is in use, along
with the sizes of various data structures.

This patch can be used to analyse the impact of various potential changes
to driver model for SPL, none of which has been implemented. Most involve
shrinking the size of struct udevice, which is a particular problem on
64-bit machines since their pointers are so unnecessarily large in SPL.

To try this out, enable SPL_DM_STATS and then build and run on your
board. You should see output for SPL and U-Boot proper, like this:

   Struct sizes: udevice 90, driver 78, uclass 30, uc_driver 78
   Memory: device 11:990, device names 111, uclass a:1e0

   Attached type    Count   Size    Cur   Tags   Save
   ---------------  -----  -----  -----  -----  -----
   plat                 3     e0    990    914     7c (124)
   parent_plat          2     40    990    910     80 (128)
   uclass_plat          1     10    990    90c     84 (132)
   priv                 6    13d    990    920     70 (112)
   parent_priv          0      0    990    908     88 (136)
   uclass_priv          3     38    990    914     7c (124)
   driver_data          0      0    990    908     88 (136)
   uclass               0      0
   Attached total       f    2a5                   37c (892)
   tags                 0      0

   Total size: e15 (3605)

   With tags:       a99 (2713)
   - singly-linked: 901 (2305)
   - driver index:  88a (2186)
   - uclass index:  813 (2067)
   Drop device name (not SRAM): 111 (273)


Simon Glass (9):
  dm: core: Rename dm_dump_all()
  dm: core: Sort dm subcommands
  dm: core: Fix addresses in the dm static command
  dm: core: Add documentation for the dm command
  dm: core: Switch the testbus driver to use a new struct
  dm: core: Support accessing core tags
  dm: core: Add a way to collect memory usage
  dm: core: Add a command to show driver model statistics
  dm: spl: Allow SPL to show memory usage

 cmd/dm.c                |  69 ++++--
 common/spl/spl.c        |   9 +
 doc/usage/cmd/dm.rst    | 487 ++++++++++++++++++++++++++++++++++++++++
 doc/usage/index.rst     |   1 +
 drivers/core/Kconfig    |  21 ++
 drivers/core/device.c   |  65 ++++++
 drivers/core/dump.c     |  79 ++++++-
 drivers/core/root.c     |  53 +++++
 drivers/core/tag.c      |  29 +++
 drivers/misc/test_drv.c |   6 +-
 include/dm/device.h     |  25 +++
 include/dm/root.h       |  45 ++++
 include/dm/tag.h        |  32 ++-
 include/dm/test.h       |   7 +
 include/dm/util.h       |  11 +-
 test/dm/core.c          |  91 ++++++++
 tools/dtoc/test_dtoc.py |   6 +-
 17 files changed, 1004 insertions(+), 32 deletions(-)
 create mode 100644 doc/usage/cmd/dm.rst

-- 
2.36.0.512.ge40c2bad7a-goog


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2022-07-06  8:38 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-08 10:39 [PATCH 0/9] dm: core: Support collecting and reporting stats Simon Glass
2022-05-08 10:39 ` [PATCH 1/9] dm: core: Rename dm_dump_all() Simon Glass
2022-06-28 13:38   ` Simon Glass
2022-05-08 10:39 ` [PATCH 2/9] dm: core: Sort dm subcommands Simon Glass
2022-06-28 13:38   ` Simon Glass
2022-05-08 10:39 ` [PATCH 3/9] dm: core: Fix addresses in the dm static command Simon Glass
2022-06-28 13:37   ` Simon Glass
2022-05-08 10:39 ` [PATCH 4/9] dm: core: Add documentation for the dm command Simon Glass
2022-06-28 13:37   ` Simon Glass
2022-05-08 10:39 ` [PATCH 5/9] dm: core: Switch the testbus driver to use a new struct Simon Glass
2022-06-28 13:37   ` Simon Glass
2022-05-08 10:39 ` [PATCH 6/9] dm: core: Support accessing core tags Simon Glass
2022-05-09  4:52   ` AKASHI Takahiro
2022-06-28 13:37     ` Simon Glass
2022-06-28 14:18       ` AKASHI Takahiro
2022-07-05 12:39         ` Tom Rini
2022-07-05 13:27           ` Simon Glass
2022-07-06  1:27             ` AKASHI Takahiro
2022-07-06  8:38               ` Simon Glass
2022-05-08 10:39 ` [PATCH 7/9] dm: core: Add a way to collect memory usage Simon Glass
2022-06-28 13:37   ` Simon Glass
2022-05-08 10:39 ` [PATCH 8/9] dm: core: Add a command to show driver model statistics Simon Glass
2022-06-28 13:37   ` Simon Glass
2022-05-08 10:39 ` [PATCH 9/9] dm: spl: Allow SPL to show memory usage Simon Glass
2022-06-28 13:37   ` Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox