scripts: size_report: recognize C++ file extensions
This adds some common C++ file extensions so the script can recognize those as source file, and display them in different color. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
86cff1a857
commit
1e8f6be1fd
1 changed files with 3 additions and 1 deletions
|
@ -47,6 +47,8 @@ SHF_ALLOC_EXEC = SHF_ALLOC | SHF_EXEC
|
|||
|
||||
DT_LOCATION = re.compile(r"\(DW_OP_addr: ([0-9a-f]+)\)")
|
||||
|
||||
SRC_FILE_EXT = ('.h', '.c', '.hpp', '.cpp', '.hxx', '.cxx', '.c++')
|
||||
|
||||
|
||||
def get_symbol_addr(sym):
|
||||
"""Get the address of a symbol"""
|
||||
|
@ -599,7 +601,7 @@ def print_any_tree(root, total_size, depth):
|
|||
if not row.node.children:
|
||||
cc = Fore.CYAN
|
||||
cr = Fore.RESET
|
||||
elif row.node.name.endswith(".c") or row.node.name.endswith(".h"):
|
||||
elif row.node.name.endswith(SRC_FILE_EXT):
|
||||
cc = Fore.GREEN
|
||||
cr = Fore.RESET
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue