summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2019-08-28 18:10:06 -0700
committerCommit Bot <commit-bot@chromium.org>2019-08-30 00:37:38 +0000
commit6f55ca108752f87e264f465914bc8aa5a7f0e861 (patch)
treee12d55940e033987612d83a46620f28951668ab2
parenta15ef31af52679f715a10589ef89b4343141dd91 (diff)
downloadchrome-ec-6f55ca108752f87e264f465914bc8aa5a7f0e861.tar.gz
flash_log: prevent console output garbling
Dumping the flash log including many short entries results in garbled console output. Let's move cflush() invocation to the main loop, it is not a problem for a console command be throttled like this. BRANCH=cr50 BUG=none TEST=verified that flash logs of many short and long messages are printed out accurately. Change-Id: Id4b988d4eab29aaf118d6495f9a3d61e5d9f9a56 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1776335 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
-rw-r--r--common/flash_log.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/common/flash_log.c b/common/flash_log.c
index c59511a3b5..798f48a2a6 100644
--- a/common/flash_log.c
+++ b/common/flash_log.c
@@ -542,13 +542,12 @@ static int command_flash_log(int argc, char **argv)
ccprintf("%10u:%02x", e.r.timestamp, e.r.type);
for (i = 0; i < FLASH_LOG_PAYLOAD_SIZE(e.r.size); i++) {
- if (i && !(i % 16)) {
+ if (i && !(i % 16))
ccprintf("\n ");
- cflush();
- }
ccprintf(" %02x", e.r.payload[i]);
}
ccprintf("\n");
+ cflush();
stamp = e.r.timestamp;
}
if (rv)