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

@@ -628,6 +628,18 @@ int vb2ex_read_resource(struct vb2_context *ctx,
void *buf,
uint32_t size);
/**
* Print debug output
*
* This should work like printf(). If func!=NULL, it will be a string with
* the current function name; that can be used to generate prettier debug
* output. If func==NULL, don't print any extra header/trailer so that this
* can be used to composite a bigger output string from several calls - for
* example, when doing a hex dump.
*
* @param func Function name generating output, or NULL.
* @param fmt Printf format string
*/
void vb2ex_printf(const char *func, const char *fmt, ...);
/**