From 94f0ba1efe73c1927615ab8feae649b2c5991346 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 14 Mar 2012 13:20:54 -0700 Subject: [PATCH] run valgrind with cwd set to /tmp/cephtest/archive/coredump This lets us capture the vgcore.* files, which always go to valgrind's cwd. Fixes: #1953 --- teuthology/misc.py | 2 ++ teuthology/task/ceph.py | 2 +- teuthology/task/chdir-coredump | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 teuthology/task/chdir-coredump diff --git a/teuthology/misc.py b/teuthology/misc.py index ff630cb577f14..22f503c243f40 100644 --- a/teuthology/misc.py +++ b/teuthology/misc.py @@ -488,11 +488,13 @@ def get_valgrind_args(name, v): val_path = '/tmp/cephtest/archive/log/valgrind' if '--tool=memcheck' in v or '--tool=helgrind' in v: extra_args = [ + '/tmp/cephtest/chdir-coredump', 'valgrind', '--xml=yes', '--xml-file={vdir}/{n}.log'.format(vdir=val_path, n=name) ] else: extra_args = [ + '/tmp/cephtest/chdir-coredump', 'valgrind', '--log-file={vdir}/{n}.log'.format(vdir=val_path, n=name) ] diff --git a/teuthology/task/ceph.py b/teuthology/task/ceph.py index 43f31bace96cc..24ad1126b3d2b 100644 --- a/teuthology/task/ceph.py +++ b/teuthology/task/ceph.py @@ -121,7 +121,7 @@ def ceph_log(ctx, config): @contextlib.contextmanager def ship_utilities(ctx, config): assert config is None - FILES = ['daemon-helper', 'enable-coredump'] + FILES = ['daemon-helper', 'enable-coredump', 'chdir-coredump'] for filename in FILES: log.info('Shipping %r...', filename) src = os.path.join(os.path.dirname(__file__), filename) diff --git a/teuthology/task/chdir-coredump b/teuthology/task/chdir-coredump new file mode 100644 index 0000000000000..cf1acd45496aa --- /dev/null +++ b/teuthology/task/chdir-coredump @@ -0,0 +1,7 @@ +#!/bin/sh +set -e + +# valgrind only dumps to cwd, so cwd there... +cd /tmp/cephtest/archive/coredump + +exec "$@" -- 2.39.5