Harrison Mutai | e9bc488 | 2023-02-23 10:33:58 +0000 | [diff] [blame] | 1 | TF-A Memory Layout Tool |
| 2 | ======================= |
| 3 | |
| 4 | TF-A's memory layout tool is a Python script for analyzing the virtual |
| 5 | memory layout of TF-A builds. |
| 6 | |
| 7 | Prerequisites |
| 8 | ~~~~~~~~~~~~~ |
| 9 | |
| 10 | #. Python (3.8 or later) |
| 11 | #. `Poetry`_ Python package manager |
| 12 | |
| 13 | Getting Started |
| 14 | ~~~~~~~~~~~~~~~ |
| 15 | |
| 16 | #. Install Poetry |
| 17 | |
| 18 | .. code:: shell |
| 19 | |
| 20 | curl -sSL https://install.python-poetry.org | python3 - |
| 21 | |
| 22 | #. Install the required packages |
| 23 | |
| 24 | .. code:: shell |
| 25 | |
Chris Kay | a116b87 | 2025-01-28 18:04:11 +0000 | [diff] [blame] | 26 | poetry install --no-root |
Harrison Mutai | e9bc488 | 2023-02-23 10:33:58 +0000 | [diff] [blame] | 27 | |
| 28 | #. Verify that the tool runs in the installed virtual environment |
| 29 | |
| 30 | .. code:: shell |
| 31 | |
| 32 | poetry run memory --help |
| 33 | |
| 34 | Symbol Virtual Map |
| 35 | ~~~~~~~~~~~~~~~~~~ |
| 36 | |
| 37 | The tool can be used to generate a visualisation of the symbol table. By |
| 38 | default, it prints the symbols representing the start and end address of the |
| 39 | main memory regions in an ELF file (i.e. text, bss, rodata) but can be modified |
| 40 | to print any set of symbols. |
| 41 | |
| 42 | .. code:: shell |
| 43 | |
Chris Kay | 2b544d7 | 2025-04-15 14:00:50 +0100 | [diff] [blame] | 44 | $ poetry run memory symbols |
Harrison Mutai | e9bc488 | 2023-02-23 10:33:58 +0000 | [diff] [blame] | 45 | build-path: build/fvp/release |
| 46 | Virtual Address Map: |
| 47 | +------------__BL1_RAM_END__------------+---------------------------------------+ |
| 48 | +---------__COHERENT_RAM_END__----------+ | |
| 49 | +--------__COHERENT_RAM_START__---------+ | |
| 50 | 0x0403b000 +----------__XLAT_TABLE_END__-----------+ | |
| 51 | 0x04036000 +---------__XLAT_TABLE_START__----------+ | |
| 52 | +--------__BASE_XLAT_TABLE_END__--------+ | |
| 53 | 0x04035600 +--------------__BSS_END__--------------+ | |
| 54 | +-------__BASE_XLAT_TABLE_START__-------+ | |
| 55 | +-----__PMF_PERCPU_TIMESTAMP_END__------+ | |
| 56 | +---------__PMF_TIMESTAMP_END__---------+ | |
| 57 | 0x04035400 +--------__PMF_TIMESTAMP_START__--------+ | |
| 58 | +-------------__BSS_START__-------------+ | |
| 59 | 0x04034a00 +------------__STACKS_END__-------------+ | |
| 60 | 0x04034500 +-----------__STACKS_START__------------+ | |
| 61 | 0x040344c5 +-----------__DATA_RAM_END__------------+ | |
| 62 | +-----------__BL1_RAM_START__-----------+ | |
| 63 | 0x04034000 +----------__DATA_RAM_START__-----------+ | |
| 64 | | +---------__COHERENT_RAM_END__----------+ |
| 65 | | +--------__COHERENT_RAM_START__---------+ |
| 66 | 0x0402e000 | +----------__XLAT_TABLE_END__-----------+ |
| 67 | 0x04029000 | +---------__XLAT_TABLE_START__----------+ |
| 68 | | +--------__BASE_XLAT_TABLE_END__--------+ |
| 69 | 0x04028800 | +--------------__BSS_END__--------------+ |
| 70 | | +-------__BASE_XLAT_TABLE_START__-------+ |
| 71 | | +-----__PMF_PERCPU_TIMESTAMP_END__------+ |
| 72 | | +---------__PMF_TIMESTAMP_END__---------+ |
| 73 | 0x04028580 | +--------__PMF_TIMESTAMP_START__--------+ |
| 74 | 0x04028000 | +-------------__BSS_START__-------------+ |
| 75 | 0x04027e40 | +------------__STACKS_END__-------------+ |
| 76 | 0x04027840 | +-----------__STACKS_START__------------+ |
| 77 | 0x04027000 | +------------__RODATA_END__-------------+ |
| 78 | | +------------__CPU_OPS_END__------------+ |
| 79 | | +-----------__CPU_OPS_START__-----------+ |
| 80 | | +--------__FCONF_POPULATOR_END__--------+ |
| 81 | | +--------------__GOT_END__--------------+ |
| 82 | | +-------------__GOT_START__-------------+ |
| 83 | | +---------__PMF_SVC_DESCS_END__---------+ |
| 84 | 0x04026c10 | +--------__PMF_SVC_DESCS_START__--------+ |
| 85 | 0x04026bf8 | +-------__FCONF_POPULATOR_START__-------+ |
| 86 | | +-----------__RODATA_START__------------+ |
| 87 | 0x04026000 | +-------------__TEXT_END__--------------+ |
| 88 | 0x04021000 | +------------__TEXT_START__-------------+ |
| 89 | 0x000062b5 +------------__BL1_ROM_END__------------+ | |
| 90 | 0x00005df0 +----------__DATA_ROM_START__-----------+ | |
| 91 | +------------__CPU_OPS_END__------------+ | |
| 92 | +--------------__GOT_END__--------------+ | |
| 93 | +-------------__GOT_START__-------------+ | |
| 94 | 0x00005de8 +------------__RODATA_END__-------------+ | |
| 95 | +-----------__CPU_OPS_START__-----------+ | |
| 96 | +--------__FCONF_POPULATOR_END__--------+ | |
| 97 | +---------__PMF_SVC_DESCS_END__---------+ | |
| 98 | 0x00005c98 +--------__PMF_SVC_DESCS_START__--------+ | |
| 99 | 0x00005c80 +-------__FCONF_POPULATOR_START__-------+ | |
| 100 | +-----------__RODATA_START__------------+ | |
| 101 | 0x00005000 +-------------__TEXT_END__--------------+ | |
| 102 | 0x00000000 +------------__TEXT_START__-------------+---------------------------------------+ |
| 103 | |
| 104 | Addresses are displayed in hexadecimal by default but can be printed in decimal |
| 105 | instead with the ``-d`` option. |
| 106 | |
| 107 | Because of the length of many of the symbols, the tool defaults to a text width |
| 108 | of 120 chars. This can be increased if needed with the ``-w`` option. |
| 109 | |
| 110 | For more detailed help instructions, run: |
| 111 | |
| 112 | .. code:: shell |
| 113 | |
| 114 | poetry run memory --help |
| 115 | |
Harrison Mutai | 372b880 | 2023-02-23 11:30:17 +0000 | [diff] [blame] | 116 | Memory Footprint |
| 117 | ~~~~~~~~~~~~~~~~ |
| 118 | |
Chris Kay | 2b544d7 | 2025-04-15 14:00:50 +0100 | [diff] [blame] | 119 | The tool enables users to view static memory consumption. When the ``footprint`` |
| 120 | command is provided, the script analyses the ELF binaries in the build path to |
| 121 | generate a table (per memory type), showing memory allocation and usage. This is |
| 122 | the default output generated by the tool. |
Harrison Mutai | 372b880 | 2023-02-23 11:30:17 +0000 | [diff] [blame] | 123 | |
| 124 | .. code:: shell |
| 125 | |
Chris Kay | 2b544d7 | 2025-04-15 14:00:50 +0100 | [diff] [blame] | 126 | $ poetry run memory footprint |
Harrison Mutai | 372b880 | 2023-02-23 11:30:17 +0000 | [diff] [blame] | 127 | build-path: build/fvp/release |
| 128 | +----------------------------------------------------------------------------+ |
| 129 | | Memory Usage (bytes) [RAM] | |
| 130 | +-----------+------------+------------+------------+------------+------------+ |
| 131 | | Component | Start | Limit | Size | Free | Total | |
| 132 | +-----------+------------+------------+------------+------------+------------+ |
| 133 | | BL1 | 4034000 | 4040000 | 7000 | 5000 | c000 | |
| 134 | | BL2 | 4021000 | 4034000 | d000 | 6000 | 13000 | |
| 135 | | BL2U | 4021000 | 4034000 | a000 | 9000 | 13000 | |
| 136 | | BL31 | 4003000 | 4040000 | 1e000 | 1f000 | 3d000 | |
| 137 | +-----------+------------+------------+------------+------------+------------+ |
| 138 | |
| 139 | +----------------------------------------------------------------------------+ |
| 140 | | Memory Usage (bytes) [ROM] | |
| 141 | +-----------+------------+------------+------------+------------+------------+ |
| 142 | | Component | Start | Limit | Size | Free | Total | |
| 143 | +-----------+------------+------------+------------+------------+------------+ |
| 144 | | BL1 | 0 | 4000000 | 5df0 | 3ffa210 | 4000000 | |
| 145 | +-----------+------------+------------+------------+------------+------------+ |
| 146 | |
| 147 | The script relies on symbols in the symbol table to determine the start, end, |
| 148 | and limit addresses of each bootloader stage. |
| 149 | |
Harrison Mutai | 0c0afde | 2023-02-23 11:30:55 +0000 | [diff] [blame] | 150 | Memory Tree |
| 151 | ~~~~~~~~~~~ |
| 152 | |
Chris Kay | 2b544d7 | 2025-04-15 14:00:50 +0100 | [diff] [blame] | 153 | A hierarchical view of the memory layout can be produced by passing the ``tree`` |
| 154 | command to the tool. This gives the start, end, and size of each module, their |
| 155 | ELF segments as well as sections. |
Harrison Mutai | 0c0afde | 2023-02-23 11:30:55 +0000 | [diff] [blame] | 156 | |
| 157 | .. code:: shell |
| 158 | |
Chris Kay | 2b544d7 | 2025-04-15 14:00:50 +0100 | [diff] [blame] | 159 | $ poetry run memory tree |
Harrison Mutai | 0c0afde | 2023-02-23 11:30:55 +0000 | [diff] [blame] | 160 | build-path: build/fvp/release |
| 161 | name start end size |
| 162 | bl1 0 400c000 400c000 |
| 163 | ├── 00 0 5de0 5de0 |
| 164 | │ ├── .text 0 5000 5000 |
| 165 | │ └── .rodata 5000 5de0 de0 |
| 166 | ├── 01 4034000 40344c5 4c5 |
| 167 | │ └── .data 4034000 40344c5 4c5 |
| 168 | ├── 02 4034500 4034a00 500 |
| 169 | │ └── .stacks 4034500 4034a00 500 |
| 170 | ├── 04 4034a00 4035600 c00 |
| 171 | │ └── .bss 4034a00 4035600 c00 |
| 172 | └── 03 4036000 403b000 5000 |
| 173 | └── .xlat_table 4036000 403b000 5000 |
| 174 | bl2 4021000 4034000 13000 |
| 175 | ├── 00 4021000 4027000 6000 |
| 176 | │ ├── .text 4021000 4026000 5000 |
| 177 | │ └── .rodata 4026000 4027000 1000 |
| 178 | └── 01 4027000 402e000 7000 |
| 179 | ├── .data 4027000 4027809 809 |
| 180 | ├── .stacks 4027840 4027e40 600 |
| 181 | ├── .bss 4028000 4028800 800 |
| 182 | └── .xlat_table 4029000 402e000 5000 |
| 183 | bl2u 4021000 4034000 13000 |
| 184 | ├── 00 4021000 4025000 4000 |
| 185 | │ ├── .text 4021000 4024000 3000 |
| 186 | │ └── .rodata 4024000 4025000 1000 |
| 187 | └── 01 4025000 402b000 6000 |
| 188 | ├── .data 4025000 4025065 65 |
| 189 | ├── .stacks 4025080 4025480 400 |
| 190 | ├── .bss 4025600 4025c00 600 |
| 191 | └── .xlat_table 4026000 402b000 5000 |
| 192 | bl31 4003000 4040000 3d000 |
| 193 | ├── 02 ffe00000 ffe03000 3000 |
| 194 | │ └── .el3_tzc_dram ffe00000 ffe03000 3000 |
| 195 | ├── 00 4003000 4010000 d000 |
| 196 | │ └── .text 4003000 4010000 d000 |
| 197 | └── 01 4010000 4021000 11000 |
| 198 | ├── .rodata 4010000 4012000 2000 |
| 199 | ├── .data 4012000 401219d 19d |
| 200 | ├── .stacks 40121c0 40161c0 4000 |
| 201 | ├── .bss 4016200 4018c00 2a00 |
| 202 | ├── .xlat_table 4019000 4020000 7000 |
| 203 | └── .coherent_ram 4020000 4021000 1000 |
| 204 | |
| 205 | |
| 206 | The granularity of this view can be modified with the ``--depth`` option. For |
| 207 | instance, if you only require the tree up to the level showing segment data, |
| 208 | you can specify the depth with: |
| 209 | |
| 210 | .. code:: |
| 211 | |
Chris Kay | 2b544d7 | 2025-04-15 14:00:50 +0100 | [diff] [blame] | 212 | $ poetry run memory tree --depth 2 |
Harrison Mutai | 0c0afde | 2023-02-23 11:30:55 +0000 | [diff] [blame] | 213 | build-path: build/fvp/release |
| 214 | name start end size |
| 215 | bl1 0 400c000 400c000 |
| 216 | ├── 00 0 5df0 5df0 |
| 217 | ├── 01 4034000 40344c5 4c5 |
| 218 | ├── 02 4034500 4034a00 500 |
| 219 | ├── 04 4034a00 4035600 c00 |
| 220 | └── 03 4036000 403b000 5000 |
| 221 | bl2 4021000 4034000 13000 |
| 222 | ├── 00 4021000 4027000 6000 |
| 223 | └── 01 4027000 402e000 7000 |
| 224 | bl2u 4021000 4034000 13000 |
| 225 | ├── 00 4021000 4025000 4000 |
| 226 | └── 01 4025000 402b000 6000 |
| 227 | bl31 4003000 4040000 3d000 |
| 228 | ├── 02 ffe00000 ffe03000 3000 |
| 229 | ├── 00 4003000 4010000 d000 |
| 230 | └── 01 4010000 4021000 11000 |
| 231 | |
Jimmy Brisson | cc377ce | 2024-09-16 10:10:46 -0500 | [diff] [blame] | 232 | Memory Summary |
| 233 | ~~~~~~~~~~~~~~ |
| 234 | |
| 235 | The tool provides a by-translation-unit summary of the sizes (``text``, ``bss``, |
| 236 | ``data``) contributed by each translation unit or group of translation units. |
| 237 | For example, to print a table of an FVP build, with a path depth of 3: |
| 238 | |
| 239 | .. code:: |
| 240 | |
| 241 | $ poetry run memory summary build/fvp/debug/bl1/bl1.map -d 3 |
| 242 | | Module | .text | .data | .bss | |
| 243 | |----------------------------------------|---------------|-------------|---------------| |
| 244 | | [fill] | 3204(+3204) | 0(+0) | 97(+97) | |
| 245 | | bl1/aem_generic.o | 0(+0) | 0(+0) | 0(+0) | |
| 246 | | bl1/arm_bl1_fwu.o | 224(+224) | 80(+80) | 0(+0) | |
| 247 | | bl1/arm_bl1_setup.o | 608(+608) | 0(+0) | 17(+17) | |
| 248 | | bl1/arm_common.o | 116(+116) | 0(+0) | 0(+0) | |
| 249 | | bl1/arm_console.o | 116(+116) | 0(+0) | 40(+40) | |
| 250 | | bl1/arm_dev_rotpk.o | 0(+0) | 0(+0) | 0(+0) | |
| 251 | | bl1/arm_dyn_cfg.o | 276(+276) | 0(+0) | 7184(+7184) | |
| 252 | | bl1/arm_dyn_cfg_helpers.o | 364(+364) | 0(+0) | 0(+0) | |
| 253 | | bl1/arm_err.o | 12(+12) | 0(+0) | 0(+0) | |
| 254 | | bl1/arm_fconf_io.o | 0(+0) | 952(+952) | 0(+0) | |
| 255 | | bl1/arm_helpers.o | 44(+44) | 0(+0) | 0(+0) | |
| 256 | | bl1/arm_io_storage.o | 480(+480) | 0(+0) | 32(+32) | |
| 257 | | bl1/auth_mod.o | 1288(+1288) | 0(+0) | 0(+0) | |
| 258 | | bl1/backtrace.o | 444(+444) | 0(+0) | 0(+0) | |
| 259 | | bl1/bl1_arch_setup.o | 16(+16) | 0(+0) | 0(+0) | |
| 260 | | bl1/bl1_context_mgmt.o | 340(+340) | 0(+0) | 1392(+1392) | |
| 261 | | bl1/bl1_entrypoint.o | 236(+236) | 0(+0) | 0(+0) | |
| 262 | | bl1/bl1_exceptions.o | 2240(+2240) | 0(+0) | 0(+0) | |
| 263 | | bl1/bl1_fwu.o | 2188(+2188) | 44(+44) | 0(+0) | |
| 264 | | bl1/bl1_main.o | 620(+620) | 0(+0) | 0(+0) | |
| 265 | | bl1/bl_common.o | 772(+772) | 0(+0) | 4(+4) | |
| 266 | | bl1/board_arm_helpers.o | 44(+44) | 0(+0) | 0(+0) | |
| 267 | | bl1/board_arm_trusted_boot.o | 44(+44) | 16(+16) | 0(+0) | |
| 268 | | bl1/cache_helpers.o | 112(+112) | 0(+0) | 0(+0) | |
| 269 | | bl1/cci.o | 408(+408) | 0(+0) | 24(+24) | |
| 270 | | bl1/context.o | 348(+348) | 0(+0) | 0(+0) | |
| 271 | | bl1/context_mgmt.o | 1692(+1692) | 0(+0) | 48(+48) | |
| 272 | | bl1/cortex_a35.o | 96(+96) | 0(+0) | 0(+0) | |
| 273 | | bl1/cortex_a53.o | 248(+248) | 0(+0) | 0(+0) | |
| 274 | | bl1/cortex_a57.o | 384(+384) | 0(+0) | 0(+0) | |
| 275 | | bl1/cortex_a72.o | 356(+356) | 0(+0) | 0(+0) | |
| 276 | | bl1/cortex_a73.o | 304(+304) | 0(+0) | 0(+0) | |
| 277 | | bl1/cpu_helpers.o | 200(+200) | 0(+0) | 0(+0) | |
| 278 | | bl1/crypto_mod.o | 380(+380) | 0(+0) | 0(+0) | |
| 279 | | bl1/debug.o | 224(+224) | 0(+0) | 0(+0) | |
| 280 | | bl1/delay_timer.o | 64(+64) | 0(+0) | 8(+8) | |
| 281 | | bl1/enable_mmu.o | 112(+112) | 0(+0) | 0(+0) | |
| 282 | | bl1/errata_report.o | 564(+564) | 0(+0) | 0(+0) | |
| 283 | | bl1/fconf.o | 148(+148) | 0(+0) | 0(+0) | |
| 284 | | bl1/fconf_dyn_cfg_getter.o | 656(+656) | 32(+32) | 144(+144) | |
| 285 | | bl1/fconf_tbbr_getter.o | 332(+332) | 0(+0) | 24(+24) | |
| 286 | | bl1/fdt_wrappers.o | 452(+452) | 0(+0) | 0(+0) | |
| 287 | | bl1/fvp_bl1_setup.o | 168(+168) | 0(+0) | 0(+0) | |
| 288 | | bl1/fvp_common.o | 512(+512) | 0(+0) | 8(+8) | |
| 289 | | bl1/fvp_cpu_pwr.o | 136(+136) | 0(+0) | 0(+0) | |
| 290 | | bl1/fvp_err.o | 44(+44) | 0(+0) | 0(+0) | |
| 291 | | bl1/fvp_helpers.o | 148(+148) | 0(+0) | 0(+0) | |
| 292 | | bl1/fvp_io_storage.o | 228(+228) | 0(+0) | 16(+16) | |
| 293 | | bl1/fvp_trusted_boot.o | 292(+292) | 0(+0) | 0(+0) | |
| 294 | | bl1/generic_delay_timer.o | 136(+136) | 0(+0) | 16(+16) | |
| 295 | | bl1/img_parser_mod.o | 588(+588) | 0(+0) | 20(+20) | |
| 296 | | bl1/io_fip.o | 1332(+1332) | 0(+0) | 100(+100) | |
| 297 | | bl1/io_memmap.o | 736(+736) | 16(+16) | 32(+32) | |
| 298 | | bl1/io_semihosting.o | 648(+648) | 16(+16) | 0(+0) | |
| 299 | | bl1/io_storage.o | 1268(+1268) | 0(+0) | 104(+104) | |
| 300 | | bl1/mbedtls_common.o | 208(+208) | 0(+0) | 4(+4) | |
| 301 | | bl1/mbedtls_crypto.o | 636(+636) | 0(+0) | 0(+0) | |
| 302 | | bl1/mbedtls_x509_parser.o | 1588(+1588) | 0(+0) | 120(+120) | |
| 303 | | bl1/misc_helpers.o | 392(+392) | 0(+0) | 0(+0) | |
| 304 | | bl1/multi_console.o | 528(+528) | 1(+1) | 8(+8) | |
| 305 | | bl1/pl011_console.o | 308(+308) | 0(+0) | 0(+0) | |
| 306 | | bl1/plat_bl1_common.o | 208(+208) | 0(+0) | 0(+0) | |
| 307 | | bl1/plat_bl_common.o | 40(+40) | 0(+0) | 0(+0) | |
| 308 | | bl1/plat_common.o | 48(+48) | 0(+0) | 8(+8) | |
| 309 | | bl1/plat_log_common.o | 48(+48) | 0(+0) | 0(+0) | |
| 310 | | bl1/plat_tbbr.o | 128(+128) | 0(+0) | 0(+0) | |
| 311 | | bl1/platform_helpers.o | 12(+12) | 0(+0) | 0(+0) | |
| 312 | | bl1/platform_up_stack.o | 16(+16) | 0(+0) | 0(+0) | |
| 313 | | bl1/semihosting.o | 352(+352) | 0(+0) | 0(+0) | |
| 314 | | bl1/semihosting_call.o | 8(+8) | 0(+0) | 0(+0) | |
| 315 | | bl1/smmu_v3.o | 296(+296) | 0(+0) | 0(+0) | |
| 316 | | bl1/sp805.o | 64(+64) | 0(+0) | 0(+0) | |
| 317 | | bl1/tbbr_cot_bl1.o | 0(+0) | 48(+48) | 156(+156) | |
| 318 | | bl1/tbbr_cot_common.o | 0(+0) | 144(+144) | 306(+306) | |
| 319 | | bl1/tbbr_img_desc.o | 0(+0) | 768(+768) | 0(+0) | |
| 320 | | bl1/tf_log.o | 200(+200) | 4(+4) | 0(+0) | |
| 321 | | bl1/xlat_tables_arch.o | 736(+736) | 0(+0) | 0(+0) | |
| 322 | | bl1/xlat_tables_context.o | 192(+192) | 96(+96) | 1296(+1296) | |
| 323 | | bl1/xlat_tables_core.o | 2112(+2112) | 0(+0) | 0(+0) | |
| 324 | | bl1/xlat_tables_utils.o | 8(+8) | 0(+0) | 0(+0) | |
| 325 | | lib/libc.a/assert.o | 48(+48) | 0(+0) | 0(+0) | |
| 326 | | lib/libc.a/exit.o | 64(+64) | 0(+0) | 8(+8) | |
| 327 | | lib/libc.a/memchr.o | 44(+44) | 0(+0) | 0(+0) | |
| 328 | | lib/libc.a/memcmp.o | 52(+52) | 0(+0) | 0(+0) | |
| 329 | | lib/libc.a/memcpy.o | 32(+32) | 0(+0) | 0(+0) | |
| 330 | | lib/libc.a/memmove.o | 52(+52) | 0(+0) | 0(+0) | |
| 331 | | lib/libc.a/memset.o | 140(+140) | 0(+0) | 0(+0) | |
| 332 | | lib/libc.a/printf.o | 1532(+1532) | 0(+0) | 0(+0) | |
| 333 | | lib/libc.a/snprintf.o | 1748(+1748) | 0(+0) | 0(+0) | |
| 334 | | lib/libc.a/strcmp.o | 44(+44) | 0(+0) | 0(+0) | |
| 335 | | lib/libc.a/strlen.o | 28(+28) | 0(+0) | 0(+0) | |
| 336 | | lib/libfdt.a/fdt.o | 1460(+1460) | 0(+0) | 0(+0) | |
| 337 | | lib/libfdt.a/fdt_ro.o | 1392(+1392) | 0(+0) | 0(+0) | |
| 338 | | lib/libfdt.a/fdt_wip.o | 244(+244) | 0(+0) | 0(+0) | |
| 339 | | lib/libmbedtls.a/asn1parse.o | 956(+956) | 0(+0) | 0(+0) | |
| 340 | | lib/libmbedtls.a/bignum.o | 6796(+6796) | 0(+0) | 0(+0) | |
| 341 | | lib/libmbedtls.a/bignum_core.o | 3252(+3252) | 0(+0) | 0(+0) | |
| 342 | | lib/libmbedtls.a/constant_time.o | 280(+280) | 0(+0) | 8(+8) | |
| 343 | | lib/libmbedtls.a/md.o | 504(+504) | 0(+0) | 0(+0) | |
| 344 | | lib/libmbedtls.a/memory_buffer_alloc.o | 1264(+1264) | 0(+0) | 40(+40) | |
| 345 | | lib/libmbedtls.a/oid.o | 752(+752) | 0(+0) | 0(+0) | |
| 346 | | lib/libmbedtls.a/pk.o | 872(+872) | 0(+0) | 0(+0) | |
| 347 | | lib/libmbedtls.a/pk_wrap.o | 848(+848) | 0(+0) | 0(+0) | |
| 348 | | lib/libmbedtls.a/pkparse.o | 516(+516) | 0(+0) | 0(+0) | |
| 349 | | lib/libmbedtls.a/platform.o | 92(+92) | 24(+24) | 0(+0) | |
| 350 | | lib/libmbedtls.a/platform_util.o | 96(+96) | 0(+0) | 0(+0) | |
| 351 | | lib/libmbedtls.a/rsa.o | 6588(+6588) | 0(+0) | 0(+0) | |
| 352 | | lib/libmbedtls.a/rsa_alt_helpers.o | 2340(+2340) | 0(+0) | 0(+0) | |
| 353 | | lib/libmbedtls.a/sha256.o | 1448(+1448) | 0(+0) | 0(+0) | |
| 354 | | lib/libmbedtls.a/x509.o | 1028(+1028) | 0(+0) | 0(+0) | |
| 355 | | Subtotals | 69632(+69632) | 2241(+2241) | 11264(+11264) | |
| 356 | Total Static RAM memory (data + bss): 13505(+13505) bytes |
| 357 | Total Flash memory (text + data): 71873(+71873) bytes |
| 358 | |
| 359 | A delta between two images can be generated by passing the ``--old`` option with |
| 360 | a path to the previous map file. |
| 361 | |
| 362 | For example: |
| 363 | |
| 364 | .. code:: |
| 365 | |
| 366 | $ poetry run memory summary ../maps/fvp-tbb-mbedtls/bl1.map --old ../maps/fvp-tbb-mbedtls/bl1.map.old -d 1 |
| 367 | | Module | .text | .data | .bss | |
| 368 | |-----------|---------------|----------|--------------| |
| 369 | | [fill] | 780(-2424) | 0(+0) | 321(+224) | |
| 370 | | bl1 | 32024(+108) | 2217(+0) | 11111(+0) | |
| 371 | | lib | 45020(+10508) | 24(+0) | 1880(+1824) | |
| 372 | | Subtotals | 77824(+8192) | 2241(+0) | 13312(+2048) | |
| 373 | Total Static RAM memory (data + bss): 15553(+2048) bytes |
| 374 | Total Flash memory (text + data): 80065(+8192) bytes |
| 375 | |
| 376 | Note that since the old map file includes the required suffix, specifying the |
| 377 | ``--old`` argument is optional here. |
| 378 | |
| 379 | Under some circumstances, some executables are padded to meet certain |
| 380 | alignments, such as a 4KB page boundary, and excluding that padding can provide |
| 381 | more helpful diffs. Taking the last example, and adding the ``-e`` argument |
| 382 | yields such a summary: |
| 383 | |
| 384 | .. code:: |
| 385 | |
| 386 | $ poetry run memory summary ../maps/fvp-tbb-mbedtls/bl1.map --old ../maps/fvp-tbb-mbedtls/bl1.map.old -d 1 -e |
| 387 | | Module | .text | .data | .bss | |
| 388 | |-----------|---------------|----------|--------------| |
| 389 | | bl1 | 32024(+108) | 2217(+0) | 11111(+0) | |
| 390 | | lib | 45020(+10508) | 24(+0) | 1880(+1824) | |
| 391 | | Subtotals | 77044(+10616) | 2241(+0) | 12991(+1824) | |
| 392 | Total Static RAM memory (data + bss): 15232(+1824) bytes |
| 393 | Total Flash memory (text + data): 79285(+10616) bytes |
| 394 | |
Harrison Mutai | e9bc488 | 2023-02-23 10:33:58 +0000 | [diff] [blame] | 395 | -------------- |
| 396 | |
Chris Kay | a116b87 | 2025-01-28 18:04:11 +0000 | [diff] [blame] | 397 | *Copyright (c) 2023-2025, Arm Limited. All rights reserved.* |
Harrison Mutai | e9bc488 | 2023-02-23 10:33:58 +0000 | [diff] [blame] | 398 | |
| 399 | .. _Poetry: https://python-poetry.org/docs/ |