summaryrefslogtreecommitdiff
path: root/futility/futility.c
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2019-03-05 13:56:41 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-03-06 15:33:45 -0800
commit5160e69144fa472461054700d5d172ee0963da2e (patch)
tree5f2727432fd66ca0133a945e7b2d83f34211966d /futility/futility.c
parentedf6a8889aaabfc6446957f897f98c7a7e622298 (diff)
downloadvboot-5160e69144fa472461054700d5d172ee0963da2e.tar.gz
futility: Merge Debug() into VB2_DEBUG()
Futility has two debug facilities: the Debug() function that can be enabled by passing --debug on the command line, and the VB2_DEBUG() macro (mostly in common code from the firmware/ directory that it includes) which can only be enabled by passing DEBUG=1 at build time. This is confusing and inconvenient, since you don't always want to rebuild futility whenever you need that extra debug output and it's not very obvious that you can get even more debugging beyond just passing --debug. This patch resolves the inconsistency by merging both facilities together into a single VB2_DEBUG() that is output when passing --debug. In order to make this work, we'll have to move the VBOOT_DEBUG #define so that it only affects the stub implementation of vb2ex_printf(), and any caller overriding the stub is in charge of their own destiny. This should be okay since callers can still individually implement debugging policy in their versions of vb2ex_printf() if they want to. (This may have been useful to cut down the binary space for debugging strings, but our firmware has always been unconditionally enabling VBOOT_DEBUG in the past years, so that doesn't seem to be very important in practice.) BRANCH=None BUG=None TEST=Ran futility --debug show, noticed I got all the extra keyblock verification debug output I always wanted. Change-Id: I9a5c205fc3673941b50f03f2a967b1be110a1555 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1504140 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'futility/futility.c')
-rw-r--r--futility/futility.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/futility/futility.c b/futility/futility.c
index 6cea6814..f0a42e20 100644
--- a/futility/futility.c
+++ b/futility/futility.c
@@ -220,9 +220,9 @@ static void list_commands(void)
static int run_command(const struct futil_cmd_t *cmd, int argc, char *argv[])
{
int i;
- Debug("%s(\"%s\") ...\n", __func__, cmd->name);
+ VB2_DEBUG("\"%s\" ...\n", cmd->name);
for (i = 0; i < argc; i++)
- Debug(" argv[%d] = \"%s\"\n", i, argv[i]);
+ VB2_DEBUG(" argv[%d] = \"%s\"\n", i, argv[i]);
return cmd->handler(argc, argv);
}
@@ -347,7 +347,7 @@ int main(int argc, char *argv[], char *envp[])
case 0: /* handled option */
break;
default:
- Debug("i=%d\n", i);
+ VB2_DEBUG("i=%d\n", i);
DIE;
}
}