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-10-01 21:45:55 +0100 |
commit | 4cc1c430cd8540598f8e3f2056637b50f3608f8a (patch) | |
tree | 791847f1eff76a0b6dca8087c74cd7decbccd72e /scripts/buildstats-diff | |
parent | 58bd0fd62d1617f60e6b42e11f19e14289b6ee24 (diff) | |
download | poky-4cc1c430cd8540598f8e3f2056637b50f3608f8a.tar.gz |
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.
(From OE-Core rev: 441336bc1750939c2da2d9e4dc5a6893b283bf68)
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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): | |||
260 | return cputime | 260 | return cputime |
261 | 261 | ||
262 | 262 | ||
263 | def print_task_diff(bs1, bs2, min_cputime=0, min_timediff=0, sort_by=('absdiff',)): | 263 | def print_task_diff(bs1, bs2, min_val=0, min_absdiff=0, sort_by=('absdiff',)): |
264 | """Diff task execution times""" | 264 | """Diff task execution times""" |
265 | tasks_diff = [] | 265 | tasks_diff = [] |
266 | pkg_maxlen = 0 | 266 | pkg_maxlen = 0 |
@@ -296,10 +296,10 @@ def print_task_diff(bs1, bs2, min_cputime=0, min_timediff=0, sort_by=('absdiff', | |||
296 | 296 | ||
297 | tasks_diff.append(TaskDiff(pkg, pkg_op, task, task_op, t1, t2, t2-t1, reldiff)) | 297 | tasks_diff.append(TaskDiff(pkg, pkg_op, task, task_op, t1, t2, t2-t1, reldiff)) |
298 | 298 | ||
299 | if min_cputime: | 299 | if min_val: |
300 | print("Ignoring tasks shorter than {}s".format(min_cputime)) | 300 | print("Ignoring tasks shorter than {}s".format(min_val)) |
301 | if min_timediff: | 301 | if min_absdiff: |
302 | print("Ignoring time differences shorter than {}s".format(min_timediff)) | 302 | print("Ignoring time differences shorter than {}s".format(min_absdiff)) |
303 | 303 | ||
304 | print() | 304 | print() |
305 | print(" {:{pkg_maxlen}} {:{task_maxlen}} {:>8} {:>10} {:>10} {}".format( | 305 | 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', | |||
317 | 317 | ||
318 | for diff in tasks_diff: | 318 | for diff in tasks_diff: |
319 | cputime = max(diff.cputime1, diff.cputime2) | 319 | cputime = max(diff.cputime1, diff.cputime2) |
320 | if cputime > min_cputime: | 320 | if cputime > min_val: |
321 | if abs(diff.absdiff) > min_timediff: | 321 | if abs(diff.absdiff) > min_absdiff: |
322 | task_prefix = diff.task_op if diff.pkg_op == ' ' else ' ' | 322 | task_prefix = diff.task_op if diff.pkg_op == ' ' else ' ' |
323 | print("{}{:{pkg_maxlen}} {}{:{task_maxlen}} {:+7.1f}s {:+9.1f}% {:9.1f}s -> {:.1f}s".format( | 323 | print("{}{:{pkg_maxlen}} {}{:{task_maxlen}} {:+7.1f}s {:+9.1f}% {:9.1f}s -> {:.1f}s".format( |
324 | diff.pkg_op, diff.pkg, task_prefix, diff.task, diff.absdiff, diff.reldiff, diff.cputime1, diff.cputime2, | 324 | 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.""" | |||
369 | help="Verbose logging") | 369 | help="Verbose logging") |
370 | parser.add_argument('--ver-diff', action='store_true', | 370 | parser.add_argument('--ver-diff', action='store_true', |
371 | help="Show package version differences and exit") | 371 | help="Show package version differences and exit") |
372 | parser.add_argument('--min-time', default=3.0, type=float, | 372 | parser.add_argument('--min-val', default=3.0, type=float, |
373 | help="Filter out tasks shorter than MIN_TIME seconds") | 373 | help="Filter out tasks shorter than MIN_VAL seconds") |
374 | parser.add_argument('--min-timediff', default=1.0, type=float, | 374 | parser.add_argument('--min-absdiff', default=1.0, type=float, |
375 | help="Filter out tasks whose difference in cputime is " | 375 | help="Filter out tasks whose difference in cputime is " |
376 | "less that MIN_TIMEDIFF seconds") | 376 | "less that MIN_ABSDIFF seconds") |
377 | parser.add_argument('--sort-by', default='absdiff', | 377 | parser.add_argument('--sort-by', default='absdiff', |
378 | help="Comma-separated list of field sort order. " | 378 | help="Comma-separated list of field sort order. " |
379 | "Prepend the field name with '-' for reversed sort. " | 379 | "Prepend the field name with '-' for reversed sort. " |
@@ -405,7 +405,7 @@ def main(argv=None): | |||
405 | if args.ver_diff: | 405 | if args.ver_diff: |
406 | print_ver_diff(bs1, bs2) | 406 | print_ver_diff(bs1, bs2) |
407 | else: | 407 | else: |
408 | print_task_diff(bs1, bs2, args.min_time, args.min_timediff, sort_by) | 408 | print_task_diff(bs1, bs2, args.min_val, args.min_absdiff, sort_by) |
409 | print_timediff_summary(bs1, bs2) | 409 | print_timediff_summary(bs1, bs2) |
410 | 410 | ||
411 | return 0 | 411 | return 0 |