symboljoin(symtable, nm_out) # check if the path for all symbols is set check_completeness(symtable) # dump symbols to STDIO if verbose option is set if args.v or args.m: dump_modules(symtable) if args.v: dump_table(symtable) if args.c: write_csv(symtable, args.c) # export results to json file data = {'app': app, 'board': args.board, 'symbols': symtable} with open("root/symbols.json", 'w') as f: json.dump(data, f, indent=4) print("\nResult validation: both size outputs below should match") print("Computed sums of parsed symbols:") res = {'t': 0, 'd': 0, 'b': 0, 'sum': 0} for sym in symtable: res[sym['type']] += sym['size'] res['sum'] += sym['size'] print_size(res) # DEGBUG: output size results print("Output of the '" + args.p + "size' command:") print(subprocess.check_output((args.p + 'size', elffile))) if not args.d: frontend_server.run('root', 12345, 'index.html')
if args.b: os.environ['BOARD'] = board start = time.time() * 1000 subprocess.call( ('make', '-B', 'clean', 'all'), cwd=base, ) buildtime = (time.time() * 1000) - start else: buildtime = 0 if path.isfile(elffile): size = subprocess.check_output(('size', elffile)) m = re.search("^ *(\d+)[ \t]+(\d+)[ \t]+(\d+)", size, re.MULTILINE) if m: data['boards'].append({ 'board': board, 'buildtime': buildtime, 't': m.group(1), 'd': m.group(2), 'b': m.group(3) }) # export results to json file with open("root/sizes.json", 'w') as f: json.dump(data, f, indent=4) frontend_server.run('root', 12345, 'apphis.html')
nm_out = parse_elffile(elffile) # get symbol sizes and addresses archive and object files from map file symtable = parse_mapfile(mapfile) # join them into one symbol table symboljoin(symtable, nm_out) # check if the path for all symbols is set check_completeness(symtable) # dump symbols to STDIO if verbose option is set if args.v: dump_table(symtable) # export results to json file data = {'app': app, 'board': args.board, 'symbols': symtable} with open("root/symbols.json", 'w') as f: json.dump(data, f, indent = 4) print("\nResult validation: both size outputs below should match") print("Computed sums of parsed symbols:") res = {'t': 0, 'd': 0, 'b': 0, 'sum': 0} for sym in symtable: res[sym['type']] += sym['size'] res['sum'] += sym['size'] print_size(res) # DEGBUG: output size results print("Output of the '" + args.p + "size' command:") print(subprocess.check_output((args.p + 'size', elffile))) frontend_server.run('root', 12345, 'index.html')
for board in boards: elffile = base + "/bin/" + board + "/" + app + ".elf" if args.b: os.environ['BOARD'] = board start = time.time() * 1000 subprocess.call(('make', '-B', 'clean', 'all'), cwd=base, ) buildtime = (time.time() * 1000) - start else: buildtime = 0 if path.isfile(elffile): size = subprocess.check_output(('size', elffile)) m = re.search("^ *(\d+)[ \t]+(\d+)[ \t]+(\d+)", size, re.MULTILINE) if m: data['boards'].append({ 'board': board, 'buildtime': buildtime, 't': m.group(1), 'd': m.group(2), 'b':m.group(3) }) # export results to json file with open("root/sizes.json", 'w') as f: json.dump(data, f, indent = 4) frontend_server.run('root', 12345, 'apphis.html')