Profiling
From Vlsiwiki
To gather statistics of foo
perf record -g ./foo
If the benchmark is too fast and you do not have enough samples.
perf record -g -A ./foo perf record -g -A ./foo ... perf record -g -A ./foo perf record -g -A ./foo
To see the performance results
perf report