diff options
| author | Emilio Jesus Gallego Arias | 2020-02-19 16:04:40 -0500 |
|---|---|---|
| committer | Emilio Jesus Gallego Arias | 2020-02-19 16:04:40 -0500 |
| commit | 11335618faeda5370db1ca4f453d57e9f8c396ea (patch) | |
| tree | b78dce94ed1e08061343fff43396058763e60223 /tools/make-both-time-files.py | |
| parent | a644482acd84427db0e64450c3fc41ad321e83cd (diff) | |
| parent | f9928b83a2e2eda7bbb9cd7fac0ea6e1ef1be30f (diff) | |
Merge PR #11302: Add --fuzz, --real, --user to timing scripts
Reviewed-by: SkySkimmer
Ack-by: Zimmi48
Reviewed-by: ejgallego
Ack-by: jfehrle
Diffstat (limited to 'tools/make-both-time-files.py')
| -rwxr-xr-x | tools/make-both-time-files.py | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/tools/make-both-time-files.py b/tools/make-both-time-files.py index 8937d63c2f..5d88548bba 100755 --- a/tools/make-both-time-files.py +++ b/tools/make-both-time-files.py @@ -1,16 +1,15 @@ #!/usr/bin/env python3 -import sys from TimeFileMaker import * if __name__ == '__main__': - USAGE = 'Usage: %s [--sort-by=auto|absolute|diff] AFTER_FILE_NAME BEFORE_FILE_NAME [OUTPUT_FILE_NAME ..]' % sys.argv[0] - HELP_STRING = r'''Formats timing information from the output of two invocations of `make TIMED=1` into a sorted table. - -The input is expected to contain lines in the format: -FILE_NAME (...user: NUMBER_IN_SECONDS...) -''' - sort_by, args = parse_args(sys.argv, USAGE, HELP_STRING) - left_dict = get_times(args[1]) - right_dict = get_times(args[2]) - table = make_diff_table_string(left_dict, right_dict, sort_by=sort_by) - print_or_write_table(table, args[3:]) + parser = argparse.ArgumentParser(description=r'''Formats timing information from the output of two invocations of `make TIMED=1` into a sorted table.''') + add_sort_by(parser) + add_real(parser) + add_after_file_name(parser) + add_before_file_name(parser) + add_output_file_name(parser) + args = parser.parse_args() + left_dict = get_times(args.AFTER_FILE_NAME, use_real=args.real) + right_dict = get_times(args.BEFORE_FILE_NAME, use_real=args.real) + table = make_diff_table_string(left_dict, right_dict, sort_by=args.sort_by) + print_or_write_table(table, args.OUTPUT_FILE_NAME) |
