1.Installation perf:
sudo apt-get install linux-tools-common
sudo apt-get install linux-tools-4.15.0-47-generic linux-cloud-tools-4.15.0-47-generic (use 'uname -r' to check version )
2.Special setup:
sudo sysctl kernel.perf_event_paranoid=-1
sudo sysctl kernel.kptr_restrict=0
3.Run application
4.setup perf to sample our code
perf record -g -s -p `ps -ef | grep applicationname | grep -v grep | awk '{print $2}'`
Or perf record -g -s ./applicationname(this command is a combination of the step3 and step4)
5.run load (h2load)
6.check report (report will store as a file called perf.data)
perf report -d applicationname -g graph,0.05,caller,function or perf report