But also I wonder exactly what the profiler samples. Does it just
sample the function that is currently executing or does it sample
the entire call stack?
Neither. By default it samples eight levels of the call stack on x86
and x86-64, and two levels on other platforms.