Skip to content

Commit 1fbbf92

Browse files
committed
[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
1 parent 6454391 commit 1fbbf92

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/utils/perf-training/perf-helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def findFilesWithExtension(path, extension):
2323
filenames = []
2424
for root, dirs, files in os.walk(path):
2525
for filename in files:
26-
if filename.endswith(extension):
26+
if os.path.splitext(filename)[1] == extension:
2727
filenames.append(os.path.join(root, filename))
2828
return filenames
2929

0 commit comments

Comments
 (0)