Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/68644 )
Change subject: util/cbmem: Update formatting for cbmem -l command ......................................................................
util/cbmem: Update formatting for cbmem -l command
Some of the cbmem area names have gotten longer, and were making the output of cbmem -l look bad, so expand the name area to 20 characters.
Instead of printing a blank area if the name isn't recognized, call it unknown.
Change the method of printing the title to match the way the actual text of the table is printed.
Signed-off-by: Martin Roth gaumless@gmail.com Change-Id: I9d91d21c6ad418d9fee9880550fb6cb9e41e93f0 Reviewed-on: https://review.coreboot.org/c/coreboot/+/68644 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Julius Werner jwerner@chromium.org Reviewed-by: Eric Lai eric_lai@quanta.corp-partner.google.com --- M util/cbmem/cbmem.c 1 file changed, 28 insertions(+), 5 deletions(-)
Approvals: build bot (Jenkins): Verified Julius Werner: Looks good to me, approved Eric Lai: Looks good to me, but someone else must approve
diff --git a/util/cbmem/cbmem.c b/util/cbmem/cbmem.c index c537a7a..b1c2f89 100644 --- a/util/cbmem/cbmem.c +++ b/util/cbmem/cbmem.c @@ -1185,11 +1185,10 @@
printf("%2d. ", n); if (name == NULL) - printf("\t\t%08x", id); - else - printf("%s\t%08x", name, id); + name = "(unknown)"; + printf("%-20s %08x", name, id); printf(" %08" PRIx64 " ", base); - printf(" %08" PRIx64 "\n", size); + printf(" %08" PRIx64 "\n", size); }
static void dump_cbmem_toc(void) @@ -1204,7 +1203,8 @@ return;
printf("CBMEM table of contents:\n"); - printf(" NAME ID START LENGTH\n"); + printf(" %-20s %-8s %-8s %-8s\n", "NAME", "ID", "START", + "LENGTH");
i = 0; offset = 0;