gabe@_____soup.net

find out what's running inside kernel processes with perf

If you've ever seen kworker or some other kernel thread going crazy, you'll have noticed that 'top' doesn't tell you much. What you need is profile the system with perf for a couple seconds to see what is really going on. I did this when kworker was bringing my x61s to a halt, and it ended being the network card driver 'e1000e' making tons of spurious system calls. Linus suggested this here but I'm replicating it here because it took me a while to find.

perf record -ag sleep 10
perf report

The first commands runs 'sleep 10' and spits out information to a file. Running the second command loads the file automatically and brings you a sorted list of top kernel (or cpu, I'm not sure) time users. By hitting enter on the top culprits and zooming into them you should be able to quickly find out what kernel or driver calls are killing your machine. This worked like a charm for me, but might not work as well for non-kernel processes.