The pprof cpu profile shows user code (on the left) and code from the runtime package with their consumption of cpu time. I am wondering whether it is possible to make the connection between the two except for looking at the user code, changing it, profiling again, etc. - in a perfect world a tool would show me the lines in the user code that are responsible for runtime.allocSpan to be called.
What would be the fastest way to find the lines of code in the user code that are responsible?

This graph was generated with the same code being run. The difference is that the graph in the question was generated on
darwin/arm64and this one here was generated onlinux/amd64. I expected a graph like this one where it is clear to see which piece of the user code is responsible. So the fact that the graph in the question looks different is either due to the OS or the architecture. We'll run some more experiments to see which of the two it is and if a dev container can help if you are trying to get this nicer looking profile ondarwin/arm64host as well.Edit: The good news is that running a dev container on
darwin/arm64did the trick. We now get a nice lookingpprofas expected.