Earlier quoted context omitted.
As I mentioned in my other comment, AdaCore's GNATstack tool appears to be capable of reporting this information conservatively but with enough accuracy to be useful. https://www.adacore.com/gnatpro/toolsuite/gnatstack
The tool will simply freak out when there is any recursion or indirect call. It's not helpful since it happens everywhere in standard libraries and non trivial programs (forget about sorting, any regex, parsing source code, linting, etc...). The only use case is for real-time embedded code -typically in aerospace- where the coding guidelines prohibits you from using any recursion at all and you have to prove the high…
I mentioned such restrictions in my other comment, [0] I should have mentioned them here too.