Perf (linux)

Perf tool can analyze kernel, applications, system libraries, software events through commands and subcommands. It can also be used as a PMU (performance monitoring unit) on Linux. - How to

Note use -fno-omit-frame-pointer to conserve callstack with optimized code

perf stat ./bench
perf record -g ./bench
perf report -g 'graph,0.5,caller' 

caption

Install

sudo apt install linux-tools-common
perf # and then install specific to kernel

Kernel setup

Enable Hardware Event

echo 0|sudo tee /proc/sys/kernel/perf_event_paranoid 
Written on November 13, 2021, Last update on November 13, 2021
benchmarking profiler