Merge pull request #9703 from ctiller/bm_fixit

Use pre-existing script for flamegraph generation
pull/9706/head
Craig Tiller 8 years ago committed by GitHub
commit 09173c66f4
  1. 17
      tools/run_tests/run_microbenchmark.py

@ -128,18 +128,19 @@ def collect_perf(bm_name, args):
'CONFIG=mutrace', '-j', '%d' % multiprocessing.cpu_count()]) 'CONFIG=mutrace', '-j', '%d' % multiprocessing.cpu_count()])
for line in subprocess.check_output(['bins/mutrace/%s' % bm_name, for line in subprocess.check_output(['bins/mutrace/%s' % bm_name,
'--benchmark_list_tests']).splitlines(): '--benchmark_list_tests']).splitlines():
subprocess.check_call(['sudo', 'perf', 'record', '-o', 'perf.data', subprocess.check_call(['perf', 'record', '-o', '%s-perf.data' % fnize(line),
'-g', '-c', '1000', '-g', '-c', '1000',
'bins/mutrace/%s' % bm_name, 'bins/mutrace/%s' % bm_name,
'--benchmark_filter=^%s$' % line, '--benchmark_filter=^%s$' % line,
'--benchmark_min_time=20']) '--benchmark_min_time=20'])
subprocess.check_call(['sudo', 'perf', 'script', '-i', 'perf.data', '>', 'bm.perf'], shell=True) env = os.environ.copy()
subprocess.check_call([ env.update({
'%s/stackcollapse-perf.pl' % flamegraph_dir, 'bm.perf', '>', 'bm.folded'], shell=True) 'PERF_BASE_NAME': fnize(line),
link(line, '%s.svg' % fnize(line)) 'OUTPUT_DIR': 'reports',
with open('reports/%s.svg' % fnize(line), 'w') as f: 'OUTPUT_FILENAME': fnize(line),
f.write(subprocess.check_output([ })
'%s/flamegraph.pl' % flamegraph_dir, 'bm.folded'])) subprocess.check_call(['tools/run_tests/performance/process_local_perf_flamegraphs.sh'],
env=env)
def collect_summary(bm_name, args): def collect_summary(bm_name, args):
heading('Summary: %s' % bm_name) heading('Summary: %s' % bm_name)

Loading…
Cancel
Save