| # Copyright (c) 2018, the R8 project authors. Please see the AUTHORS file |
| # for details. All rights reserved. Use of this source code is governed by a |
| # BSD-style license that can be found in the LICENSE file. |
| def run(tool, args, build=None, debug=True, |
| profile=False, track_memory_file=None, extra_args=None): |
| build, args = extract_build_from_args(args) |
| cmd.extend(['tools/track_memory.sh', track_memory_file]) |
| cmd.append('-agentlib:hprof=cpu=samples,interval=1,depth=8') |
| cmd.extend(['-jar', utils.R8_JAR, tool]) |
| return subprocess.call(cmd) |
| def extract_build_from_args(input_args): |
| if arg in ("--build", "--no-build"): |