diff mbox

[U-Boot,v2,04/13] arm: Show early-malloc() usage in bdinfo

Message ID 1467760220-8615-5-git-send-email-sjg@chromium.org
State Accepted
Commit 7f7ddf2a882c13e9a64eae80d1539cc05632a402
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass July 5, 2016, 11:10 p.m. UTC
This is useful information to show how close we are to the limit. At present
it is only available by enabling DEBUG in board_r.c.

Make it available with the 'bdinfo' command also.

Note that this affects ARM only. The bdinfo command is different for each
architecture. Rather than duplicating the code it would be better to
refactor it (as was done with global_data).

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2:
- Add new patch to show early-malloc() usage in bdinfo

 cmd/bdinfo.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Simon Glass July 17, 2016, 9 p.m. UTC | #1
On 5 July 2016 at 17:10, Simon Glass <sjg@chromium.org> wrote:
> This is useful information to show how close we are to the limit. At present
> it is only available by enabling DEBUG in board_r.c.
>
> Make it available with the 'bdinfo' command also.
>
> Note that this affects ARM only. The bdinfo command is different for each
> architecture. Rather than duplicating the code it would be better to
> refactor it (as was done with global_data).
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v2:
> - Add new patch to show early-malloc() usage in bdinfo
>
>  cmd/bdinfo.c | 5 +++++
>  1 file changed, 5 insertions(+)

Applied to u-boot-dm.
diff mbox

Patch

diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
index 1c4bed9..2b106c7 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -416,6 +416,11 @@  static int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc,
 #ifdef CONFIG_BOARD_TYPES
 	printf("Board Type  = %ld\n", gd->board_type);
 #endif
+#ifdef CONFIG_SYS_MALLOC_F
+	printf("Early malloc usage: %lx / %x\n", gd->malloc_ptr,
+	       CONFIG_SYS_MALLOC_F_LEN);
+#endif
+
 	return 0;
 }