[性能优化] perf

眉间皱痕 提交于 2020-03-06 15:04:40

 

运行时性能分析工具

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%

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!