diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-09-29 17:27:59 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-30 17:14:11 +0100 |
commit | 441336bc1750939c2da2d9e4dc5a6893b283bf68 (patch) | |
tree | 48d1bb04015da7b0151901476dac0649c2ef30bd /scripts/buildstats-diff | |
parent | 08082b96d8d09215f02e9251f354bb6e8bb3e712 (diff) | |
download | openembedded-core-441336bc1750939c2da2d9e4dc5a6893b283bf68.tar.gz openembedded-core-441336bc1750939c2da2d9e4dc5a6893b283bf68.tar.bz2 openembedded-core-441336bc1750939c2da2d9e4dc5a6893b283bf68.zip |
scripts/buildstats-diff: rename --min-time and --min-timediff args
Rename these arguments to --min-val and --min-absdiff in preparation for
supporting other "quantities" than just cputime.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts/buildstats-diff')
-rwxr-xr-x | scripts/buildstats-diff | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/scripts/buildstats-diff b/scripts/buildstats-diff index d0cd7669a3..7728b6d38d 100755 --- a/scripts/buildstats-diff +++ b/scripts/buildstats-diff @@ -260,7 +260,7 @@ def task_time(task): return cputime -def print_task_diff(bs1, bs2, min_cputime=0, min_timediff=0, sort_by=('absdiff',)): +def print_task_diff(bs1, bs2, min_val=0, min_absdiff=0, sort_by=('absdiff',)): """Diff task execution times""" tasks_diff = [] pkg_maxlen = 0 @@ -296,10 +296,10 @@ def print_task_diff(bs1, bs2, min_cputime=0, min_timediff=0, sort_by=('absdiff', tasks_diff.append(TaskDiff(pkg, pkg_op, task, task_op, t1, t2, t2-t1, reldiff)) - if min_cputime: - print("Ignoring tasks shorter than {}s".format(min_cputime)) - if min_timediff: - print("Ignoring time differences shorter than {}s".format(min_timediff)) + if min_val: + print("Ignoring tasks shorter than {}s".format(min_val)) + if min_absdiff: + print("Ignoring time differences shorter than {}s".format(min_absdiff)) print() print(" {:{pkg_maxlen}} {:{task_maxlen}} {:>8} {:>10} {:>10} {}".format( @@ -317,8 +317,8 @@ def print_task_diff(bs1, bs2, min_cputime=0, min_timediff=0, sort_by=('absdiff', for diff in tasks_diff: cputime = max(diff.cputime1, diff.cputime2) - if cputime > min_cputime: - if abs(diff.absdiff) > min_timediff: + if cputime > min_val: + if abs(diff.absdiff) > min_absdiff: task_prefix = diff.task_op if diff.pkg_op == ' ' else ' ' print("{}{:{pkg_maxlen}} {}{:{task_maxlen}} {:+7.1f}s {:+9.1f}% {:9.1f}s -> {:.1f}s".format( diff.pkg_op, diff.pkg, task_prefix, diff.task, diff.absdiff, diff.reldiff, diff.cputime1, diff.cputime2, @@ -369,11 +369,11 @@ Script for comparing buildstats of two separate builds.""" help="Verbose logging") parser.add_argument('--ver-diff', action='store_true', help="Show package version differences and exit") - parser.add_argument('--min-time', default=3.0, type=float, - help="Filter out tasks shorter than MIN_TIME seconds") - parser.add_argument('--min-timediff', default=1.0, type=float, + parser.add_argument('--min-val', default=3.0, type=float, + help="Filter out tasks shorter than MIN_VAL seconds") + parser.add_argument('--min-absdiff', default=1.0, type=float, help="Filter out tasks whose difference in cputime is " - "less that MIN_TIMEDIFF seconds") + "less that MIN_ABSDIFF seconds") parser.add_argument('--sort-by', default='absdiff', help="Comma-separated list of field sort order. " "Prepend the field name with '-' for reversed sort. " @@ -405,7 +405,7 @@ def main(argv=None): if args.ver_diff: print_ver_diff(bs1, bs2) else: - print_task_diff(bs1, bs2, args.min_time, args.min_timediff, sort_by) + print_task_diff(bs1, bs2, args.min_val, args.min_absdiff, sort_by) print_timediff_summary(bs1, bs2) return 0 |