Exemple #1
0
        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)
Exemple #2
0
    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

    total = len(all_remarks)
    print("{:24s} {:10d}".format("Total number of remarks", total))
    if hp:
        h = hp.heap()
        print("{:24s} {:10d}".format("Memory per remark",
                                     h.size / len(all_remarks)))
        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)
    for r in result:
        r.recover_yaml_structure()

    for i in range(0, len(result), args.max_size):
Exemple #4
0
        default=cpu_count(),
        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.')
    args = parser.parse_args()

    print_progress = not args.no_progress_indicator
    all_remarks, file_remarks, should_display_hotness = \
        optrecord.gather_results(args.yaml_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)

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description=desc)
    parser.add_argument('yaml_files', nargs='+')
    parser.add_argument('output_dir')
    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(
        '-source-dir',
        '-s',
        default='',
        help='set source directory')
    args = parser.parse_args()

    if args.jobs == 1:
        pmap = map
    else:
        pool = Pool(processes=args.jobs)
        pmap = pool.map

    all_remarks, file_remarks, should_display_hotness = optrecord.gather_results(pmap, args.yaml_files)

    map_remarks(all_remarks)

    generate_report(pmap, all_remarks, file_remarks, args.source_dir, args.output_dir, should_display_hotness)
Exemple #6
0
    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

    total = len(all_remarks)
    print("{:24s} {:10d}".format("Total number of remarks", total))
    if hp:
        h = hp.heap()
        print("{:24s} {:10d}".format("Memory per remark",
                                     h.size / len(all_remarks)))
Exemple #7
0
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)
Exemple #8
0
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)
Exemple #9
0
        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)
    for r in result:
        r.recover_yaml_structure()
Exemple #10
0
    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('--output', '-o', default='diff.opt.yaml')
    args = parser.parse_args()

    if args.jobs == 1:
        pmap = map
    else:
        pool = Pool(processes=args.jobs)
        pmap = pool.map

    files1 = find_files(args.yaml_dir_or_file_1)
    files2 = find_files(args.yaml_dir_or_file_2)

    all_remarks1, _, _ = optrecord.gather_results(pmap, files1)
    all_remarks2, _, _ = optrecord.gather_results(pmap, files2)

    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)
    parser.add_argument('yaml_files', nargs='+')
    parser.add_argument(
        '--jobs',
        '-j',
        default=cpu_count(),
        type=int,
        help='Max job count (defaults to %(default)s, the current CPU count)')
    args = parser.parse_args()

    if args.jobs == 1:
        pmap = map
    else:
        pool = Pool(processes=args.jobs)
        pmap = pool.map

    all_remarks, file_remarks, _ = optrecord.gather_results(
        pmap, args.yaml_files)

    bypass = defaultdict(int)
    byname = defaultdict(int)
    for r in optrecord.itervalues(all_remarks):
        bypass[r.Pass] += 1
        byname[r.Pass + "/" + r.Name] += 1

    total = len(all_remarks)
    print("{:24s} {:10d}\n".format("Total number of remarks", total))

    print("Top 10 remarks by pass:"******"  {:30s} {:2.0f}%".format(passname, count * 100. / total))
Exemple #12
0
        default=cpu_count(),
        type=int,
        help='Max job count (defaults to %(default)s, the current CPU count)')
    args = parser.parse_args()

    if len(args.yaml_files) == 0:
        parser.print_help()
        sys.exit(1)

    if args.jobs == 1:
        pmap = map
    else:
        pool = Pool(processes=args.jobs)
        pmap = pool.map

    all_remarks, file_remarks, _ = optrecord.gather_results(pmap, args.yaml_files)

    bypass = defaultdict(int)
    byname = defaultdict(int)
    for r in all_remarks.itervalues():
        bypass[r.Pass] += 1
        byname[r.Pass + "/" + r.Name] += 1

    total = len(all_remarks)
    print("{:24s} {:10d}\n".format("Total number of remarks", total))

    print("Top 10 remarks by pass:"******"  {:30s} {:2.0f}%". format(passname, count * 100. / total))
Exemple #13
0
    parser.add_argument('yaml_files', nargs='+')
    parser.add_argument('output_dir')
    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(
        '-source-dir',
        '-s',
        default='',
        help='set source directory')
    args = parser.parse_args()

    if len(args.yaml_files) == 0:
        parser.print_help()
        sys.exit(1)

    if args.jobs == 1:
        pmap = map
    else:
        pool = Pool(processes=args.jobs)
        pmap = pool.map

    all_remarks, file_remarks, should_display_hotness = optrecord.gather_results(pmap, args.yaml_files)

    map_remarks(all_remarks)

    generate_report(pmap, all_remarks, file_remarks, args.source_dir, args.output_dir, should_display_hotness)