perf-tools 简单试用
阅读原文时间:2023年07月10日阅读:3

per-tools 是性能优化大师brendan gregg 就有perf 以及ftrace 编写的性能优化工具集
提供了io 、网络、系统调用。。。大部分方面的性能分析工具。

  • clone 代码

git clone --depth 1 https://github.com/brendangregg/perf-tools

  • 基本使用
    查看io 延迟

./iolatency -Q

效果

./iolatency -Q

Tracing block I/O. Output every 1 seconds. Ctrl-C to end.

 >=(ms) .. <(ms) : I/O |Distribution |

      0 -> 1 : 0 | |

      1 -> 2 : 0 | |

      2 -> 4 : 0 | |

      4 -> 8 : 0 | |

      8 -> 16 : 2 |######################################|

 >=(ms) .. <(ms) : I/O |Distribution |

      0 -> 1 : 0 | |

 >=(ms) .. <(ms) : I/O |Distribution |

      0 -> 1 : 0 | |

 >=(ms) .. <(ms) : I/O |Distribution |

      0 -> 1 : 0 | |

^C

perf-tools 使用简单,同时github 上也提供了比较全的demo,可以方便学习

https://github.com/brendangregg/perf-tools