linux kernel function callchain profiler
main source code comes from linux-tools profiler
make
and you will get src/kperf
this program needs to read kernel symbols, so you should always use sudo
specify the pid to monitor, the program will stop monitoring util the pid is finished or ctrl+c
sudo ./src/kperf -p <pid>
- pid > 0 means collect program and kernel function callchain
- pid < 0 means collect kernel function callchain only
you could use -t
to setup a timer, the program will stop monitoring when time's up
# monitor 60s
sudo ./src/kperf -p <pid> -t 60
the program will generate report.html
ctrl+f search all results, right click to highlight the marker
see the demo gif above