Perf tool

Here is how to run perf for finding out why your code is slow.

Prior to using this, I had to enable perf recording:

sudo su
echo '-1' > /proc/sys/kernel/perf_event_paranoid

Then, I can run:

perf record -g ...
perf report