scripts: size_report: add tree node for hidden symbols
The list of symbols only contain visible symbols that can be obtained through ELF file. There are code and data where the toolchain never emits symbols for them and thus are not visible in the list. So add a "(hidden)" node to the tree to show they are there. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
e87c82df51
commit
c3e8c4e6dc
1 changed files with 7 additions and 2 deletions
|
@ -553,7 +553,7 @@ def sum_node_children_size(node):
|
|||
return size
|
||||
|
||||
|
||||
def generate_any_tree(symbol_dict, path_prefix):
|
||||
def generate_any_tree(symbol_dict, total_size, path_prefix):
|
||||
"""
|
||||
Generate a symbol tree for output.
|
||||
"""
|
||||
|
@ -637,6 +637,11 @@ def generate_any_tree(symbol_dict, path_prefix):
|
|||
# Root node doesn't have sum of symbol size. So sum them up.
|
||||
root.size = sum_node_children_size(root)
|
||||
|
||||
# Need to account for code and data where there are not emitted
|
||||
# symbols associated with them.
|
||||
node_hidden_syms = TreeNode('(hidden)', "(hidden)", parent=root)
|
||||
node_hidden_syms.size = total_size - root.size
|
||||
|
||||
return root
|
||||
|
||||
|
||||
|
@ -747,7 +752,7 @@ def main():
|
|||
for sym in processed['unmapped_symbols']:
|
||||
print("INFO: Unmapped symbol: {0}".format(sym))
|
||||
|
||||
root = generate_any_tree(symbol_dict, common_path_prefix)
|
||||
root = generate_any_tree(symbol_dict, symsize, common_path_prefix)
|
||||
print_any_tree(root, symsize, args.depth)
|
||||
|
||||
if args.json:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue