[性能优化] perf
运行时性能分析工具
wiki:https://en.wikipedia.org/wiki/Perf_(Linux)
linux wiki:https://perf.wiki.kernel.org/index.php/Main_Page
tutorial:https://perf.wiki.kernel.org/index.php/Tutorial
https://github.com/torvalds/linux/tree/master/tools/perf/Documentation/
perf report
--time:: Only analyze samples within given time window: <start>,<stop>. Times have the format seconds.microseconds. If start is not given (i.e., time string is ',x.y') then analysis starts at the beginning of the file. If stop time is not given (i.e, time string is 'x.y,') then analysis goes to end of file. Also support time percent with multiple time range. Time string is 'a%/n,b%/m,...' or 'a%-b%,c%-%d,...'. For example: Select the second 10% time slice: perf report --time 10%/2 Select from 0% to 10% time slice: perf report --time 0%-10% Select the first and second 10% time slices: perf report --time 10%/1,10%/2 Select from 0% to 10% and 30% to 40% slices: perf report --time 0%-10%,30%-40%