Lines Matching +full:line +full:- +full:name

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',
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
150 last_line_len: Length of the last line we printed (used for erasing
152 num_jobs: Number of jobs to run at once (passed to make as -j)
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
192 - Each value is itself a dictionary containing
195 func_sizes: Dictionary keyed by filename - e.g. 'u-boot'. Each
197 key: function name
199 config: Dictionary keyed by filename - e.g. '.config'. Each
201 key: config name
223 num_jobs: Number of jobs to run at once (passed to make as -j)
224 gnu_make: the command name of GNU Make.
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
337 delta = self._timestamps[-1] - self._timestamps[0]
346 todo = self.count - self.upto
350 self._complete_delay -= timedelta(
355 count -= 1
358 """Clear any characters on the current line
360 Make way for a new line of length 'length', by outputting enough
361 spaces to clear out the old line. Then remember the new length for
365 length: Length of new line, in characters
368 Print(' ' * (self.last_line_len - length), newline=False)
428 ok = self.upto - self.warned - self.fail
429 line = '\r' + self.col.Color(self.col.GREEN, '%5d' % ok)
430 line += self.col.Color(self.col.YELLOW, '%5d' % self.warned)
431 line += self.col.Color(self.col.RED, '%5d' % self.fail)
433 name = ' /%-5d ' % self.count
438 name += '%s : ' % self._complete_delay
442 name += 'commit %2d/%-3d' % (self.commit_upto + 1,
445 name += target
446 Print(line + name, newline=False)
447 length = 16 + len(name)
451 """Get the name of the output directory for a commit number
456 commit_upto: Commit number to use (0..self.count-1)
471 """Get the name of the build directory for a commit number
476 commit_upto: Commit number to use (0..self.count-1)
477 target: Target name
483 """Get the name of the done file for a commit number
486 commit_upto: Commit number to use (0..self.count-1)
487 target: Target name
492 """Get the name of the sizes file for a commit number
495 commit_upto: Commit number to use (0..self.count-1)
496 target: Target name
501 """Get the name of the funcsizes file for a commit number and ELF file
504 commit_upto: Commit number to use (0..self.count-1)
505 target: Target name
509 '%s.sizes' % elf_fname.replace('/', '-'))
512 """Get the name of the objdump file for a commit number and ELF file
515 commit_upto: Commit number to use (0..self.count-1)
516 target: Target name
520 '%s.objdump' % elf_fname.replace('/', '-'))
523 """Get the name of the err file for a commit number
526 commit_upto: Commit number to use (0..self.count-1)
527 target: Target name
543 for line in lines:
544 if not self.re_make_err.search(line):
545 out_lines.append(line)
557 function name.
560 for line in fd.readlines():
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
568 if '.' in name[1:]:
569 name = 'static.' + name.split('.')[0]
570 sym[name] = sym.get(name, 0) + int(size, 16)
584 key: Config name (e.g. CONFIG_DM)
590 for line in fd:
591 line = line.strip()
592 if line.startswith('#define'):
593 values = line[8:].split(' ', 1)
601 elif not line or line[0] in ['#', '*', '/']:
604 key, value = line.split('=', 1)
615 commit_upto: Commit number to check (0..n-1)
648 for line in fd.readlines():
649 values = line.split()
656 'text' : int(values[0]) - rodata,
673 for name in self.config_filenames:
674 fname = os.path.join(output_dir, name)
675 config[name] = self._ProcessConfig(fname)
687 commit_upto: Commit number to summarize (0..self.count-1)
696 Dict keyed by error line, containing a list of the Board
699 Dict keyed by error line, containing a list of the Board
702 key: filename - e.g. '.config'
704 key: config name
707 def AddLine(lines_summary, lines_boards, line, board): argument
708 line = line.rstrip()
709 if line in lines_boards:
710 lines_boards[line].append(board)
712 lines_boards[line] = [board]
713 lines_summary.append(line)
728 for line in outcome.err_lines:
729 if line:
730 if (self._re_function.match(line) or
731 self._re_files.match(line)):
732 last_func = line
734 is_warning = self._re_warning.match(line)
735 is_note = self._re_note.match(line)
741 line, board)
747 line, board)
769 arch_list: Dict keyed by arch name. Value is a string containing
826 for name in old:
827 if name not in common:
829 down += old[name]
830 delta.append([-old[name], name])
832 for name in new:
833 if name not in common:
835 up += new[name]
836 delta.append([new[name], name])
838 for name in common:
839 diff = new.get(name, 0) - old.get(name, 0)
843 shrink, down = shrink + 1, down - diff
844 delta.append([diff, name])
849 args = [add, -remove, grow, -shrink, up, -down, up - down]
856 Print('%s %-38s %7s %7s %+7s' % (indent, 'function', 'old', 'new',
858 for diff, name in delta:
861 msg = '%s %-38s %7s %7s %+7d' % (indent, name,
862 old.get(name, '-'), new.get(name,'-'), diff)
871 'target': Target name
880 for name in sorted(result):
881 diff = result[name]
882 if name.startswith('_'):
886 msg = ' %s %+d' % (name, diff)
888 Print('%10s %-15s:' % ('', result['_target']),
908 The summary takes the form of one line per architecture. The
909 line contains deltas for each of the sections (+ means the section
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
940 # {'target' : 'snapper9g45, 'data' : 5, 'u-boot-spl:text' : -4}
941 # which means that U-Boot data increased by 5 bytes and SPL
949 diff = sizes[image][part] - base_image[part]
952 if image == 'u-boot':
953 name = part
955 name = image + ':' + part
956 err[name] = diff
976 for name, diff in result.iteritems():
977 if name.startswith('_'):
980 if name in totals:
981 totals[name] += diff
983 totals[name] = diff
989 for name in sorted(totals):
990 diff = totals[name]
992 # Display the average difference in this name for this
996 msg = ' %s %+1.1f' % (name, avg_diff)
1027 err_line_boards: Dict keyed by error line, containing a list of
1031 warn_line_boards: Dict keyed by warning line, containing a list of
1033 config: Dictionary keyed by filename - e.g. '.config'. Each
1035 key: config name
1042 def _BoardList(line, line_boards): argument
1043 """Helper function to get a line of boards containing a line
1046 line: Error line to search for
1048 String containing a list of boards with that error line, or
1053 for board in line_boards[line]:
1065 for line in lines:
1066 if line not in base_lines:
1068 _BoardList(line, line_boards) + line)
1069 for line in base_lines:
1070 if line not in lines:
1071 better_lines.append(char + '-' +
1072 _BoardList(line, base_line_boards) + line)
1075 def _CalcConfig(delta, name, config): argument
1080 name: name of the file which changed (e.g. .config)
1082 key: config name
1091 return '%s %s: %s' % (delta, name, out)
1093 def _AddConfig(lines, name, config_plus, config_minus, config_change): argument
1098 name: config file name
1100 key: config name
1103 key: config name
1106 key: config name
1110 lines.append(_CalcConfig('+', name, config_plus))
1112 lines.append(_CalcConfig('-', name, config_minus))
1114 lines.append(_CalcConfig('c', name, config_change))
1117 for line in lines:
1118 if not line:
1120 if line[0] == '+':
1122 elif line[0] == '-':
1124 elif line[0] == 'c':
1126 Print(' ' + line, newline=True, colour=col)
1207 for name in self.config_filenames:
1208 arch_config_plus[arch][name] = {}
1209 arch_config_minus[arch][name] = {}
1210 arch_config_change[arch][name] = {}
1224 for name in self.config_filenames:
1225 if not tconfig.config[name]:
1230 base = tbase.config[name]
1231 for key, value in tconfig.config[name].iteritems():
1236 if key not in tconfig.config[name]:
1242 desc = '%s -> %s' % (value, new_value)
1246 arch_config_plus[arch][name].update(config_plus)
1247 arch_config_minus[arch][name].update(config_minus)
1248 arch_config_change[arch][name].update(config_change)
1250 _AddConfig(lines, name, config_plus, config_minus,
1268 for name in self.config_filenames:
1269 all_plus.update(arch_config_plus[arch][name])
1270 all_minus.update(arch_config_minus[arch][name])
1271 all_change.update(arch_config_change[arch][name])
1272 _AddConfig(lines, name, arch_config_plus[arch][name],
1273 arch_config_minus[arch][name],
1274 arch_config_change[arch][name])
1322 """Show a build summary for U-Boot for a given board list.
1350 count = (self.commit_count + self._step - 1) / self._step
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