From aab84acda8676a82439b3ee0c905cc2db5c6ffce Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Sat, 13 Jun 2020 19:59:17 +1000 Subject: [PATCH] scripts/mw_debug: Make progress counts display on one line This outputs a carriage return rather than a newline after the display of the progress count during the load and save operations. This makes the output more compact and better looking. Signed-off-by: Paul Mackerras --- scripts/mw_debug/mw_debug.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/mw_debug/mw_debug.c b/scripts/mw_debug/mw_debug.c index c58073b..7f77558 100644 --- a/scripts/mw_debug/mw_debug.c +++ b/scripts/mw_debug/mw_debug.c @@ -507,8 +507,10 @@ static void load(const char *filename, uint64_t addr) // if (rc < 8) XXX fixup endian ? check(dmi_write(DBG_WB_DATA, data), "writing WB_DATA"); count += 8; - if (!(count % 1024)) - printf("%x...\n", count); + if (!(count % 1024)) { + printf("%x...\r", count); + fflush(stdout); + } } close(fd); printf("%x done.\n", count); @@ -535,8 +537,10 @@ static void save(const char *filename, uint64_t addr, uint64_t size) break; } count += 8; - if (!(count % 1024)) - printf("%x...\n", count); + if (!(count % 1024)) { + printf("%x...\r", count); + fflush(stdout); + } if (count >= size) break; }