def jumpmix(outf, suite, result_file, header=False): benchmark = benchmark_name(suite, result_file) format_line = '{:10} {:10} {:20} {:20} {:>20}\n' Suite = suite.capitalize() if header: outf.write(format_line.format("Suite", "Group", "Benchmark", "Type", "Count")) for line in strip_comments(result_file): (n, jump, count, count_taken) = line.split() if (not jump.startswith('*')) and (not jump.startswith('syscall')): bmgroup = bench.group(benchmark) outf.write(format_line.format(Suite, bmgroup, benchmark, jump, count))
def opcodemix(outf, suite, result_file, header=False): benchmark = benchmark_name(suite, result_file) format_line = '{:10} {:10} {:15} {:10} {:10} {:>20}\n' Suite = suite.capitalize() if header: outf.write(format_line.format("Suite", "Group", "Benchmark", "Opcode", "Type", "Count")) for line in strip_comments(result_file): (n, op, c1, c2) = line.split() if not op.startswith('*'): opgroup = opcode.group(op) bmgroup = bench.group(benchmark) outf.write(format_line.format(Suite, bmgroup, benchmark, op, opgroup, int(c1)+int(c2)))
def bblength(outf, suite, result_file, header=False): format_line = "{:15} {:6} {:8} {:>3} {:>15} {:>10.5f}\n" header_line = "Benchmark Suite Group Length Count Percent" Suite = suite.capitalize() benchmark = benchmark_name(suite, result_file) bmgroup = bench.group(benchmark) if header: outf.write( "{:15} {:6} {:^8} {:3} {:^15} {:10}\n".format(*header_line.split())) for line in strip_comments(result_file): (length, count, percent) = line.split() outf.write(format_line.format(benchmark, Suite, bmgroup, length, count, float(percent) / 100))
def ibdetails(outf, suite, result_file, header=False): benchmark = benchmark_name(suite, result_file) bmgroup = bench.group(benchmark) Suite = suite.capitalize() format_line = "{:6} {:8} {:15} {:7} {:7} {:7} {:15} {:7}\n" header_line = 'Suite Group Benchmark Type Targets Sources Count Locality' if header: outf.write(format_line.format(*header_line.split())) for line in strip_comments(result_file): if line.startswith("@"): branch_type = line[1:-2].upper() continue metrics = [m.strip() for m in line.split("|")] output = format_line.format( Suite, bmgroup, benchmark, branch_type, metrics[0], metrics[1], metrics[2], metrics[5]) outf.write(output)