This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Finding the critical path in the overlay process

Hello,

I have a problem of internal data memory: I am too short in it.

In order to find the places which mostly affects the memory usage, I would like to find the critical path of the memory allocation usage in the overlay process.
for example, the following code:

f1()
{
  ...
  f2()
  ...
}
f2()
{
  ...
  f3()
  ...
}
f3()
{
  ...
}
f4()
{
  ...
}

I would like to get for the above code the following overlay (memory utilization) information:
f1--------(4) (Bytes)
----------f2----------------(8)
----------------------------f3--------(4)
f4------------------------------(12)
instead of:
f1
  +>>f2

f2
  +>>f3
f3
f4

This way I will be able to find out the functions that are on the critical path of the memory consuming, and focus on the memory usage optimization at the functions that optimizing their memory usage will make a diffrence on the whole program.
In the above example, I will be able to know that it will be better to focus on f1,f2,f3 instead of f4, since f4 is not in the critical path of the memory utilization using the overlay process.

If I can get the information in such a way, I will be happy to know how can I get it.
If not, this may be useful and it is worth thinking of putting this info in the next release of the linker.

Please reply with an answer telling me if this functionality is available in the current linker BL51, v5.12.

Thanks a lot.
.........Amit.

Parents
  • The map file tells you what you want to know. It shows the call tree, and it also has the assignments to data memory for each routine. Find the routines that use data addresses at high addresses, and that is part of one of the long paths. You can then look at the call tree to see how you got there.

    There's a lot of room for improvement here. It would be nice if there were a tool that could parse the map file and create a more visual representation of the call tree so that you could easily locate the critical path and analyze where to put effort into optimizing the memory usage. But as far as I know, for now, you must do the analysis by hand.

Reply
  • The map file tells you what you want to know. It shows the call tree, and it also has the assignments to data memory for each routine. Find the routines that use data addresses at high addresses, and that is part of one of the long paths. You can then look at the call tree to see how you got there.

    There's a lot of room for improvement here. It would be nice if there were a tool that could parse the map file and create a more visual representation of the call tree so that you could easily locate the critical path and analyze where to put effort into optimizing the memory usage. But as far as I know, for now, you must do the analysis by hand.

Children
  • Doing the calculation manually is what I have done. It took me about 2 hours work to put the required info into an excel sheet, but since at that time I had a memory space overflow not all the functions got into the call tree in the map file - so now I have to repeat the 2 hours work again.
    using the excel sheet I could find the critical path, and indeed, for each byte that was optimized, you could see the change in the map file directly.

    1) I am looking for an automatic tool or linker swtich that will produce information that will be orginized in a way that will show the call tree and the critical pathes in a clear way. (clearer then the call tree that is in the map file). Is there any such an option ?

    2) Besides, the internal memory usage as the linker reports was diffrent then the one that is in the call tree that I have built. There can be several reasons for that, and currently I think that it is beacuse the call tree from the map file, that I used when I created the full call tree in my excel sheet was incomplete due to memory overflow. my question regarding this non-compilance: are there any memory bytes that are not reported in the call tree in the map file ?

    Thanks.
    Amit

  • "another product" that I once used had a file that looked something like this:

    main-------------main-funca-funcb-|funcc
    main-funcd-------/
    
    main-funce
    
    main-funcf|funcg-funch
    main-funci|

    Oh, how I would love for Keil to produce such a file.

    Erik