Yu-Ping Wu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38257 )
Change subject: [DO-NOT-SUBMIT] Print remaining memory ......................................................................
[DO-NOT-SUBMIT] Print remaining memory
Change-Id: Ifcd412099a1e3a023eba4a490ac3565e1f27d136 Signed-off-by: Yu-Ping Wu yupingso@chromium.org --- M payloads/libpayload/libc/malloc.c 1 file changed, 9 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/57/38257/1
diff --git a/payloads/libpayload/libc/malloc.c b/payloads/libpayload/libc/malloc.c index 5107589..cca1326 100644 --- a/payloads/libpayload/libc/malloc.c +++ b/payloads/libpayload/libc/malloc.c @@ -126,6 +126,7 @@
static void *alloc(int len, struct memory_type *type) { + int p = (type == heap); hdrtype_t header; hdrtype_t volatile *ptr = (hdrtype_t volatile *)type->start;
@@ -145,6 +146,10 @@ #endif }
+ if (p) { + printf("grootmalloc: len = %d, end = %lu\n", + len, (uintptr_t)type->end); + } /* Find some free space. */ do { header = *ptr; @@ -158,6 +163,10 @@ }
if (header & FLAG_FREE) { + if (p && size > 8192) { + printf("grootmalloc: try %lu, size = %d\n", + (uintptr_t)ptr, size); + } if (len <= size) { hdrtype_t volatile *nptr = (hdrtype_t volatile *)((uintptr_t)ptr + HDRSIZE + len); int nsize = size - (HDRSIZE + len);
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38257 )
Change subject: [DO-NOT-SUBMIT] Print remaining memory ......................................................................
Patch Set 1: Code-Review-1
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38257 )
Change subject: [DO-NOT-SUBMIT] Print remaining memory ......................................................................
Patch Set 1:
Wouldn’t hurt to have something like this in libpayload.
Yu-Ping Wu has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/38257 )
Change subject: [DO-NOT-SUBMIT] Print remaining memory ......................................................................
Abandoned