diff options
author | Martin Liska <mliska@suse.cz> | 2022-01-31 16:39:02 +0100 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2022-01-31 16:42:15 +0100 |
commit | 31ab99f7c854d654bf05abd50e3300714df381f3 (patch) | |
tree | 55c929c04f6bcb0f73514cf1683300b51a9a7e0a /contrib | |
parent | f10bec5ffa487ad3033ed5f38cfd0fc7d696deab (diff) | |
download | gcc-31ab99f7c854d654bf05abd50e3300714df381f3.zip gcc-31ab99f7c854d654bf05abd50e3300714df381f3.tar.gz gcc-31ab99f7c854d654bf05abd50e3300714df381f3.tar.bz2 |
contrib: update analyze_brprob_* scripts.
contrib/ChangeLog:
* analyze_brprob.py: Support more formatted predict.def file.
* analyze_brprob_spec.py: Improve output and documentation.
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/analyze_brprob.py | 5 | ||||
-rwxr-xr-x | contrib/analyze_brprob_spec.py | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/contrib/analyze_brprob.py b/contrib/analyze_brprob.py index de5f474..debc9a6 100755 --- a/contrib/analyze_brprob.py +++ b/contrib/analyze_brprob.py @@ -101,8 +101,11 @@ class PredictDefFile: p = None modified_lines = [] - for l in lines: + for i, l in enumerate(lines): if l.startswith('DEF_PREDICTOR'): + next_line = lines[i + 1] + if l.endswith(','): + l += next_line m = re.match('.*"(.*)".*', l) p = m.group(1) elif l == '': diff --git a/contrib/analyze_brprob_spec.py b/contrib/analyze_brprob_spec.py index 063bd11..c7a9ae0 100755 --- a/contrib/analyze_brprob_spec.py +++ b/contrib/analyze_brprob_spec.py @@ -26,7 +26,7 @@ script_location = os.path.realpath(__file__) parser = argparse.ArgumentParser() parser.add_argument('location', metavar = 'dump_file', - help = 'Location with SPEC benchmarks') + help = 'Sub-folder with SPEC benchmarks (e.g. Programming/cpu2017/benchspec/CPU)') parser.add_argument('-s', '--sorting', dest = 'sorting', choices = ['branches', 'branch-hitrate', 'hitrate', 'coverage', 'name'], default = 'branches') @@ -54,12 +54,14 @@ for b in sorted(benchmarks): temp.close() print() - print(b) + print(f' {b} '.center(160, '=')) sys.stdout.flush() p = [os.path.join(os.path.dirname(script_location), 'analyze_brprob.py'), temp.name, '--sorting', args.sorting] - if args.def_file != None: + if args.def_file: p += ['-d', args.def_file] + if args.verbose: + p.append('-v') p = subprocess.check_call(p) sys.stdout.flush() |