feat(memmap): add tabular memory use data
Add support for tabulating static memory consumption data from ELF
binaries. This relies on static symbols, defined in the linker files,
that provide information about the memory ranges.
Change-Id: Ie19cd2b80a7b591607640feeb84c63266963ea4d
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
diff --git a/tools/memory/memory/memmap.py b/tools/memory/memory/memmap.py
index 7057228..e6b66f9 100755
--- a/tools/memory/memory/memmap.py
+++ b/tools/memory/memory/memmap.py
@@ -36,11 +36,16 @@
type=click.Choice(["debug", "release"], case_sensitive=False),
)
@click.option(
+ "-f",
+ "--footprint",
+ is_flag=True,
+ show_default=True,
+ help="Generate a high level view of memory usage by memory types.",
+)
+@click.option(
"-s",
"--symbols",
is_flag=True,
- show_default=True,
- default=True,
help="Generate a map of important TF symbols.",
)
@click.option("-w", "--width", type=int, envvar="COLUMNS")
@@ -54,6 +59,7 @@
root: Path,
platform: str,
build_type: str,
+ footprint: bool,
symbols: bool,
width: int,
d: bool,
@@ -64,6 +70,9 @@
parser = TfaBuildParser(build_path)
printer = TfaPrettyPrinter(columns=width, as_decimal=d)
+ if footprint or not symbols:
+ printer.print_footprint(parser.get_mem_usage_dict())
+
if symbols:
expr = (
r"(.*)(TEXT|BSS|RODATA|STACKS|_OPS|PMF|XLAT|GOT|FCONF"