2lib: add VB2_DEBUG_RAW() to print without function name

Currently, VB2_DEBUG() will print the function name as a prefix to the
debug output.  Add VB2_DEBUG_RAW() to print without that, so that it's
possible to print little bits of debug output.  Use this in ec_sync to
hex dump the hashes.

And then clean up all of the debug calls which explicitly did things like:
    VB2_DEBUG("%s: foo", __func__);
to just:
    VB2_DEBUG("foo");
so they don't double-print the function name

BUG=chromium:683391
BRANCH=none
TEST=build_packages --board=reef chromeos-firmware &&
     DEBUG=1 make -j runtests
CQ-DEPEND=CL:430978,CL:431111

Change-Id: I0c35519d2e670d55d65d01eaa60d61f3e3edf419
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/431171
Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
Randall Spangler
2017-01-20 14:54:47 -08:00
committed by chrome-bot
parent 1a03740bb0
commit a609478d1a
12 changed files with 131 additions and 147 deletions

View File

@@ -37,7 +37,7 @@ VbError_t ec_sync_all(struct vb2_context *ctx, struct VbCommonParams *cparams)
shared->flags & VBSD_OPROM_MATTERS &&
!(shared->flags & VBSD_OPROM_LOADED));
if (reboot_for_oprom) {
VB2_DEBUG("%s: Reboot to load VGA Option ROM\n", __func__);
VB2_DEBUG("Reboot to load VGA Option ROM\n");
vb2_nv_set(ctx, VB2_NV_OPROM_NEEDED, 1);
}
@@ -49,7 +49,7 @@ VbError_t ec_sync_all(struct vb2_context *ctx, struct VbCommonParams *cparams)
/* Display the wait screen if we need it */
if (need_wait_screen) {
VB2_DEBUG("%s: EC is slow. Show WAIT screen.\n", __func__);
VB2_DEBUG("EC is slow. Show WAIT screen.\n");
VbDisplayScreen(ctx, cparams, VB_SCREEN_WAIT, 0);
}
@@ -72,7 +72,7 @@ VbError_t ec_sync_all(struct vb2_context *ctx, struct VbCommonParams *cparams)
(shared->flags & VBSD_OPROM_MATTERS) &&
(shared->flags & VBSD_OPROM_LOADED) &&
!(shared->flags & VBSD_BOOT_DEV_SWITCH_ON)) {
VB2_DEBUG("%s: Reboot to unload VGA Option ROM\n", __func__);
VB2_DEBUG("Reboot to unload VGA Option ROM\n");
vb2_nv_set(ctx, VB2_NV_OPROM_NEEDED, 0);
return VBERROR_VGA_OPROM_MISMATCH;
}