[Crash-utility] [PATCH] When using Brent algo for list command, print loop length in decimal.

Dave Wysochanski dwysocha at redhat.com
Wed Apr 24 15:11:49 UTC 2019


Probably the loop length should be printed in decimal rather than hex.

Example of output today:
crash> list -B -r 0xffff88e4906ea390 | wc
list: loop detected, loop length: 3c7
list: length from start to loop: 3
list: duplicate list entry: ffffffff819c1890
   1993    2008   33948
crash> pd 0x3c7
$5 = 967

Example of new output:
crash> list -B -r 0xffff88e4906ea390 | wc
list: loop detected, loop length: 967
list: length from start to loop: 3
list: duplicate list entry: ffffffff819c1890
   1993    2008   33948

Signed-off-by: Dave Wysochanski <dwysocha at redhat.com>
---
 tools.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools.c b/tools.c
index 43b838a..eceea90 100644
--- a/tools.c
+++ b/tools.c
@@ -4086,7 +4086,7 @@ do_list_no_hash(struct list_data *ld)
 		if (!brent_loop_detect) {
 			if (brent_x == brent_y) {
 				brent_loop_detect = 1;
-				error(INFO, "loop detected, loop length: %lx\n", brent_lambda);
+				error(INFO, "loop detected, loop length: %ld\n", brent_lambda);
 				/* reset x and y to start; advance y loop length */
 				brent_mu = 0;
 				brent_x = brent_y = ld->start;
-- 
1.8.3.1




More information about the Crash-utility mailing list