6.3.6.2 Call Graph Critical Paths
Immediately prior to the call graph tables in the list file are the
critical paths for memory usage identified in the call graphs. A critical path is printed
for each memory space and for each call graph. Look for a line similar to Critical Paths
under _main
in BANK0, which, for this example, indicates the critical path
for the main()
function (the root of one call graph) in bank 0 memory.
There will be one call graph for the function main()
and another for each
interrupt function. Each of these will appear for every memory space the device
defines.
A critical path here represents the biggest range of APBs stacked together in a contiguous block. Essentially, it identifies those functions whose APBs are contributing to the program’s memory usage in that particular memory space. If you can reduce the memory usage of these functions in the corresponding memory space, then you will affect the program’s total memory usage in that memory space.
This information can be presented as follows.
3793 ;; Critical Paths under _main in BANK0
3794 ;;
3795 ;; _main->_foobar
3796 ;; _foobar->___flsub
3797 ;; ___flsub->___fladd
In this example, it shows that of all the call graph paths starting from
the function main, the path in which main()
calls
foobar()
, which calls __flsub()
, which calls
__fladd()
, is using the largest block of memory in bank 0 RAM. The
exact memory usage of each function is shown in the call graph tables.
The memory used by functions that are not in the critical path will overlap entirely with that in the critical path. Reducing the memory usage of these will have no impact on the memory usage of the entire program.