diff --git a/clang/utils/perf-training/perf-helper.py b/clang/utils/perf-training/perf-helper.py index abbdc77b237247..f28eb0b731dd30 100644 --- a/clang/utils/perf-training/perf-helper.py +++ b/clang/utils/perf-training/perf-helper.py @@ -21,7 +21,7 @@ def findFilesWithExtension(path, extension): filenames = [] - for root, dirs, files in os.walk(path): + for root, dirs, files in os.walk(path): for filename in files: if filename.endswith(f".{extension}"): filenames.append(os.path.join(root, filename)) @@ -102,7 +102,7 @@ def dtrace(args): dtrace_args.extend(( 'dtrace', '-xevaltime=exec', '-xbufsize=%dm' % (opts.buffer_size), - '-q', '-n', dtrace_script, + '-q', '-n', dtrace_script, '-c', ' '.join(cmd))) if sys.platform == "darwin": @@ -244,7 +244,7 @@ def get_symbols_with_prefix(symbol): # If we found too many possible symbols, ignore this as a prefix. if len(possible_symbols) > 100: print( "warning: ignoring symbol %r " % symbol + - "(no match and too many possible suffixes)", file=sys.stderr) + "(no match and too many possible suffixes)", file=sys.stderr) continue # Report that we resolved a missing symbol. @@ -284,7 +284,7 @@ def form_by_call_order_fair(symbol_lists): succs[a] = items = succs.get(a, []) if b not in items: items.append(b) - + # Emit all the symbols, but make sure to always emit all successors from any # call list whenever we see a symbol. # @@ -295,11 +295,11 @@ def form_by_call_order_fair(symbol_lists): for symbols in symbol_lists for node in symbols for s in ([node] + succs.get(node,[]))) - + def form_by_frequency(symbol_lists): # Form the order file by just putting the most commonly occurring symbols # first. This assumes the data files didn't use the oneshot dtrace method. - + counts = {} for symbols in symbol_lists: for a in symbols: @@ -308,14 +308,14 @@ def form_by_frequency(symbol_lists): by_count = list(counts.items()) by_count.sort(key = lambda __n: -__n[1]) return [s for s,n in by_count] - + def form_by_random(symbol_lists): # Randomize the symbols. merged_symbols = uniq(s for symbols in symbol_lists for s in symbols) random.shuffle(merged_symbols) return merged_symbols - + def form_by_alphabetical(symbol_lists): # Alphabetize the symbols. merged_symbols = list(set(s for symbols in symbol_lists for s in symbols))