1
2
3
4
5
6
7
8
9
10
11
[root@shanghai c++11]# gcc test3.c
[root@shanghai c++11]# valgrind --tool=callgrind --separate-threads=yes ./a.out 20

[root@shanghai c++11]# ll
total 88
-rwxr-xr-x 1 root root 8672 Mar 22 18:08 a.out
-rw------- 1 root root 12943 Mar 22 18:00 callgrind.out.19365
-rw------- 1 root root 13407 Mar 22 18:06 callgrind.out.19720


用 qcachegrind074-x64 打开callgrind.out 文件

如下图