]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
task: run osd/mds/mon with Google CPU profiler via cpu_profile option
authorMike Ryan <mike.ryan@inktank.com>
Fri, 17 Aug 2012 20:47:13 +0000 (13:47 -0700)
committerMike Ryan <mike.ryan@inktank.com>
Fri, 17 Aug 2012 20:47:13 +0000 (13:47 -0700)
Signed-off-by: Mike Ryan <mike.ryan@inktank.com>
teuthology/task/ceph.py

index 81d376a08dcf57457cf14dc043642208ae326916..eae912f0609bc2d0fa809aa42979becd554456d6 100644 (file)
@@ -848,6 +848,10 @@ def run_daemon(ctx, config, type_):
                     valgrind_args = config['valgrind'][name]
                 run_cmd.extend(teuthology.get_valgrind_args(name, valgrind_args))
 
+            if type_ in config.get('cpu_profile'):
+                profile_path = '/tmp/cephtest/archive/log/%s.%s.prof' % (type_, id_)
+                run_cmd.extend([ 'env', 'CPUPROFILE=%s' % profile_path ])
+
             run_cmd.extend(run_cmd_tail)
             ctx.daemons.add_daemon(remote, type_, id_,
                                    args=run_cmd,
@@ -1063,6 +1067,7 @@ def task(ctx, config):
                 block_journal=config.get('block_journal', None),
                 tmpfs_journal=config.get('tmpfs_journal', None),
                 log_whitelist=config.get('log-whitelist', []),
+                cpu_profile=set(config.get('cpu_profile', [])),
                 )),
         lambda: run_daemon(ctx=ctx, config=config, type_='mon'),
         lambda: run_daemon(ctx=ctx, config=config, type_='osd'),