mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 4/9] memtest: Make output more compact
Date: Tue, 27 Oct 2015 09:29:57 +0100	[thread overview]
Message-ID: <1445934602-25903-5-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1445934602-25903-1-git-send-email-s.hauer@pengutronix.de>

Especially when called multiple times the output of the memory test
is quite verbose. Make it more compact by only describing once what
is being done and only use one progress bare instead of three.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/memtest.c | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/common/memtest.c b/common/memtest.c
index 4a84dc3..0559359 100644
--- a/common/memtest.c
+++ b/common/memtest.c
@@ -344,8 +344,8 @@ int mem_test_moving_inversions(resource_size_t _start, resource_size_t _end)
 	start = (resource_size_t *)_start;
 	num_words = (_end - _start + 1)/sizeof(resource_size_t);
 
-	printf("Starting integrity check of physicaly ram.\n"
-	       "Filling ram with patterns...\n");
+	printf("Starting moving inversions test of RAM:\n"
+	       "Fill with address, compare, fill with inverted address, compare again\n");
 
 	/*
 	 * Description: Test the integrity of a physical
@@ -358,11 +358,11 @@ int mem_test_moving_inversions(resource_size_t _start, resource_size_t _end)
 	 *		selected by the caller.
 	 */
 
+	init_progression_bar(3 * num_words);
+
 	/*
 	 * Fill memory with a known pattern.
 	 */
-	init_progression_bar(num_words);
-
 	for (offset = 0; offset < num_words; offset++) {
 		/*
 		 * Every 4K we update the progressbar.
@@ -375,18 +375,15 @@ int mem_test_moving_inversions(resource_size_t _start, resource_size_t _end)
 		}
 		start[offset] = offset + 1;
 	}
-	show_progress(offset);
 
-	printf("\nCompare written patterns...\n");
 	/*
 	 * Check each location and invert it for the second pass.
 	 */
-	init_progression_bar(num_words - 1);
 	for (offset = 0; offset < num_words; offset++) {
 		if (!(offset & (SZ_4K - 1))) {
 			if (ctrlc())
 				return -EINTR;
-			show_progress(offset);
+			show_progress(num_words + offset);
 		}
 
 		temp = start[offset];
@@ -401,18 +398,15 @@ int mem_test_moving_inversions(resource_size_t _start, resource_size_t _end)
 		anti_pattern = ~(offset + 1);
 		start[offset] = anti_pattern;
 	}
-	show_progress(offset);
 
-	printf("\nFilling ram with inverted pattern and compare it...\n");
 	/*
 	 * Check each location for the inverted pattern and zero it.
 	 */
-	init_progression_bar(num_words - 1);
 	for (offset = 0; offset < num_words; offset++) {
 		if (!(offset & (SZ_4K - 1))) {
 			if (ctrlc())
 				return -EINTR;
-			show_progress(offset);
+			show_progress(2 * num_words + offset);
 		}
 
 		anti_pattern = ~(offset + 1);
@@ -428,7 +422,7 @@ int mem_test_moving_inversions(resource_size_t _start, resource_size_t _end)
 
 		start[offset] = 0;
 	}
-	show_progress(offset);
+	show_progress(3 * num_words);
 
 	/*
 	 * end of progressbar
-- 
2.6.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2015-10-27  8:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-27  8:29 memtest updates Sascha Hauer
2015-10-27  8:29 ` [PATCH 1/9] memtest: move request/release regions to common/ Sascha Hauer
2015-10-27  8:29 ` [PATCH 2/9] rework remap_range Sascha Hauer
2015-10-27  8:29 ` [PATCH 3/9] memtest: split tests in separate functions Sascha Hauer
2015-10-27  8:29 ` Sascha Hauer [this message]
2015-10-27  8:29 ` [PATCH 5/9] memtest: Make comments single line when appropriate Sascha Hauer
2015-10-27  8:29 ` [PATCH 6/9] memtest: move ctrlc check / progress showing into separate function Sascha Hauer
2015-10-27  8:30 ` [PATCH 7/9] memtest: move error handling to end of function Sascha Hauer
2015-10-27  8:30 ` [PATCH 8/9] memtest: By default only test biggest region Sascha Hauer
2015-10-27  8:30 ` [PATCH 9/9] memtest: Make cached/uncached test configurable Sascha Hauer
2015-10-27 16:55 ` memtest updates Alexander Aring
2015-10-27 17:27   ` Alexander Aring
2015-10-27 17:35     ` Alexander Aring
2015-10-28  6:17   ` Sascha Hauer
2015-10-28  9:11     ` Alexander Aring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1445934602-25903-5-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox