Loading tools/perf/benchmarks +7 −1 Original line number Diff line number Diff line Loading @@ -131,8 +131,14 @@ def Clean(): """Remove the out directory.""" def remove_out(): out_dir = utils.get_out_dir() #only remove actual contents, in case out is a symlink (as is the case for cog) if os.path.exists(out_dir): shutil.rmtree(out_dir) for filename in os.listdir(out_dir): p = os.path.join(out_dir, filename) if os.path.isfile(p) or os.path.islink(p): os.remove(p) elif os.path.isdir(p): shutil.rmtree(p) return Change(label="Remove out", change=remove_out, undo=lambda: None) Loading tools/perf/utils.py +4 −2 Original line number Diff line number Diff line Loading @@ -19,9 +19,11 @@ DEFAULT_REPORT_DIR = "benchmarks" def get_root(): top_dir = os.environ.get("ANDROID_BUILD_TOP") if top_dir: return pathlib.Path(top_dir).resolve() d = pathlib.Path.cwd() # with cog, someone may have a new workspace and new source tree top, but # not run lunch yet, resulting in a misleading ANDROID_BUILD_TOP value if top_dir and d.is_relative_to(top_dir): return pathlib.Path(top_dir).resolve() while True: if d.joinpath("build", "soong", "soong_ui.bash").exists(): return d.resolve().absolute() Loading Loading
tools/perf/benchmarks +7 −1 Original line number Diff line number Diff line Loading @@ -131,8 +131,14 @@ def Clean(): """Remove the out directory.""" def remove_out(): out_dir = utils.get_out_dir() #only remove actual contents, in case out is a symlink (as is the case for cog) if os.path.exists(out_dir): shutil.rmtree(out_dir) for filename in os.listdir(out_dir): p = os.path.join(out_dir, filename) if os.path.isfile(p) or os.path.islink(p): os.remove(p) elif os.path.isdir(p): shutil.rmtree(p) return Change(label="Remove out", change=remove_out, undo=lambda: None) Loading
tools/perf/utils.py +4 −2 Original line number Diff line number Diff line Loading @@ -19,9 +19,11 @@ DEFAULT_REPORT_DIR = "benchmarks" def get_root(): top_dir = os.environ.get("ANDROID_BUILD_TOP") if top_dir: return pathlib.Path(top_dir).resolve() d = pathlib.Path.cwd() # with cog, someone may have a new workspace and new source tree top, but # not run lunch yet, resulting in a misleading ANDROID_BUILD_TOP value if top_dir and d.is_relative_to(top_dir): return pathlib.Path(top_dir).resolve() while True: if d.joinpath("build", "soong", "soong_ui.bash").exists(): return d.resolve().absolute() Loading