You can collect profiles from your production environment using some sort of continuous profiler, like Grafana Alloy or the OTel profiler. We actually built https://github.com/yandex/perforator specifically to profile everything we can reach.
This thing also greatly helps when exploring unfamiliar codebases. You can just open a flame graph in a few clicks and see what the program actually does.
This thing also greatly helps when exploring unfamiliar codebases. You can just open a flame graph in a few clicks and see what the program actually does.