diff options
| author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2017-05-15 14:18:43 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-05-23 17:45:36 +0100 |
| commit | 1c46fbd6288ea61266702553a3c4ea8e7bfc2b2a (patch) | |
| tree | 901ef13b73a205609c8b91f22ec102e5f6d4b8a7 /scripts | |
| parent | e1f84ea82348efb5ed95cafef171e370887c0e31 (diff) | |
| download | poky-1c46fbd6288ea61266702553a3c4ea8e7bfc2b2a.tar.gz | |
oe-build-perf-report: two verbosity levels for --list
(From OE-Core rev: a77066751c81f27332cc16c565dff6a45c173b6c)
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')
| -rwxr-xr-x | scripts/oe-build-perf-report | 45 |
1 files changed, 33 insertions, 12 deletions
diff --git a/scripts/oe-build-perf-report b/scripts/oe-build-perf-report index 6f0b84f9ec..8190accdc6 100755 --- a/scripts/oe-build-perf-report +++ b/scripts/oe-build-perf-report | |||
| @@ -82,29 +82,50 @@ def get_test_runs(repo, tag_name, **kwargs): | |||
| 82 | # Return field names and a sorted list of revs | 82 | # Return field names and a sorted list of revs |
| 83 | return undef_fields, sorted(revs) | 83 | return undef_fields, sorted(revs) |
| 84 | 84 | ||
| 85 | def list_test_revs(repo, tag_name, **kwargs): | 85 | def list_test_revs(repo, tag_name, verbosity, **kwargs): |
| 86 | """Get list of all tested revisions""" | 86 | """Get list of all tested revisions""" |
| 87 | fields, revs = get_test_runs(repo, tag_name, **kwargs) | 87 | fields, revs = get_test_runs(repo, tag_name, **kwargs) |
| 88 | ignore_fields = ['tag_number'] | 88 | ignore_fields = ['tag_number'] |
| 89 | if verbosity < 2: | ||
| 90 | extra_fields = ['COMMITS', 'TEST RUNS'] | ||
| 91 | ignore_fields.extend(['commit_number', 'commit']) | ||
| 92 | else: | ||
| 93 | extra_fields = ['TEST RUNS'] | ||
| 94 | |||
| 89 | print_fields = [i for i, f in enumerate(fields) if f not in ignore_fields] | 95 | print_fields = [i for i, f in enumerate(fields) if f not in ignore_fields] |
| 90 | 96 | ||
| 91 | # Sort revs | 97 | # Sort revs |
| 92 | rows = [[fields[i].upper() for i in print_fields] + ['TEST RUNS']] | 98 | rows = [[fields[i].upper() for i in print_fields] + extra_fields] |
| 93 | prev = [''] * len(revs) | 99 | |
| 100 | prev = [''] * len(print_fields) | ||
| 101 | prev_commit = None | ||
| 102 | commit_cnt = 0 | ||
| 103 | commit_field = fields.index('commit') | ||
| 94 | for rev in revs: | 104 | for rev in revs: |
| 95 | # Only use fields that we want to print | 105 | # Only use fields that we want to print |
| 96 | rev = [rev[i] for i in print_fields] | 106 | cols = [rev[i] for i in print_fields] |
| 107 | |||
| 108 | |||
| 109 | if cols != prev: | ||
| 110 | commit_cnt = 1 | ||
| 111 | test_run_cnt = 1 | ||
| 112 | new_row = [''] * (len(print_fields) + len(extra_fields)) | ||
| 97 | 113 | ||
| 98 | if rev != prev: | ||
| 99 | new_row = [''] * len(print_fields) + [1] | ||
| 100 | for i in print_fields: | 114 | for i in print_fields: |
| 101 | if rev[i] != prev[i]: | 115 | if cols[i] != prev[i]: |
| 102 | break | 116 | break |
| 103 | new_row[i:-1] = rev[i:] | 117 | new_row[i:-len(extra_fields)] = cols[i:] |
| 104 | rows.append(new_row) | 118 | rows.append(new_row) |
| 105 | else: | 119 | else: |
| 106 | rows[-1][-1] += 1 | 120 | if rev[commit_field] != prev_commit: |
| 107 | prev = rev | 121 | commit_cnt += 1 |
| 122 | test_run_cnt += 1 | ||
| 123 | |||
| 124 | if verbosity < 2: | ||
| 125 | new_row[-2] = commit_cnt | ||
| 126 | new_row[-1] = test_run_cnt | ||
| 127 | prev = cols | ||
| 128 | prev_commit = rev[commit_field] | ||
| 108 | 129 | ||
| 109 | print_table(rows) | 130 | print_table(rows) |
| 110 | 131 | ||
| @@ -411,7 +432,7 @@ Examine build performance test results from a Git repository""" | |||
| 411 | help="Verbose logging") | 432 | help="Verbose logging") |
| 412 | parser.add_argument('--repo', '-r', required=True, | 433 | parser.add_argument('--repo', '-r', required=True, |
| 413 | help="Results repository (local git clone)") | 434 | help="Results repository (local git clone)") |
| 414 | parser.add_argument('--list', '-l', action='store_true', | 435 | parser.add_argument('--list', '-l', action='count', |
| 415 | help="List available test runs") | 436 | help="List available test runs") |
| 416 | parser.add_argument('--html', action='store_true', | 437 | parser.add_argument('--html', action='store_true', |
| 417 | help="Generate report in html format") | 438 | help="Generate report in html format") |
| @@ -447,7 +468,7 @@ def main(argv=None): | |||
| 447 | repo = GitRepo(args.repo) | 468 | repo = GitRepo(args.repo) |
| 448 | 469 | ||
| 449 | if args.list: | 470 | if args.list: |
| 450 | list_test_revs(repo, args.tag_name) | 471 | list_test_revs(repo, args.tag_name, args.list) |
| 451 | return 0 | 472 | return 0 |
| 452 | 473 | ||
| 453 | # Determine hostname which to use | 474 | # Determine hostname which to use |
