[CRIU] [PATCH] zdtm.py: print full pie errors in `grep Error` omitting line breaks

Dmitry Safonov dsafonov at virtuozzo.com
Wed Dec 7 07:19:45 PST 2016


Before:
=[log]=> dump/zdtm/transition/shmem/142/1/dump.log
------------------------ grep Error ------------------------
pie: 1: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 1: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 5: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 5: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 6: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 6: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
------------------------ ERROR OVER ------------------------

After:
=[log]=> dump/zdtm/transition/shmem/62/1/dump.log
------------------------ grep Error ------------------------
pie: 1: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 1: e/asm/parasite.h:45): Failed to dump TLS descriptor #13: -4
pie: 1: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 1: e/asm/parasite.h:45): Failed to dump TLS descriptor #14: -4
pie: 5: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 5: e/asm/parasite.h:45): Failed to dump TLS descriptor #13: -4
pie: 5: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 5: e/asm/parasite.h:45): Failed to dump TLS descriptor #14: -4
pie: 6: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 6: e/asm/parasite.h:45): Failed to dump TLS descriptor #13: -4
pie: 6: Error (/home/travis/build/0x7f454c46/criu/criu/arch/x86/includ>
pie: 6: e/asm/parasite.h:45): Failed to dump TLS descriptor #14: -4
------------------------ ERROR OVER ------------------------

Cc: Andrei Vagin <avagin at virtuozzo.com>
Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
 test/zdtm.py | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/test/zdtm.py b/test/zdtm.py
index a1160e1569f8..efa5ec85f01a 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -1504,15 +1504,26 @@ def print_sep(title, sep = "=", width = 80):
 	print (" " + title + " ").center(width, sep)
 
 
+def print_error(line):
+	line = line.rstrip()
+	print line
+	if line.endswith('>'): # combine pie output
+		return True
+	return False
+
 def grep_errors(fname):
 	first = True
+	print_next = False
 	for l in open(fname):
 		if "Error" in l:
 			if first:
 				print_fname(fname, 'log')
 				print_sep("grep Error", "-", 60)
 				first = False
-			print l,
+			print_next = print_error(l)
+		else:
+			if print_next:
+				print_next = print_error(l)
 	if not first:
 		print_sep("ERROR OVER", "-", 60)
 
-- 
2.10.2



More information about the CRIU mailing list