summaryrefslogtreecommitdiff
path: root/clang/utils
diff options
context:
space:
mode:
authorAmir Ayupov <aaupov@fb.com>2023-01-09 18:07:26 -0800
committerAmir Ayupov <amir.aupov@gmail.com>2023-01-17 21:54:00 -0800
commit5725c8ddd46becff95629515b1f0a26af047aa33 (patch)
treecd922185d26415d66824352a2f3f5a787d0ff01a /clang/utils
parent406800cbfee304fe3f46d38299fa706db1b2df15 (diff)
downloadllvm-5725c8ddd46becff95629515b1f0a26af047aa33.tar.gz
[perf-training] Check extension in findFilesWithExtension
`findFilesWithExtension` helper checks for `endswith(extension)` instead of exactly matching the file extension. This causes it to match unrelated files, for example, `.profdata` files while matching `.fdata` files: http://157.230.108.44:8011/#/builders/56/builds/247 ``` Merging data from /worker/worker/bolt-x86_64-ubuntu-clang-bolt-gcc/build/tools/clang/prof.fdata.1124569.fdata... Merging data from /worker/worker/bolt-x86_64-ubuntu-clang-bolt-gcc/build/tools/clang/test/Frontend/Output/optimization-remark-with-hotness-new-pm.c.tmp.profdata... ``` Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D141342
Diffstat (limited to 'clang/utils')
-rw-r--r--clang/utils/perf-training/perf-helper.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/utils/perf-training/perf-helper.py b/clang/utils/perf-training/perf-helper.py
index c6a815e65473..abbdc77b2372 100644
--- a/clang/utils/perf-training/perf-helper.py
+++ b/clang/utils/perf-training/perf-helper.py
@@ -23,7 +23,7 @@ def findFilesWithExtension(path, extension):
filenames = []
for root, dirs, files in os.walk(path):
for filename in files:
- if filename.endswith(extension):
+ if filename.endswith(f".{extension}"):
filenames.append(os.path.join(root, filename))
return filenames