summaryrefslogtreecommitdiff
path: root/tools/perf/utils.py
diff options
context:
space:
mode:
author Liz Kammer <eakammer@google.com> 2024-01-31 14:35:03 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2024-01-31 14:35:03 +0000
commit898efbfb7826d80452d9e749d3a6075b71f6853a (patch)
treeed0ff58a40548487491a714648bc1a267151f011 /tools/perf/utils.py
parent675aef236a18f68d6e8ef4238e9d2859e46ab983 (diff)
parent864dd43c07ec24241edcd6056f716bed549255b4 (diff)
Merge "Update benchmarks to handle cog workflows" into main
Diffstat (limited to 'tools/perf/utils.py')
-rw-r--r--tools/perf/utils.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/perf/utils.py b/tools/perf/utils.py
index 934130dc86..0e66d4cd24 100644
--- a/tools/perf/utils.py
+++ b/tools/perf/utils.py
@@ -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()