Do you really need flame graphs for that? Wouldn't any normal profiler tell you if a function and its children used 50% of your CPU?
I always struggle to see why people think flame graphs are so great, but I'm not sure if people are comparing them to a normal (non-graphical) profile or not.