From fa63dd421338a08bb725be81dfc987f001d3b169 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 17 Nov 2012 16:19:14 -0800 Subject: [PATCH] valgrind: enumerate warnings in log; check leaks from client, mon only --- teuthology/task/ceph.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/teuthology/task/ceph.py b/teuthology/task/ceph.py index 7e05d837a0ec9..256eeadb7fa73 100644 --- a/teuthology/task/ceph.py +++ b/teuthology/task/ceph.py @@ -287,22 +287,34 @@ def valgrind_post(ctx, config): #look at valgrind logs for each node proc = remote.run( args=[ - 'grep', '-r', "", run.Raw(val_path), run.Raw('|'), - 'egrep', '-v', '-q', '(PossiblyLost|DefinitelyLost)'], + 'grep', '-r', '', + run.Raw(val_path), + run.Raw('|'), + 'sort', + run.Raw('|'), + 'uniq', + ], wait = False, - check_status=False + check_status=False, + stdout=StringIO(), ) lookup_procs.append((proc, remote)) valgrind_exception = None for (proc, remote) in lookup_procs: - result = proc.exitstatus.get() - if result != 1: - valgrind_exception = Exception("saw valgrind issues in {node}".format(node=remote.name)) + out = proc.stdout.getvalue() + for line in out.split('\n'): + if line == '': + continue + (file, kind) = line.split(':') + log.debug('file %s kind %s', file, kind) + if file.find('client') < 0 and file.find('mon') < 0 and kind.find('Lost') > 0: + continue + log.error('saw valgrind issue %s in %s', kind, file) + valgrind_exception = Exception('saw valgrind issues') if valgrind_exception is not None: raise valgrind_exception - @contextlib.contextmanager def cluster(ctx, config): -- 2.39.5