mirror of https://github.com/ARMmbed/mbed-os.git
Add delta to subtotals
parent
0e622ded63
commit
c2642a1c9a
|
@ -678,6 +678,14 @@ class MemapParser(object):
|
||||||
file_desc.write('\n')
|
file_desc.write('\n')
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
RAM_FORMAT_STR = (
|
||||||
|
"Total Static RAM memory (data + bss): {}({:+}) bytes\n"
|
||||||
|
)
|
||||||
|
|
||||||
|
ROM_FORMAT_STR = (
|
||||||
|
"Total Flash memory (text + data): {}({:+}) bytes\n"
|
||||||
|
)
|
||||||
|
|
||||||
def generate_csv(self, file_desc):
|
def generate_csv(self, file_desc):
|
||||||
"""Generate a CSV file from a memoy map
|
"""Generate a CSV file from a memoy map
|
||||||
|
|
||||||
|
@ -732,17 +740,22 @@ class MemapParser(object):
|
||||||
|
|
||||||
subtotal_row = ['Subtotals']
|
subtotal_row = ['Subtotals']
|
||||||
for k in self.print_sections:
|
for k in self.print_sections:
|
||||||
subtotal_row.append(self.subtotal[k])
|
subtotal_row.append("{}({:+})".format(
|
||||||
|
self.subtotal[k], self.subtotal[k + '-delta']))
|
||||||
|
|
||||||
table.add_row(subtotal_row)
|
table.add_row(subtotal_row)
|
||||||
|
|
||||||
output = table.get_string()
|
output = table.get_string()
|
||||||
output += '\n'
|
output += '\n'
|
||||||
|
|
||||||
output += "Total Static RAM memory (data + bss): %s bytes\n" % \
|
output += self.RAM_FORMAT_STR.format(
|
||||||
str(self.mem_summary['static_ram'])
|
self.mem_summary['static_ram'],
|
||||||
output += "Total Flash memory (text + data): %s bytes\n" % \
|
self.mem_summary['static_ram_delta']
|
||||||
str(self.mem_summary['total_flash'])
|
)
|
||||||
|
output += self.ROM_FORMAT_STR.format(
|
||||||
|
self.mem_summary['total_flash'],
|
||||||
|
self.mem_summary['total_flash_delta']
|
||||||
|
)
|
||||||
|
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
@ -751,16 +764,24 @@ class MemapParser(object):
|
||||||
def compute_report(self):
|
def compute_report(self):
|
||||||
""" Generates summary of memory usage for main areas
|
""" Generates summary of memory usage for main areas
|
||||||
"""
|
"""
|
||||||
for k in self.sections:
|
self.subtotal = defaultdict(int)
|
||||||
self.subtotal[k] = 0
|
|
||||||
|
|
||||||
for mod in self.modules.values():
|
for mod in self.modules.values():
|
||||||
for k in self.sections:
|
for k in self.sections:
|
||||||
self.subtotal[k] += mod[k]
|
self.subtotal[k] += mod[k]
|
||||||
|
self.subtotal[k + '-delta'] += mod[k]
|
||||||
|
if self.old_modules:
|
||||||
|
for mod in self.old_modules.values():
|
||||||
|
for k in self.sections:
|
||||||
|
self.subtotal[k + '-delta'] -= mod[k]
|
||||||
|
|
||||||
self.mem_summary = {
|
self.mem_summary = {
|
||||||
'static_ram': (self.subtotal['.data'] + self.subtotal['.bss']),
|
'static_ram': self.subtotal['.data'] + self.subtotal['.bss'],
|
||||||
|
'static_ram_delta':
|
||||||
|
self.subtotal['.data-delta'] + self.subtotal['.bss-delta'],
|
||||||
'total_flash': (self.subtotal['.text'] + self.subtotal['.data']),
|
'total_flash': (self.subtotal['.text'] + self.subtotal['.data']),
|
||||||
|
'total_flash_delta':
|
||||||
|
self.subtotal['.text-delta'] + self.subtotal['.data-delta'],
|
||||||
}
|
}
|
||||||
|
|
||||||
self.mem_report = []
|
self.mem_report = []
|
||||||
|
|
Loading…
Reference in New Issue