AFAIK许多现代的CPU有计数器的内存caching未命中/命中。
有没有可以查询这个API /程序? 有没有办法重置柜台?
我对任何通用或CPU特定的程序感兴趣。
注:我知道cachegrind,但这是一个模拟,而不是实际的CPU计数器。
好吧,我掠夺了更多的资源,看起来像CPUcaching命中/未命中计数器,我们必须去个别进程或基于pid或tid的跟踪。 换句话说,就是perf和oprofile。
例如性能统计给出了这个。
Performance counter stats for 'ls': 3.905621 task-clock # 0.831 CPUs utilized 1 context-switches # 0.000 M/sec 0 CPU-migrations # 0.000 M/sec 267 page-faults # 0.068 M/sec 379,003 cycles # 0.097 GHz [24.55%] 1,332,419 stalled-cycles-frontend # 351.56% frontend cycles idle [36.65%] <not counted> stalled-cycles-backend 833,177 instructions # 2.20 insns per cycle # 1.60 stalled cycles per insn 580,745 branches # 148.695 M/sec [95.65%] 37,799 branch-misses # 6.51% of all branches [71.09%] 0.004697863 seconds time elapsed
Oprofile给出了类似的输出,但性能非常好,IMO。
另一件事是,对于记忆库,numastat给你另一个层次的细节。
$ numastat node0 numa_hit 74263001 numa_miss 0 numa_foreign 0 interleave_hit 15459 local_node 74263001 other_node 0
是的,这个系统是一个1节点的系统。