通过以下方法转储的工作集似乎有所不同:
方法1:使用gcov(gcov转储手册页here)
gcc -ftest-coverage -fprofile-arcs program.c
//运行程序
gcov -w program.c
program.gcno: 01410000: 1:BLOCKS 10 blocks program.gcno: 01430000: 3:ARCS 1 arcs program.gcno: 01430000: 3:ARCS 1 arcs program.gcno: 01430000: 3:ARCS 1 arcs program.gcno: 01430000: 5:ARCS 2 arcs program.gcno: 01430000: 3:ARCS 1 arcs program.gcno: 01430000: 3:ARCS 1 arcs program.gcno: 01430000: 5:ARCS 2 arcs program.gcno: 01430000: 5:ARCS 2 arcs program.gcno: 01430000: 3:ARCS 1 arcs program.gcno: 01450000: 12:LINES program.gcno: 01450000: 11:LINES program.gcno: 01450000: 10:LINES program.gcno: 01450000: 13:LINES program.gcno: 01450000: 10:LINES program.gcno: 01450000: 10:LINES program.gcno: 01450000: 10:LINES program.gcno: 01450000: 10:LINES
Counter working sets: 0.78%: num counts=1, min counter=891420285 1.56%: num counts=1, min counter=891420285 2.34%: num counts=1, min counter=891420285 3.12%: num counts=1, min counter=891420285 3.90%: num counts=1, min counter=891420285 ... 97.50%: num counts=2, min counter=224114269 98.28%: num counts=2, min counter=224114269 99.06%: num counts=2, min counter=224114269 99.90%: num counts=2, min counter=224114269
应该如何解释在转储文件中显示工作集的输出(方法2)?在当前情况下,“工作集”的确切含义是什么?