Perf性能统计

来源:互联网 发布:五线谱转吉他谱软件 编辑:程序博客网 时间:2024/05/17 10:39

针对某个进程做perf统计:

perf record -e cpu-clock -p [pid] -g
[ perf record: Woken up 95 times to write data ][ perf record: Captured and wrote 23.788 MB perf.data (~1039333 samples) ]

查看统计结果:

perf report -g
Samples: 188K of event 'cpu-clock', Event count (approx.): 47241750000                                                                                       +   5.17%  xxxd  [kernel.kallsyms]          [k] SYSC_semtimedop                                                                                            ++   4.58%  xxxd  [kernel.kallsyms]          [k] system_call_after_swapgs                                                                                   :+   3.40%  xxxd  libc-2.17.so               [.] __GI___semop                                                                                               :+   3.40%  xxxd  [kernel.kallsyms]          [k] copy_user_enhanced_fast_string                                                                             :+   3.37%  xxxd  libxxx_x86.so.1  [.] shmem_hashtbl_find+ ……
0 0