@@ -446,7 +446,7 @@ def build_project(src_paths, build_path, target, toolchain_name,
446
446
macros = None , inc_dirs = None , jobs = 1 , silent = False ,
447
447
report = None , properties = None , project_id = None ,
448
448
project_description = None , extra_verbose = False , config = None ,
449
- app_config = None , build_profile = None ):
449
+ app_config = None , build_profile = None , stats_depth = None ):
450
450
""" Build a project. A project may be a test or a user program.
451
451
452
452
Positional arguments:
@@ -475,6 +475,7 @@ def build_project(src_paths, build_path, target, toolchain_name,
475
475
config - a Config object to use instead of creating one
476
476
app_config - location of a chosen mbed_app.json file
477
477
build_profile - a dict of flags that will be passed to the compiler
478
+ stats_depth - depth level for memap to display file/dirs
478
479
"""
479
480
480
481
# Convert src_path to a list if needed
@@ -553,18 +554,18 @@ def build_project(src_paths, build_path, target, toolchain_name,
553
554
memap_table = ''
554
555
if memap_instance :
555
556
# Write output to stdout in text (pretty table) format
556
- memap_table = memap_instance .generate_output ('table' )
557
+ memap_table = memap_instance .generate_output ('table' , stats_depth )
557
558
558
559
if not silent :
559
560
print memap_table
560
561
561
562
# Write output to file in JSON format
562
563
map_out = join (build_path , name + "_map.json" )
563
- memap_instance .generate_output ('json' , map_out )
564
+ memap_instance .generate_output ('json' , stats_depth , map_out )
564
565
565
566
# Write output to file in CSV format for the CI
566
567
map_csv = join (build_path , name + "_map.csv" )
567
- memap_instance .generate_output ('csv-ci' , map_csv )
568
+ memap_instance .generate_output ('csv-ci' , stats_depth , map_csv )
568
569
569
570
resources .detect_duplicates (toolchain )
570
571
@@ -573,7 +574,7 @@ def build_project(src_paths, build_path, target, toolchain_name,
573
574
cur_result ["elapsed_time" ] = end - start
574
575
cur_result ["output" ] = toolchain .get_output () + memap_table
575
576
cur_result ["result" ] = "OK"
576
- cur_result ["memory_usage" ] = toolchain . map_outputs
577
+ cur_result ["memory_usage" ] = memap_instance . mem_report
577
578
cur_result ["bin" ] = res
578
579
cur_result ["elf" ] = splitext (res )[0 ] + ".elf"
579
580
cur_result .update (toolchain .report )
@@ -1163,7 +1164,7 @@ def mcu_toolchain_list(release_version='5'):
1163
1164
1164
1165
1165
1166
def mcu_target_list (release_version = '5' ):
1166
- """ Shows target list
1167
+ """ Shows target list
1167
1168
1168
1169
"""
1169
1170
@@ -1323,7 +1324,7 @@ def print_build_memory_usage(report):
1323
1324
"""
1324
1325
from prettytable import PrettyTable
1325
1326
columns_text = ['name' , 'target' , 'toolchain' ]
1326
- columns_int = ['static_ram' , 'stack' , 'heap' , 'total_ram' , ' total_flash' ]
1327
+ columns_int = ['static_ram' , 'total_flash' ]
1327
1328
table = PrettyTable (columns_text + columns_int )
1328
1329
1329
1330
for col in columns_text :
@@ -1350,10 +1351,6 @@ def print_build_memory_usage(report):
1350
1351
record ['toolchain_name' ],
1351
1352
record ['memory_usage' ][- 1 ]['summary' ][
1352
1353
'static_ram' ],
1353
- record ['memory_usage' ][- 1 ]['summary' ]['stack' ],
1354
- record ['memory_usage' ][- 1 ]['summary' ]['heap' ],
1355
- record ['memory_usage' ][- 1 ]['summary' ][
1356
- 'total_ram' ],
1357
1354
record ['memory_usage' ][- 1 ]['summary' ][
1358
1355
'total_flash' ],
1359
1356
]
0 commit comments