'--jobs', '-j', default=cpu_count(), type=int, help='Max job count (defaults to %(default)s, the current CPU count)') parser.add_argument( '--no-progress-indicator', '-n', action='store_true', default=False, help='Do not display any indicator of how many YAML files were read.') args = parser.parse_args() print_progress = not args.no_progress_indicator files = optrecord.find_opt_files(*args.yaml_dirs_or_files) if not files: parser.error("No *.opt.yaml files found") sys.exit(1) all_remarks, file_remarks, _ = optrecord.gather_results( files, args.jobs, print_progress) if print_progress: print('\n') bypass = defaultdict(int) byname = defaultdict(int) for r in optrecord.itervalues(all_remarks): bypass[r.Pass] += 1 byname[r.Pass + "/" + r.Name] += 1
parser.add_argument( '--max-size', '-m', default=100000, type=int, help='Maximum number of remarks stored in an output file') parser.add_argument( '--no-progress-indicator', '-n', action='store_true', default=False, help='Do not display any indicator of how many YAML files were read.') parser.add_argument('--output', '-o', default='diff{}.opt.yaml') args = parser.parse_args() files1 = optrecord.find_opt_files(args.yaml_dir_or_file_1) files2 = optrecord.find_opt_files(args.yaml_dir_or_file_2) print_progress = not args.no_progress_indicator all_remarks1, _, _ = optrecord.gather_results(files1, args.jobs, print_progress) all_remarks2, _, _ = optrecord.gather_results(files2, args.jobs, print_progress) added = set(all_remarks2.values()) - set(all_remarks1.values()) removed = set(all_remarks1.values()) - set(all_remarks2.values()) for r in added: r.Added = True for r in removed: r.Added = False result = list(added | removed)
type=int, help='Maximum number of the hottest remarks to appear on the index page' ) parser.add_argument( '--no-highlight', action='store_true', default=False, help='Do not use a syntax highlighter when rendering the source code') parser.add_argument('--demangler', help='Set the demangler to be used (defaults to %s)' % optrecord.Remark.default_demangler) args = parser.parse_args() print_progress = not args.no_progress_indicator if args.demangler: optrecord.Remark.set_demangler(args.demangler) files = optrecord.find_opt_files(*args.yaml_dirs_or_files) if not files: parser.error("No *.opt.yaml files found") sys.exit(1) all_remarks, file_remarks, should_display_hotness = \ optrecord.gather_results(files, args.jobs, print_progress) map_remarks(all_remarks) generate_report(all_remarks, file_remarks, args.source_dir, args.output_dir, should_display_hotness, args.jobs, print_progress)
def main(): parser = argparse.ArgumentParser(description=desc) parser.add_argument( 'yaml_dirs_or_files', nargs='+', help='List of optimization record files or directories searched ' 'for optimization record files.') parser.add_argument( '--output-dir', '-o', default='html', help='Path to a directory where generated HTML files will be output. ' 'If the directory does not already exist, it will be created. ' '"%(default)s" by default.') parser.add_argument( '--jobs', '-j', default=None, type=int, help='Max job count (defaults to %(default)s, the current CPU count)') parser.add_argument( '--source-dir', '-s', default='', help='set source directory') parser.add_argument( '--no-progress-indicator', '-n', action='store_true', default=False, help='Do not display any indicator of how many YAML files were read ' 'or rendered into HTML.') parser.add_argument( '--max-hottest-remarks-on-index', default=1000, type=int, help='Maximum number of the hottest remarks to appear on the index page') parser.add_argument( '--no-highlight', action='store_true', default=False, help='Do not use a syntax highlighter when rendering the source code') parser.add_argument( '--demangler', help='Set the demangler to be used (defaults to %s)' % optrecord.Remark.default_demangler) parser.add_argument( '--filter', default='', help='Only display remarks from passes matching filter expression') # Do not make this a global variable. Values needed to be propagated through # to individual classes and functions to be portable with multiprocessing across # Windows and non-Windows. args = parser.parse_args() print_progress = not args.no_progress_indicator if args.demangler: optrecord.Remark.set_demangler(args.demangler) files = optrecord.find_opt_files(*args.yaml_dirs_or_files) if not files: parser.error("No *.opt.yaml files found") sys.exit(1) all_remarks, file_remarks, should_display_hotness = \ optrecord.gather_results(files, args.jobs, print_progress, args.filter) map_remarks(all_remarks) generate_report(all_remarks, file_remarks, args.source_dir, args.output_dir, args.no_highlight, should_display_hotness, args.max_hottest_remarks_on_index, args.jobs, print_progress)
parser.add_argument( '--jobs', '-j', default=cpu_count(), type=int, help='Max job count (defaults to %(default)s, the current CPU count)') parser.add_argument( '--no-progress-indicator', '-n', action='store_true', default=False, help='Do not display any indicator of how many YAML files were read.') parser.add_argument('--output', '-o', default='diff.opt.yaml') args = parser.parse_args() files1 = optrecord.find_opt_files([args.yaml_dir_or_file_1]) files2 = optrecord.find_opt_files([args.yaml_dir_or_file_2]) print_progress = not args.no_progress_indicator all_remarks1, _, _ = optrecord.gather_results(files1, args.jobs, print_progress) all_remarks2, _, _ = optrecord.gather_results(files2, args.jobs, print_progress) added = set(all_remarks2.values()) - set(all_remarks1.values()) removed = set(all_remarks1.values()) - set(all_remarks2.values()) for r in added: r.Added = True for r in removed: r.Added = False with open(args.output, 'w') as stream: yaml.dump_all(added | removed, stream)
def main(): parser = argparse.ArgumentParser(description=desc) parser.add_argument( 'yaml_dirs_or_files', nargs='+', help='List of optimization record files or directories searched ' 'for optimization record files.') parser.add_argument( '--output-dir', '-o', default='html', help='Path to a directory where generated HTML files will be output. ' 'If the directory does not already exist, it will be created. ' '"%(default)s" by default.') parser.add_argument( '--jobs', '-j', default=None, type=int, help='Max job count (defaults to %(default)s, the current CPU count)') parser.add_argument('--source-dir', '-s', default='', help='set source directory') parser.add_argument( '--no-progress-indicator', '-n', action='store_true', default=False, help='Do not display any indicator of how many YAML files were read ' 'or rendered into HTML.') parser.add_argument( '--max-hottest-remarks-on-index', default=1000, type=int, help='Maximum number of the hottest remarks to appear on the index page' ) parser.add_argument( '--no-highlight', action='store_true', default=False, help='Do not use a syntax highlighter when rendering the source code') parser.add_argument('--demangler', help='Set the demangler to be used (defaults to %s)' % optrecord.Remark.default_demangler) parser.add_argument( '--filter', default='', help='Only display remarks from passes matching filter expression') # Do not make this a global variable. Values needed to be propagated through # to individual classes and functions to be portable with multiprocessing across # Windows and non-Windows. args = parser.parse_args() print_progress = not args.no_progress_indicator if args.demangler: optrecord.Remark.set_demangler(args.demangler) files = optrecord.find_opt_files(*args.yaml_dirs_or_files) if not files: parser.error("No *.opt.yaml files found") sys.exit(1) all_remarks, file_remarks, should_display_hotness = \ optrecord.gather_results(files, args.jobs, print_progress, args.filter) map_remarks(all_remarks) generate_report(all_remarks, file_remarks, args.source_dir, args.output_dir, args.no_highlight, should_display_hotness, args.max_hottest_remarks_on_index, args.jobs, print_progress)
parser.add_argument( '--max-size', '-m', default=100000, type=int, help='Maximum number of remarks stored in an output file') parser.add_argument( '--no-progress-indicator', '-n', action='store_true', default=False, help='Do not display any indicator of how many YAML files were read.') parser.add_argument('--output', '-o', default='diff{}.opt.yaml') args = parser.parse_args() files1 = optrecord.find_opt_files(args.yaml_dir_or_file_1) files2 = optrecord.find_opt_files(args.yaml_dir_or_file_2) print_progress = not args.no_progress_indicator all_remarks1, _, _ = optrecord.gather_results(files1, args.jobs, print_progress) all_remarks2, _, _ = optrecord.gather_results(files2, args.jobs, print_progress) added = set(all_remarks2.values()) - set(all_remarks1.values()) removed = set(all_remarks1.values()) - set(all_remarks2.values()) for r in added: r.Added = True for r in removed: r.Added = False
parser.add_argument( '--jobs', '-j', default=cpu_count(), type=int, help='Max job count (defaults to %(default)s, the current CPU count)') parser.add_argument( '--no-progress-indicator', '-n', action='store_true', default=False, help='Do not display any indicator of how many YAML files were read.') parser.add_argument('--output', '-o', default='diff.opt.yaml') args = parser.parse_args() files1 = optrecord.find_opt_files([args.yaml_dir_or_file_1]) files2 = optrecord.find_opt_files([args.yaml_dir_or_file_2]) print_progress = not args.no_progress_indicator all_remarks1, _, _ = optrecord.gather_results(files1, args.jobs, print_progress) all_remarks2, _, _ = optrecord.gather_results(files2, args.jobs, print_progress) added = set(all_remarks2.values()) - set(all_remarks1.values()) removed = set(all_remarks1.values()) - set(all_remarks2.values()) for r in added: r.Added = True for r in removed: r.Added = False result = added | removed