From fe4221848f86ab97d2c439299826d97e48542404 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Wed, 2 May 2012 16:33:18 -0700 Subject: Make CBFS output more consistent - Prefix all CBFS output messages with CBFS: - Add an option DEBUG_CBFS that is off by default. Without DEBUG_CBFS enabled, the code will no longer print all the files it walks for every file lookup. - Add DEBUG() macro next to LOG() and ERROR() to specify which messages should only be visible with DEBUG_CBFS printed. - Actually print a message when the file we're looking for was found. :) old: Searching for fallback/coreboot_ram Check cmos_layout.bin Check pci8086,0106.rom Check fallback/romstage Check fallback/coreboot_ram Change-Id: I2d731fae17a5f6ca51d435cfb7a58d6e017efa24 Stage: loading fallback/coreboot_ram @ 0x100000 (540672 bytes), entry @ 0x100000 Stage: done loading. new: CBFS: Looking for 'fallback/coreboot_ram' CBFS: found. CBFS: loading stage fallback/coreboot_ram @ 0x100000 (507904 bytes), entry @ 0x100000 CBFS: stage loaded. Signed-off-by: Stefan Reinauer Reviewed-on: http://review.coreboot.org/993 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich --- src/lib/cbfs_core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/lib/cbfs_core.c') diff --git a/src/lib/cbfs_core.c b/src/lib/cbfs_core.c index 4bf755b0f8..15cb68e9bc 100644 --- a/src/lib/cbfs_core.c +++ b/src/lib/cbfs_core.c @@ -40,6 +40,9 @@ * print an error message x (in printf format) * * LOG(x...) + * print a message x (in printf format) + * + * DEBUG(x...) * print a debug message x (in printf format) * * romstart() @@ -86,7 +89,7 @@ struct cbfs_file *cbfs_find(const char *name) struct cbfs_header *header = get_cbfs_header(); if (header == (void*)0xffffffff) return NULL; - LOG("Searching for %s\n", name); + LOG("Looking for '%s'\n", name); void *data, *dataend, *origdata; /* find first entry */ @@ -111,8 +114,9 @@ struct cbfs_file *cbfs_find(const char *name) data = phys_to_virt(CBFS_ALIGN_UP(virt_to_phys(data), align)); continue; } - LOG("Check %s\n", CBFS_NAME(file)); + DEBUG("Check '%s'\n", CBFS_NAME(file)); if (strcmp(CBFS_NAME(file), name) == 0) { + LOG("found.\n"); return file; } void *olddata = data; -- cgit v1.2.3