Lines Matching +full:- +full:- +full:target +full:- +full:list
3 # Bloat-o-meter code used here Copyright 2004 Matt Mackall <mpm@selenic.com>
5 # SPDX-License-Identifier: GPL-2.0+
41 commit and builds it (typically without re-configuring). When it runs out
45 Clearly the builder threads could work either way - they could check out a
67 Buildman also create working directories for each thread, in a .bm-work/
70 As an example, say we are building branch 'us-net' for boards 'sandbox' and
71 'seaboard', and say that us-net has two commits. We will have directories
74 us-net/ base directory
75 01_of_02_g4ed4ebc_net--Add-tftp-speed-/
77 u-boot.bin
79 u-boot.bin
80 02_of_02_g4ed4ebc_net--Check-tftp-comp/
82 u-boot.bin
84 u-boot.bin
85 .bm-work/
91 u-boot/ source directory
99 trans_valid_chars = string.maketrans('/: ', '---')
100 trans_valid_chars = trans_valid_chars.decode('latin-1')
103 'u-boot.cfg', 'u-boot-spl.cfg', 'u-boot-tpl.cfg'
107 '.config', '.config-spl', '.config-tpl',
108 'autoconf.mk', 'autoconf-spl.mk', 'autoconf-tpl.mk',
109 'autoconf.h', 'autoconf-spl.h','autoconf-tpl.h',
114 def __init__(self, config_filename, target): argument
115 self.target = target
132 """Class for building U-Boot for a particular commit.
134 Public members: (many should ->private)
147 force_build_failures: If a previously-built build (i.e. built on
152 num_jobs: Number of jobs to run at once (passed to make as -j)
157 threads: List of active threads
159 upto: Current commit number we are building (0.count-1)
161 force_reconfig: Reconfigure U-Boot on each comiit. This disables
167 in_tree: Build U-Boot in-tree instead of specifying an output
169 only useful for testing in-tree builds.
172 _base_board_dict: Last-summarised Dict of boards
173 _base_err_lines: Last-summarised list of errors
174 _base_warn_lines: Last-summarised list of warnings
180 _timestamps: List of timestamps for the completion of the last
182 _timestamp_count: Number of timestamps to keep in our list.
190 err_lines: List of error lines or [] if none
192 - Each value is itself a dictionary containing
195 func_sizes: Dictionary keyed by filename - e.g. 'u-boot'. Each
199 config: Dictionary keyed by filename - e.g. '.config'. Each
223 num_jobs: Number of jobs to run at once (passed to make as -j)
233 verbose_build: Run build with V=1 and don't use 'make -s'
237 board rather than a thread-specific directory
243 self._working_dir = os.path.join(base_dir, '.bm-work')
298 # Handle existing graceful with SIGINT / Ctrl-C
329 """Add a new timestamp to the list and record the build period.
337 delta = self._timestamps[-1] - self._timestamps[0]
346 todo = self.count - self.upto
350 self._complete_delay -= timedelta(
355 count -= 1
368 Print(' ' * (self.last_line_len - length), newline=False)
391 cmd = [self.gnu_make] + list(args)
408 target = result.brd.target
420 boards_selected = {target : result.brd}
425 target = '(starting)'
428 ok = self.upto - self.warned - self.fail
433 name = ' /%-5d ' % self.count
442 name += 'commit %2d/%-3d' % (self.commit_upto + 1,
445 name += target
456 commit_upto: Commit number to use (0..self.count-1)
470 def GetBuildDir(self, commit_upto, target): argument
473 The build directory is typically .../<branch>/<commit>/<target>.
476 commit_upto: Commit number to use (0..self.count-1)
477 target: Target name
480 return os.path.join(output_dir, target)
482 def GetDoneFile(self, commit_upto, target): argument
486 commit_upto: Commit number to use (0..self.count-1)
487 target: Target name
489 return os.path.join(self.GetBuildDir(commit_upto, target), 'done')
491 def GetSizesFile(self, commit_upto, target): argument
495 commit_upto: Commit number to use (0..self.count-1)
496 target: Target name
498 return os.path.join(self.GetBuildDir(commit_upto, target), 'sizes')
500 def GetFuncSizesFile(self, commit_upto, target, elf_fname): argument
504 commit_upto: Commit number to use (0..self.count-1)
505 target: Target name
508 return os.path.join(self.GetBuildDir(commit_upto, target),
509 '%s.sizes' % elf_fname.replace('/', '-'))
511 def GetObjdumpFile(self, commit_upto, target, elf_fname): argument
515 commit_upto: Commit number to use (0..self.count-1)
516 target: Target name
519 return os.path.join(self.GetBuildDir(commit_upto, target),
520 '%s.objdump' % elf_fname.replace('/', '-'))
522 def GetErrFile(self, commit_upto, target): argument
526 commit_upto: Commit number to use (0..self.count-1)
527 target: Target name
529 output_dir = self.GetBuildDir(commit_upto, target)
538 lines: List of error lines, each a string
540 New list with only interesting lines included
562 size, type, name = line[:-1].split()
564 Print("Invalid line in file '%s': '%s'" % (fname, line[:-1]))
567 # function names begin with '.' on 64-bit powerpc
610 def GetBuildOutcome(self, commit_upto, target, read_func_sizes, argument
615 commit_upto: Commit number to check (0..n-1)
616 target: Target board to check
623 done_file = self.GetDoneFile(commit_upto, target)
624 sizes_file = self.GetSizesFile(commit_upto, target)
632 err_file = self.GetErrFile(commit_upto, target)
656 'text' : int(values[0]) - rodata,
664 pattern = self.GetFuncSizesFile(commit_upto, target, '*')
672 output_dir = self.GetBuildDir(commit_upto, target)
687 commit_upto: Commit number to summarize (0..self.count-1)
694 keyed by board.target
695 List containing a summary of error lines
696 Dict keyed by error line, containing a list of the Board
698 List containing a summary of warning lines
699 Dict keyed by error line, containing a list of the Board
701 Dictionary keyed by board.target. Each value is a dictionary:
702 key: filename - e.g. '.config'
723 outcome = self.GetBuildOutcome(commit_upto, board.target,
725 board_dict[board.target] = outcome
750 tconfig = Config(self.config_filenames, board.target)
755 config[board.target] = tconfig
761 """Add an output to our list of outcomes for each architecture
770 a list of board names which failed for that arch.
771 changes: List of boards to add to arch_list
775 for target in changes:
776 if target in board_dict:
777 arch = board_dict[target].arch
780 str = self.col.Color(color, ' ' + target)
799 Set up the base board list to be all those selected, and set the
807 board.target
830 delta.append([-old[name], name])
839 diff = new.get(name, 0) - old.get(name, 0)
843 shrink, down = shrink + 1, down - diff
849 args = [add, -remove, grow, -shrink, up, -down, up - down]
856 Print('%s %-38s %7s %7s %+7s' % (indent, 'function', 'old', 'new',
861 msg = '%s %-38s %7s %7s %+7d' % (indent, name,
862 old.get(name, '-'), new.get(name,'-'), diff)
870 target_list: List of targets, each a dict containing:
871 'target': Target name
888 Print('%10s %-15s:' % ('', result['_target']),
895 target = result['_target']
897 base_outcome = self._base_board_dict[target]
910 got bigger, - means smaller). The nunmbers are the average number
914 powerpc: (622 boards) text -0.0
915 arm: (285 boards) text -0.0
916 nds32: (3 boards) text -8.0
920 board.target
922 commit, keyed by board.target. The value is an Outcome object.
931 for target in board_dict:
932 if target not in board_selected:
934 base_sizes = self._base_board_dict[target].sizes
935 outcome = board_dict[target]
938 # Loop through the list of images, creating a dict of size
940 # {'target' : 'snapper9g45, 'data' : 5, 'u-boot-spl:text' : -4}
941 # which means that U-Boot data increased by 5 bytes and SPL
943 err = {'_target' : target}
949 diff = sizes[image][part] - base_image[part]
952 if image == 'u-boot':
957 arch = board_selected[target].arch
963 pass # Only add to our list when we have some stats
969 # We now have a list of image size changes sorted by arch
1022 board.target
1024 commit, keyed by board.target. The value is an Outcome object.
1025 err_lines: A list of errors for this commit, or [] if there is
1027 err_line_boards: Dict keyed by error line, containing a list of
1029 warn_lines: A list of warnings for this commit, or [] if there is
1031 warn_line_boards: Dict keyed by warning line, containing a list of
1033 config: Dictionary keyed by filename - e.g. '.config'. Each
1048 String containing a list of boards with that error line, or
1049 '' if the user has not requested such a list
1054 if not board.target in names:
1055 names.append(board.target)
1071 better_lines.append(char + '-' +
1094 """Add changes in configuration to a list
1097 lines: list to add to
1112 lines.append(_CalcConfig('-', name, config_minus))
1122 elif line[0] == '-':
1129 better = [] # List of boards fixed since last commit
1130 worse = [] # List of new broken boards since last commit
1131 new = [] # List of boards that didn't exist last time
1132 unknown = [] # List of boards that were not built
1134 for target in board_dict:
1135 if target not in board_selected:
1138 # If the board was built last time, add its outcome to a list
1139 if target in self._base_board_dict:
1140 base_outcome = self._base_board_dict[target].rc
1141 outcome = board_dict[target]
1143 unknown.append(target)
1145 better.append(target)
1147 worse.append(target)
1149 new.append(target)
1151 # Get a list of errors that have appeared, and disappeared
1196 for target in board_dict:
1197 if target not in board_selected:
1199 arch = board_selected[target].arch
1212 for target in board_dict:
1213 if target not in board_selected:
1216 arch = board_selected[target].arch
1221 tbase = self._base_config[target]
1222 tconfig = config[target]
1242 desc = '%s -> %s' % (value, new_value)
1254 summary[target] = '\n'.join(lines)
1257 for target, lines in summary.iteritems():
1259 lines_by_target[lines].append(target)
1261 lines_by_target[lines] = [target]
1276 #arch_summary[target] = '\n'.join(lines)
1296 # Get a list of boards that did not get built, if needed
1322 """Show a build summary for U-Boot for a given board list.
1350 count = (self.commit_count + self._step - 1) / self._step
1426 """Build all commits for a list of boards
1429 commits: List of commits to be build, each a Commit object
1430 boards_selected: Dict of selected boards, key is target name,
1436 - number of boards that failed to build
1437 - number of boards that issued warnings
1461 term = threading.Thread(target=self.queue.join)