Lines Matching +full:- +full:- +full:target +full:- +full:list
1 # SPDX-License-Identifier: GPL-2.0+
4 # Bloat-o-meter code used here Copyright 2004 Matt Mackall <mpm@selenic.com>
40 commit and builds it (typically without re-configuring). When it runs out
44 Clearly the builder threads could work either way - they could check out a
66 Buildman also create working directories for each thread, in a .bm-work/
69 As an example, say we are building branch 'us-net' for boards 'sandbox' and
70 'seaboard', and say that us-net has two commits. We will have directories
73 us-net/ base directory
74 01_of_02_g4ed4ebc_net--Add-tftp-speed-/
76 u-boot.bin
78 u-boot.bin
79 02_of_02_g4ed4ebc_net--Check-tftp-comp/
81 u-boot.bin
83 u-boot.bin
84 .bm-work/
90 u-boot/ source directory
98 trans_valid_chars = string.maketrans('/: ', '---')
99 trans_valid_chars = trans_valid_chars.decode('latin-1')
102 'u-boot.cfg', 'u-boot-spl.cfg', 'u-boot-tpl.cfg'
106 '.config', '.config-spl', '.config-tpl',
107 'autoconf.mk', 'autoconf-spl.mk', 'autoconf-tpl.mk',
108 'autoconf.h', 'autoconf-spl.h','autoconf-tpl.h',
113 def __init__(self, config_filename, target): argument
114 self.target = target
132 def __init__(self, target): argument
133 self.target = target
140 """Class for building U-Boot for a particular commit.
142 Public members: (many should ->private)
155 force_build_failures: If a previously-built build (i.e. built on
160 num_jobs: Number of jobs to run at once (passed to make as -j)
165 threads: List of active threads
167 upto: Current commit number we are building (0.count-1)
169 force_reconfig: Reconfigure U-Boot on each comiit. This disables
175 in_tree: Build U-Boot in-tree instead of specifying an output
177 only useful for testing in-tree builds.
180 _base_board_dict: Last-summarised Dict of boards
181 _base_err_lines: Last-summarised list of errors
182 _base_warn_lines: Last-summarised list of warnings
188 _timestamps: List of timestamps for the completion of the last
190 _timestamp_count: Number of timestamps to keep in our list.
198 err_lines: List of error lines or [] if none
200 - Each value is itself a dictionary containing
203 func_sizes: Dictionary keyed by filename - e.g. 'u-boot'. Each
207 config: Dictionary keyed by filename - e.g. '.config'. Each
236 num_jobs: Number of jobs to run at once (passed to make as -j)
246 verbose_build: Run build with V=1 and don't use 'make -s'
250 board rather than a thread-specific directory
257 self._working_dir = os.path.join(base_dir, '.bm-work')
314 # Handle existing graceful with SIGINT / Ctrl-C
348 """Add a new timestamp to the list and record the build period.
356 delta = self._timestamps[-1] - self._timestamps[0]
365 todo = self.count - self.upto
369 self._complete_delay -= timedelta(
374 count -= 1
387 Print(' ' * (self.last_line_len - length), newline=False)
410 cmd = [self.gnu_make] + list(args)
427 target = result.brd.target
439 boards_selected = {target : result.brd}
444 target = '(starting)'
447 ok = self.upto - self.warned - self.fail
452 name = ' /%-5d ' % self.count
461 name += 'commit %2d/%-3d' % (self.commit_upto + 1,
464 name += target
475 commit_upto: Commit number to use (0..self.count-1)
489 def GetBuildDir(self, commit_upto, target): argument
492 The build directory is typically .../<branch>/<commit>/<target>.
495 commit_upto: Commit number to use (0..self.count-1)
496 target: Target name
499 return os.path.join(output_dir, target)
501 def GetDoneFile(self, commit_upto, target): argument
505 commit_upto: Commit number to use (0..self.count-1)
506 target: Target name
508 return os.path.join(self.GetBuildDir(commit_upto, target), 'done')
510 def GetSizesFile(self, commit_upto, target): argument
514 commit_upto: Commit number to use (0..self.count-1)
515 target: Target name
517 return os.path.join(self.GetBuildDir(commit_upto, target), 'sizes')
519 def GetFuncSizesFile(self, commit_upto, target, elf_fname): argument
523 commit_upto: Commit number to use (0..self.count-1)
524 target: Target name
527 return os.path.join(self.GetBuildDir(commit_upto, target),
528 '%s.sizes' % elf_fname.replace('/', '-'))
530 def GetObjdumpFile(self, commit_upto, target, elf_fname): argument
534 commit_upto: Commit number to use (0..self.count-1)
535 target: Target name
538 return os.path.join(self.GetBuildDir(commit_upto, target),
539 '%s.objdump' % elf_fname.replace('/', '-'))
541 def GetErrFile(self, commit_upto, target): argument
545 commit_upto: Commit number to use (0..self.count-1)
546 target: Target name
548 output_dir = self.GetBuildDir(commit_upto, target)
557 lines: List of error lines, each a string
559 New list with only interesting lines included
581 size, type, name = line[:-1].split()
583 Print("Invalid line in file '%s': '%s'" % (fname, line[:-1]))
586 # function names begin with '.' on 64-bit powerpc
654 def GetBuildOutcome(self, commit_upto, target, read_func_sizes, argument
659 commit_upto: Commit number to check (0..n-1)
660 target: Target board to check
668 done_file = self.GetDoneFile(commit_upto, target)
669 sizes_file = self.GetSizesFile(commit_upto, target)
678 err_file = self.GetErrFile(commit_upto, target)
702 'text' : int(values[0]) - rodata,
710 pattern = self.GetFuncSizesFile(commit_upto, target, '*')
718 output_dir = self.GetBuildDir(commit_upto, target)
724 output_dir = self.GetBuildDir(commit_upto, target)
739 commit_upto: Commit number to summarize (0..self.count-1)
747 keyed by board.target
748 List containing a summary of error lines
749 Dict keyed by error line, containing a list of the Board
751 List containing a summary of warning lines
752 Dict keyed by error line, containing a list of the Board
754 Dictionary keyed by board.target. Each value is a dictionary:
755 key: filename - e.g. '.config'
759 Dictionary keyed by board.target. Each value is a dictionary:
780 outcome = self.GetBuildOutcome(commit_upto, board.target,
783 board_dict[board.target] = outcome
809 tconfig = Config(self.config_filenames, board.target)
814 config[board.target] = tconfig
816 tenvironment = Environment(board.target)
820 environment[board.target] = tenvironment
826 """Add an output to our list of outcomes for each architecture
835 a list of board names which failed for that arch.
836 changes: List of boards to add to arch_list
840 for target in changes:
841 if target in board_dict:
842 arch = board_dict[target].arch
845 str = self.col.Color(color, ' ' + target)
864 Set up the base board list to be all those selected, and set the
872 board.target
897 delta.append([-old[name], name])
906 diff = new.get(name, 0) - old.get(name, 0)
910 shrink, down = shrink + 1, down - diff
916 args = [add, -remove, grow, -shrink, up, -down, up - down]
923 Print('%s %-38s %7s %7s %+7s' % (indent, 'function', 'old', 'new',
928 msg = '%s %-38s %7s %7s %+7d' % (indent, name,
929 old.get(name, '-'), new.get(name,'-'), diff)
937 target_list: List of targets, each a dict containing:
938 'target': Target name
955 Print('%10s %-15s:' % ('', result['_target']),
962 target = result['_target']
964 base_outcome = self._base_board_dict[target]
977 got bigger, - means smaller). The nunmbers are the average number
981 powerpc: (622 boards) text -0.0
982 arm: (285 boards) text -0.0
983 nds32: (3 boards) text -8.0
987 board.target
989 commit, keyed by board.target. The value is an Outcome object.
998 for target in board_dict:
999 if target not in board_selected:
1001 base_sizes = self._base_board_dict[target].sizes
1002 outcome = board_dict[target]
1005 # Loop through the list of images, creating a dict of size
1007 # {'target' : 'snapper9g45, 'data' : 5, 'u-boot-spl:text' : -4}
1008 # which means that U-Boot data increased by 5 bytes and SPL
1010 err = {'_target' : target}
1016 diff = sizes[image][part] - base_image[part]
1019 if image == 'u-boot':
1024 arch = board_selected[target].arch
1030 pass # Only add to our list when we have some stats
1036 # We now have a list of image size changes sorted by arch
1089 board.target
1091 commit, keyed by board.target. The value is an Outcome object.
1092 err_lines: A list of errors for this commit, or [] if there is
1094 err_line_boards: Dict keyed by error line, containing a list of
1096 warn_lines: A list of warnings for this commit, or [] if there is
1098 warn_line_boards: Dict keyed by warning line, containing a list of
1100 config: Dictionary keyed by filename - e.g. '.config'. Each
1118 String containing a list of boards with that error line, or
1119 '' if the user has not requested such a list
1124 if not board.target in names:
1125 names.append(board.target)
1141 better_lines.append(char + '-' +
1164 """Add changes in configuration to a list
1167 lines: list to add to
1182 lines.append(_CalcConfig('-', name, config_minus))
1192 elif line[0] == '-':
1199 ok_boards = [] # List of boards fixed since last commit
1200 warn_boards = [] # List of boards with warnings since last commit
1201 err_boards = [] # List of new broken boards since last commit
1202 new_boards = [] # List of boards that didn't exist last time
1203 unknown_boards = [] # List of boards that were not built
1205 for target in board_dict:
1206 if target not in board_selected:
1209 # If the board was built last time, add its outcome to a list
1210 if target in self._base_board_dict:
1211 base_outcome = self._base_board_dict[target].rc
1212 outcome = board_dict[target]
1214 unknown_boards.append(target)
1217 warn_boards.append(target)
1219 ok_boards.append(target)
1222 warn_boards.append(target)
1224 err_boards.append(target)
1226 new_boards.append(target)
1228 # Get a list of errors that have appeared, and disappeared
1271 for target in board_dict:
1272 if target not in board_selected:
1275 tbase = self._base_environment[target]
1276 tenvironment = environment[target]
1290 desc = '%s -> %s' % (value, new_value)
1293 _AddConfig(lines, target, environment_plus, environment_minus,
1305 for target in board_dict:
1306 if target not in board_selected:
1308 arch = board_selected[target].arch
1321 for target in board_dict:
1322 if target not in board_selected:
1325 arch = board_selected[target].arch
1330 tbase = self._base_config[target]
1331 tconfig = config[target]
1351 desc = '%s -> %s' % (value, new_value)
1363 summary[target] = '\n'.join(lines)
1366 for target, lines in summary.iteritems():
1368 lines_by_target[lines].append(target)
1370 lines_by_target[lines] = [target]
1385 #arch_summary[target] = '\n'.join(lines)
1406 # Get a list of boards that did not get built, if needed
1433 """Show a build summary for U-Boot for a given board list.
1461 count = (self.commit_count + self._step - 1) / self._step
1537 """Build all commits for a list of boards
1540 commits: List of commits to be build, each a Commit object
1541 boards_selected: Dict of selected boards, key is target name,
1547 - number of boards that failed to build
1548 - number of boards that issued warnings
1572 term = threading.Thread(target=self.queue.join)