
5

性能调优工具
source link: https://zhanggq.github.io/post/zgq-c-performance/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

最近搞UPF性能调优时,简单使用了一下性能调优工具,这里描述一下使用过程。gprof,vtune(待补充)。
一、gprof
编译
gprof是GNU profile工具,所以不需要单独安装什么,只需要编译时候加上-pg选项即可。
代码修改
gprof是需要程序正常退出才能生成报告。而对于UPF来说通常是不会退出的,所以直接加上telnet调试命令用于程序退出。
灌包测试
等UPF程序运行后,使用Trex进行100w流量灌包,2分钟后结束灌包并退出程序。此时发现已经产生了gmon.out文件。使用命令生成报告:
gprof up gmon.out –p
gprof up gmon.out –q
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK