Skip to content

Commit fbd8a41

Browse files
Marcelo SalazarMarcelo Salazar
authored andcommitted
Reverted changes and improved wording
1 parent c0f53cc commit fbd8a41

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tools/memap.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,9 @@ def generate_output(self, export_format, file_output=None):
403403
json_obj.append({\
404404
'summary':{\
405405
'total_static_ram':(subtotal['.data']+subtotal['.bss']),\
406+
'allocated_heap':(subtotal['.heap']),\
407+
'allocated_stack':(subtotal['.stack']),\
408+
'total_ram':(subtotal['.data']+subtotal['.bss']+subtotal['.heap']+subtotal['.stack']),\
406409
'total_flash':(subtotal['.text']+subtotal['.data']+misc_flash_mem),}})
407410

408411
file_desc.write(json.dumps(json_obj, indent=4))
@@ -422,6 +425,21 @@ def generate_output(self, export_format, file_output=None):
422425
csv_module_section += ['total_static_ram']
423426
csv_sizes += [subtotal['.data']+subtotal['.bss']]
424427

428+
csv_module_section += ['allocated_heap']
429+
if subtotal['.heap'] == 0:
430+
csv_sizes += ['unknown']
431+
else:
432+
csv_sizes += [subtotal['.heap']]
433+
434+
csv_module_section += ['allocated_stack']
435+
if subtotal['.stack'] == 0:
436+
csv_sizes += ['unknown']
437+
else:
438+
csv_sizes += [subtotal['.stack']]
439+
440+
csv_module_section += ['total_ram']
441+
csv_sizes += [subtotal['.data']+subtotal['.bss']+subtotal['.heap']+subtotal['.stack']]
442+
425443
csv_module_section += ['total_flash']
426444
csv_sizes += [subtotal['.text']+subtotal['.data']+misc_flash_mem]
427445

@@ -431,7 +449,19 @@ def generate_output(self, export_format, file_output=None):
431449
else: # default format is 'table'
432450
file_desc.write(table.get_string())
433451
file_desc.write('\n')
452+
453+
if subtotal['.heap'] == 0:
454+
file_desc.write("Allocated Heap: unknown\n")
455+
else:
456+
file_desc.write("Allocated Heap: %s bytes\n" % str(subtotal['.heap']))
457+
458+
if subtotal['.stack'] == 0:
459+
file_desc.write("Allocated Stack: unknown\n")
460+
else:
461+
file_desc.write("Allocated Stack: %s bytes\n" % str(subtotal['.stack']))
462+
434463
file_desc.write("Total Static RAM memory (data + bss): %s bytes\n" % (str(subtotal['.data']+subtotal['.bss'])))
464+
file_desc.write("Total RAM memory (data + bss + heap + stack): %s bytes\n" % (str(subtotal['.data']+subtotal['.bss']+subtotal['.heap']+subtotal['.stack'])))
435465
file_desc.write("Total Flash memory (text + data + misc): %s bytes\n" % (str(subtotal['.text']+subtotal['.data']+misc_flash_mem)))
436466

437467
if file_desc is not sys.stdout:

0 commit comments

Comments
 (0)