Note: I posted a short version of this on Twitter some time ago. Let’s make it permanent here. One of the tasks a sampling code profiler will typically do is capturing stack traces at various points of program execution. Due to the random nature of sampling, you can’t expect to only get samples from your program. Some samples will be from within the kernel. In some cases, most samples will originate in the kernel due to the specifics of a workload. Capturing stack traces on Linux is done ...