diff options
author | Jakub Czapiga <jacz@semihalf.com> | 2022-09-07 13:51:30 +0200 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-09-10 05:47:07 +0000 |
commit | 62cc7885eab5d5ab0a7d773fb5284b4ca9ee097c (patch) | |
tree | 19c6336af2e10bf164194f989ba9cf4040c0f31a /futility/misc.c | |
parent | 3bd35108579db497b006b81e77794739b5118592 (diff) | |
download | vboot-stabilize-15117.86.B.tar.gz |
subprocess: Log subprocess arguments when runningstabilize-15117.86.Bstabilize-15117.48.Bstabilize-15117.111.Brelease-R107-15117.B
Utility programs in vboot sometimes use subprocess_run to execute
another program like flashrom or cbfstool. This change makes it easier
to debug these utilities by logging executed subprocess and its
arguments.
This change also fixes futility vb2ex_printf() implementation.
Previously use of VB2_DEBUG_RAW() calling vb2ex_printf(NULL, ...) was
unnecessarily trying to print NULL as function name, which was not
intended behavior.
TEST=sign image and look for "Run: cbfstool ..."
BUG=none
BRANCH=none
Signed-off-by: Jakub Czapiga <czapiga@google.com>
Change-Id: I613d4af4af4370425cbbedc2d7de29a488533c6a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3878593
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
Diffstat (limited to 'futility/misc.c')
-rw-r--r-- | futility/misc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/futility/misc.c b/futility/misc.c index 874039f0..7d261c2c 100644 --- a/futility/misc.c +++ b/futility/misc.c @@ -39,7 +39,8 @@ void vb2ex_printf(const char *func, const char *format, ...) va_list ap; va_start(ap, format); - fprintf(stderr, "DEBUG: %s: ", func); + if (func) + fprintf(stderr, "DEBUG: %s: ", func); vfprintf(stderr, format, ap); va_end(ap); } |